public SessionListenerBridge(final Deployment deployment, final ApplicationListeners applicationListeners, final ServletContext servletContext) { this.applicationListeners = applicationListeners; this.servletContext = servletContext; this.destroyedAction = deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Void, Session>() { @Override public Void call(HttpServerExchange exchange, Session session) throws ServletException { doDestroy(session); return null; } }); }
public ServletUpgradeListener(final InstanceHandle<T> instance, Deployment deployment, HttpServerExchange exchange) { this.exchange = exchange; this.initAction = deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Void, StreamConnection>() { @Override public Void call(HttpServerExchange exchange, StreamConnection context) { DelayedExecutor executor = new DelayedExecutor(exchange.getIoThread()); try { //run the upgrade in the worker thread instance.getInstance().init(new WebConnectionImpl(context, ServletUpgradeListener.this.exchange.getConnection().getByteBufferPool(), executor)); } finally { executor.openGate(); } return null; } }); this.destroyAction = new ThreadSetupHandler.Action<Void, Object>() { @Override public Void call(HttpServerExchange exchange, Object context) throws Exception { try { instance.getInstance().destroy(); } finally { instance.release(); } return null; } }; }
this.onWritePossibleTask = deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Void, WriteListener>() { @Override public Void call(HttpServerExchange exchange, WriteListener context) throws Exception { this.onDataAvailableTask = deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Void, ReadListener>() { @Override public Void call(HttpServerExchange exchange, ReadListener context) throws Exception { this.onAllDataReadTask = deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Void, ReadListener>() { @Override public Void call(HttpServerExchange exchange, ReadListener context) throws Exception { this.invokeActionTask = deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Void, ThreadSetupHandler.Action<Void, Object>>() { @Override public Void call(HttpServerExchange exchange, ThreadSetupHandler.Action<Void, Object> context) throws Exception {
public ServletInitialHandler(final ServletPathMatches paths, final HttpHandler next, final Deployment deployment, final ServletContextImpl servletContext) { this.next = next; this.servletContext = servletContext; this.paths = paths; this.listeners = servletContext.getDeployment().getApplicationListeners(); SecurityManager sm = System.getSecurityManager(); if(sm != null) { //handle request can use doPrivilidged //we need to make sure this is not abused sm.checkPermission(PERMISSION); } ExceptionHandler handler = servletContext.getDeployment().getDeploymentInfo().getExceptionHandler(); if(handler != null) { this.exceptionHandler = handler; } else { this.exceptionHandler = LoggingExceptionHandler.DEFAULT; } this.firstRequestHandler = deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Object, ServletRequestContext>() { @Override public Object call(HttpServerExchange exchange, ServletRequestContext context) throws Exception { handleFirstRequest(exchange, context); return null; } }); }
try { deploymentService.getDeployment().createThreadSetupAction((exchange, ctxObject) -> { Servlet resteasyServlet = null; for (Map.Entry<String, ServletHandler> servletHandler : deploymentService.getDeployment().getServlets().getServletHandlers().entrySet()) {
try { deploymentService.getDeployment().createThreadSetupAction((exchange, ctxObject) -> { Servlet resteasyServlet = null; for (Map.Entry<String, ServletHandler> servletHandler : deploymentService.getDeployment().getServlets().getServletHandlers().entrySet()) {
try { deploymentService.getDeployment().createThreadSetupAction(new ThreadSetupHandler.Action<Object, Object>() { @Override public Object call(HttpServerExchange exchange, Object ctxObject) throws Exception {
try { deploymentService.getDeployment().createThreadSetupAction(new ThreadSetupHandler.Action<Object, Object>() { @Override public Object call(HttpServerExchange exchange, Object ctxObject) throws Exception {