Examples of OutputSink


Examples of com.goodow.realtime.store.impl.DocumentBridge.OutputSink

            JsonObject body = message.body();
            CollaborativeOperation op = transformer.createOperation(body);
            bridge.consume(op);
          }
        });
    bridge.setOutputSink(new OutputSink() {
      @Override
      public void close() {
        handlerReg.unregister();
      }
View Full Code Here

Examples of com.goodow.realtime.store.impl.DocumentBridge.OutputSink

    channel = new OperationChannel<CollaborativeOperation>(id, transformer, bus, this);
  }

  public void load(final DocumentBridge bridge, double version) {
    this.bridge = bridge;
    bridge.setOutputSink(new OutputSink() {
      @Override
      public void close() {
        channel.disconnect();
      }
View Full Code Here

Examples of org.glassfish.grizzly.OutputSink

    }
   
    private NextAction flush(final FilterChainContext ctx) {
        final HttpContext httpContext = HttpContext.get(ctx);
        assert httpContext != null;
        final OutputSink output = httpContext.getOutputSink();

        if (output.canWrite()) {  // if connection write queue is not overloaded
            return ctx.getStopAction();
        } else { // if connection write queue is overloaded

            // prepare context for suspend
            final NextAction suspendAction = ctx.getSuspendAction();
            ctx.suspend();

            // notify when connection becomes writable, so we can resume it
            output.notifyCanWrite(new WriteHandler() {
                @Override
                public void onWritePossible() throws Exception {
                    finish();
                }
View Full Code Here

Examples of org.glassfish.grizzly.OutputSink

    }
   
    private NextAction flush(final FilterChainContext ctx) {
        final HttpContext httpContext = HttpContext.get(ctx);
        assert httpContext != null;
        final OutputSink output = httpContext.getOutputSink();

        if (output.canWrite()) {  // if connection write queue is not overloaded
            return ctx.getStopAction();
        } else { // if connection write queue is overloaded

            // prepare context for suspend
            final NextAction suspendAction = ctx.getSuspendAction();
            ctx.suspend();

            // notify when connection becomes writable, so we can resume it
            output.notifyCanWrite(new WriteHandler() {
                @Override
                public void onWritePossible() throws Exception {
                    finish();
                }
View Full Code Here

Examples of org.glassfish.grizzly.OutputSink

         * will block is dependent on the write timeout of the transport
         * associated with the specified connection.
         */
        private static void blockUntilQueueFree(final FilterChainContext ctx) {
            HttpContext httpContext = HttpContext.get(ctx);
            final OutputSink outputSink = httpContext.getOutputSink();
            if (!outputSink.canWrite()) {
                final FutureImpl<Boolean> future = Futures.createSafeFuture();
                outputSink.notifyCanWrite(new WriteHandler() {

                    @Override
                    public void onWritePossible() throws Exception {
                        future.result(TRUE);
                    }
View Full Code Here

Examples of org.glassfish.grizzly.OutputSink

         * {@inheritDoc}
         */
        @Override
        public synchronized void flush() throws IOException {
            final HttpContext httpContext = HttpContext.get(feedableBodyGenerator.context);
            final OutputSink outputSink = httpContext.getOutputSink();
            if (isReady()) {
                final boolean notReady = writeUntilFullOrDone(outputSink);
                if (!isDone()) {
                    if (notReady) {
                        notifyReadyToFeed(new ReadyToFeedListenerImpl());
                    } else {
                        // write queue is full, leverage WriteListener to let us know
                        // when it is safe to write again.
                        outputSink.notifyCanWrite(new WriteHandlerImpl());
                    }
                }
            } else {
                notifyReadyToFeed(new ReadyToFeedListenerImpl());
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.