Package org.deftserver.web

Examples of org.deftserver.web.AsyncCallback


  }
 
  public static Timeout newKeepAliveTimeout(final SelectableChannel clientChannel, long keepAliveTimeout) {
    return new Timeout(
        System.currentTimeMillis() + keepAliveTimeout,
        new AsyncCallback() { public void onCallback() { Closeables.closeQuietly(clientChannel); } }
    );
  }
View Full Code Here


   */
  public void start() {
    IOLoop.INSTANCE.addTimeout(
        new Timeout(
            System.currentTimeMillis() + period,
            new AsyncCallback() { @Override public void onCallback() { run(); }}
        )
    );
  }
View Full Code Here

 
  private void startTimeout() {
    logger.debug("start timeout...");
    timeout = new Timeout(
        System.currentTimeMillis() + TIMEOUT,
        new AsyncCallback() { public void onCallback() { onTimeout(); } }
    );
    IOLoop.INSTANCE.addTimeout(timeout);   
  }
View Full Code Here

    logger.debug("Connected...");
    cancelTimeout();
    startTimeout();
    socket.write(
        makeRequestLineAndHeaders(),
        new AsyncCallback() { public void onCallback() { onWriteComplete(); }}
    );
  }
View Full Code Here

    readCallback = nopAsyncStringResult;
    cb.onFailure(e);
  }
 
  private void invokeWriteCallback() {
    AsyncCallback cb = writeCallback;
    writeCallback = AsyncCallback.nopCb;
    cb.onCallback();
  }
View Full Code Here

    writeCallback = AsyncCallback.nopCb;
    cb.onCallback();
  }
 
  private void invokeCloseCallback() {
    AsyncCallback cb = closeCallback;
    closeCallback = AsyncCallback.nopCb;
    cb.onCallback();
  }
View Full Code Here

    latch.await(5, TimeUnit.SECONDS);
  }
 
  @After
  public void tearDown() throws InterruptedException {
    IOLoop.INSTANCE.addCallback(new AsyncCallback() {
      @Override
      public void onCallback() { IOLoop.INSTANCE.stop(); }
    });
    Thread.sleep(300)// give the IOLoop thread some time to gracefully shutdown
  }
View Full Code Here

    // TODO stop ioloop
  }
 
  private void onConnect() {
    latch.countDown();
    AsyncCallback wcb = new AsyncCallback() { @Override public void onCallback() { onWriteComplete(); }};
    socket.write("roger|\r\n", wcb);
  }
View Full Code Here

    assertEquals(0, tm.getNumberOfTimeouts());
    assertEquals(0, tm.getNumberOfKeepAliveTimeouts());
  }
 
  private void addNopTimeout(long timeout) {
    tm.addTimeout(new Timeout(timeout, new AsyncCallback() {
      @Override public void onCallback() { /*nop*/}
    }))
  }
 
View Full Code Here

      @Override public void onCallback() { /*nop*/}
    }))
  }

  private void addNopKeepAliveTimeout(SelectableChannel channel, long timeout) {
    tm.addKeepAliveTimeout(channel, new Timeout(timeout, new AsyncCallback() {
      @Override public void onCallback() { /*nop*/ }
    }));
  }
View Full Code Here

TOP

Related Classes of org.deftserver.web.AsyncCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.