Package org.apache.catalina.connector.Request

Examples of org.apache.catalina.connector.Request.AsyncListenerRegistration


                boolean timeout = (event.getType() == EventType.TIMEOUT) ? true : false;
                boolean error = (event.getType() == EventType.ERROR) ? true : false;
                Iterator<AsyncListenerRegistration> asyncListenerRegistrations =
                    asyncContext.getAsyncListeners().values().iterator();
                while (asyncListenerRegistrations.hasNext()) {
                    AsyncListenerRegistration asyncListenerRegistration = asyncListenerRegistrations.next();
                    AsyncListener asyncListener = asyncListenerRegistration.getListener();
                    try {
                        if (timeout) {
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse());
                            asyncListener.onTimeout(asyncEvent);
                        } else if (error) {
                            Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse(), t);
                            asyncListener.onError(asyncEvent);
                        } else {
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse());
                            asyncListener.onComplete(asyncEvent);
                        }
                    } catch (Throwable e) {
                        container.getLogger().error(sm.getString("standardWrapper.async.listenerError",
                                getContainer().getName()), e);
View Full Code Here


                boolean timeout = (event.getType() == EventType.TIMEOUT) ? true : false;
                boolean error = (event.getType() == EventType.ERROR) ? true : false;
                Iterator<AsyncListenerRegistration> asyncListenerRegistrations =
                    asyncContext.getAsyncListeners().values().iterator();
                while (asyncListenerRegistrations.hasNext()) {
                    AsyncListenerRegistration asyncListenerRegistration = asyncListenerRegistrations.next();
                    AsyncListener asyncListener = asyncListenerRegistration.getListener();
                    try {
                        if (timeout) {
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse());
                            asyncListener.onTimeout(asyncEvent);
                        } else if (error) {
                            Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse(), t);
                            asyncListener.onError(asyncEvent);
                        } else {
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse());
                            asyncListener.onComplete(asyncEvent);
                        }
                    } catch (Throwable e) {
                        container.getLogger().error(sm.getString("standardWrapper.async.listenerError",
                                getContainer().getName()), e);
View Full Code Here

                boolean timeout = (event.getType() == EventType.TIMEOUT) ? true : false;
                boolean error = (event.getType() == EventType.ERROR) ? true : false;
                Iterator<AsyncListenerRegistration> asyncListenerRegistrations =
                    asyncContext.getAsyncListeners().values().iterator();
                while (asyncListenerRegistrations.hasNext()) {
                    AsyncListenerRegistration asyncListenerRegistration = asyncListenerRegistrations.next();
                    AsyncListener asyncListener = asyncListenerRegistration.getListener();
                    try {
                        if (timeout) {
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse());
                            asyncListener.onTimeout(asyncEvent);
                        } else if (error) {
                            Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse(), t);
                            asyncListener.onError(asyncEvent);
                        } else {
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse());
                            asyncListener.onComplete(asyncEvent);
                        }
                    } catch (Throwable e) {
                        container.getLogger().error(sm.getString("standardWrapper.async.listenerError",
                                getContainer().getName()), e);
View Full Code Here

                    asyncContext.getAsyncListeners().values().iterator();
                if (timeout && !asyncListenerRegistrations.hasNext()) {
                    // FIXME: MUST do an ERROR dispatch to the original URI and MUST set the response code to 500
                }
                while (asyncListenerRegistrations.hasNext()) {
                    AsyncListenerRegistration asyncListenerRegistration = asyncListenerRegistrations.next();
                    AsyncListener asyncListener = asyncListenerRegistration.getListener();
                    try {
                        if (timeout) {
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse());
                            asyncListener.onTimeout(asyncEvent);
                        } else if (error) {
                            Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse(), t);
                            asyncListener.onError(asyncEvent);
                        } else {
                            AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
                                    asyncListenerRegistration.getRequest(), asyncListenerRegistration.getResponse());
                            asyncListener.onComplete(asyncEvent);
                        }
                    } catch (Throwable e) {
                        container.getLogger().error(sm.getString("standardWrapper.async.listenerError",
                                getContainer().getName()), e);
View Full Code Here

TOP

Related Classes of org.apache.catalina.connector.Request.AsyncListenerRegistration

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.