Ejemplo n.º 1
0
  private void writeCommand(NotifyCommand notify) throws IOException, CharacterCodingException {
    OutputStream bytesOut = connection.getOutputStream();
    CharsetEncoder encoder = UTF_8.newEncoder();
    Writer textOut = new OutputStreamWriter(bytesOut, encoder);

    textOut.append("NOTIFY\n");
    textOut.append(format("barrier:%s\n", notify.getBarrier()));
    textOut.append("\n");
    textOut.flush();
  }
Ejemplo n.º 2
0
 public void notifyBarrier(String barrierName) throws Exception {
   final NotifyCommand notifyCommand = new NotifyCommand();
   notifyCommand.setBarrier(barrierName);
   this.writeCommand(notifyCommand);
 }