Package org.eclipse.jetty.util

Examples of org.eclipse.jetty.util.Callback


            }
            else
            {
                _committed.set(false);
                LOG.warn("Commit failed",x);
                sendResponse(HttpGenerator.RESPONSE_500_INFO,null,true,new Callback()
                {
                    @Override
                    public void succeeded()
                    {
                        _callback.failed(x);
View Full Code Here


            reply(stream, clientReplyInfo);
        }

        private void reply(final Stream stream, final ReplyInfo clientReplyInfo)
        {
            receiverStream.reply(clientReplyInfo, new Callback()
            {
                @Override
                public void succeeded()
                {
                    if (LOG.isDebugEnabled())
View Full Code Here

                    super.consume(delta);
                    serverDataInfo.consume(delta);
                }
            };

            receiverStream.data(clientDataInfo, new Callback() //TODO: timeout???
            {
                @Override
                public void succeeded()
                {
                    if (LOG.isDebugEnabled())
View Full Code Here

                    LOG.debug("onContent called with response: {} and content: {}. Sending response content to client.",
                        response, content);
                final ByteBuffer contentCopy = httpClient.getByteBufferPool().acquire(content.remaining(), true);
                BufferUtil.flipPutFlip(content, contentCopy);
                ByteBufferDataInfo dataInfo = new ByteBufferDataInfo(contentCopy, false);
                clientStream.data(dataInfo, new Callback()
                {
                    @Override
                    public void failed(Throwable x)
                    {
                        LOG.debug("failed: ", x);
View Full Code Here

        }

        @Override
        void onEnter(final AbstractConnection connection)
        {
            Callback callback=new Callback()
            {
                @Override
                public void succeeded()
                {
                    while(true)
View Full Code Here

    /**
     * Call to signal that a read is now possible.
     */
    public void fillable()
    {
        Callback callback = _interested.get();
        if (callback != null && _interested.compareAndSet(callback, null))
            callback.succeeded();
    }
View Full Code Here

     *
     * @return true if the cause was passed to a {@link Callback} instance
     */
    public boolean onFail(Throwable cause)
    {
        Callback callback = _interested.get();
        if (callback != null && _interested.compareAndSet(callback, null))
        {
            callback.failed(cause);
            return true;
        }
        return false;
    }
View Full Code Here

        return false;
    }

    public void onClose()
    {
        Callback callback = _interested.get();
        if (callback != null && _interested.compareAndSet(callback, null))
            callback.failed(new ClosedChannelException());
    }
View Full Code Here

                // write the content asynchronously if supported
                if (request.isAsyncSupported())
                {
                    final AsyncContext context = request.startAsync();

                    ((HttpOutput)out).sendContent(content,new Callback()
                    {
                        @Override
                        public void succeeded()
                        {  
                            context.complete();
View Full Code Here

     * @param content The whole content to send
     * @param callback The callback to use to notify success or failure
     */
    public void sendContent(ByteBuffer content, final Callback callback)
    {
        write(content, true, new Callback()
        {
            @Override
            public void succeeded()
            {
                closed();
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.util.Callback

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.