Examples of CompositeThreadSetupAction


Examples of io.undertow.servlet.core.CompositeThreadSetupAction

            try {
                readIntoBufferNonBlocking();
                if (pooled != null) {
                    state |= FLAG_READY;
                    if (!anyAreSet(state, FLAG_FINISHED)) {
                        CompositeThreadSetupAction action = request.getServletContext().getDeployment().getThreadSetupAction();
                        ThreadSetupAction.Handle handle = action.setup(request.getExchange());
                        try {
                            listener.onDataAvailable();
                        } finally {
                            handle.tearDown();
                        }
                        if(pooled != null) {
                            //they did not consume all the data
                            channel.suspendReads();
                        }
                    }
                }
            } catch (Exception e) {
                CompositeThreadSetupAction action = request.getServletContext().getDeployment().getThreadSetupAction();
                ThreadSetupAction.Handle handle = action.setup(request.getExchange());
                try {
                    listener.onError(e);
                } finally {
                    handle.tearDown();
                }
                IoUtils.safeClose(channel);
            }
            if (anyAreSet(state, FLAG_FINISHED)) {
                if (anyAreClear(state, FLAG_ON_DATA_READ_CALLED)) {
                    try {
                        state |= FLAG_ON_DATA_READ_CALLED;
                        channel.shutdownReads();
                        CompositeThreadSetupAction action = request.getServletContext().getDeployment().getThreadSetupAction();
                        ThreadSetupAction.Handle handle = action.setup(request.getExchange());
                        try {
                            listener.onAllDataRead();
                        } finally {
                            handle.tearDown();
                        }
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.