コード例 #1
0
ファイル: Client.java プロジェクト: prosonf/BStalkJ
 private String execute(BeanstalkProtocol.Command command, byte[] data) {
   try {
     this.init();
     connection.write(data);
     String response = connection.readControlResponse();
     command.check(response);
     return response;
   } catch (BeanstalkDisconnectedException e) {
     this.active = false;
     throw e;
   }
 }
コード例 #2
0
ファイル: Client.java プロジェクト: prosonf/BStalkJ
 private String execute(BeanstalkProtocol.Command command, byte[] data, Object... args) {
   try {
     String commandAsString = command.get(args);
     log.info("Command as String: {}", commandAsString);
     ByteArrayOutputStream buf = new ByteArrayOutputStream();
     buf.write(commandAsString.getBytes());
     buf.write(data);
     buf.write("\r\n".getBytes());
     return execute(command, buf.toByteArray());
   } catch (Exception x) {
     throw new BeanstalkException(x);
   }
 }
コード例 #3
0
ファイル: Client.java プロジェクト: prosonf/BStalkJ
 private String execute(BeanstalkProtocol.Command command, Object... args) {
   String commandAsString = command.get(args);
   log.info("Command as String: {}", commandAsString);
   return execute(command, commandAsString.getBytes());
 }