Exemple #1
0
 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;
   }
 }
Exemple #2
0
 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);
   }
 }
Exemple #3
0
 private String execute(BeanstalkProtocol.Command command, Object... args) {
   String commandAsString = command.get(args);
   log.info("Command as String: {}", commandAsString);
   return execute(command, commandAsString.getBytes());
 }