@Override public void close() throws Exception { // Make sure we run close logic only once if (isClosed.compareAndSet(false, true)) { final Request grizzlyRequest = request.getRequest(); HttpUpgradeHandler httpUpgradeHandler = request.getHttpUpgradeHandler(); try { httpUpgradeHandler.destroy(); } finally { try { inputStream.close(); } catch(Exception ignored) { } try { outputStream.close(); } catch(Exception ignored) { } grizzlyRequest.getResponse().resume(); } } } }
/** * Notifies this Request that the container-initiated dispatch * during which ServletRequest#startAsync was called is about to * return to the container */ void onAfterService() throws IOException { if (asyncContext != null) { asyncContext.setOkToConfigure(false); if (asyncStarted.get()) { request.getResponse().getSuspendContext().setTimeout( asyncContext.getTimeout(), MILLISECONDS); } } else if (isUpgrade()) { if (httpUpgradeHandler != null) { final WebConnection wc = WebConnectionFactory.create( this, getInputStream(), servletResponse.getOutputStream()); httpUpgradeHandler.init(wc); } else { LOGGER.log(Level.SEVERE, "HttpUpgradeHandler handler cannot be null"); } } }
httpUpgradeHandler.init((WebConnection) processor); } else { ClassLoader oldCL = upgradeToken.getContextBind().bind(false, null); try { httpUpgradeHandler.init((WebConnection) processor); } finally { upgradeToken.getContextBind().unbind(false, oldCL); InstanceManager instanceManager = upgradeToken.getInstanceManager(); if (instanceManager == null) { httpUpgradeHandler.destroy(); } else { ClassLoader oldCL = upgradeToken.getContextBind().bind(false, null); try { httpUpgradeHandler.destroy(); } finally { try {
/** * Notifies this Request that the container-initiated dispatch * during which ServletRequest#startAsync was called is about to * return to the container */ void onAfterService() throws IOException { if (asyncContext != null) { asyncContext.setOkToConfigure(false); if (asyncStarted.get()) { request.getResponse().getSuspendContext().setTimeout( asyncContext.getTimeout(), MILLISECONDS); } } else if (isUpgrade()) { if (httpUpgradeHandler != null) { final WebConnection wc = WebConnectionFactory.create( this, getInputStream(), servletResponse.getOutputStream()); httpUpgradeHandler.init(wc); } else { LOGGER.log(Level.SEVERE, "HttpUpgradeHandler handler cannot be null"); } } }
@Override public void close() throws Exception { // Make sure we run close logic only once if (isClosed.compareAndSet(false, true)) { final Request grizzlyRequest = request.getRequest(); HttpUpgradeHandler httpUpgradeHandler = request.getHttpUpgradeHandler(); try { httpUpgradeHandler.destroy(); } finally { try { inputStream.close(); } catch(Exception ignored) { } try { outputStream.close(); } catch(Exception ignored) { } grizzlyRequest.getResponse().resume(); } } } }
/** * Notifies this Request that the container-initiated dispatch * during which ServletRequest#startAsync was called is about to * return to the container */ void onAfterService() throws IOException { if (asyncContext != null) { asyncContext.setOkToConfigure(false); if (asyncStarted.get()) { request.getResponse().getSuspendContext().setTimeout( asyncContext.getTimeout(), MILLISECONDS); } } else if (isUpgrade()) { if (httpUpgradeHandler != null) { final WebConnection wc = WebConnectionFactory.create( this, getInputStream(), servletResponse.getOutputStream()); httpUpgradeHandler.init(wc); } else { LOGGER.log(Level.SEVERE, "HttpUpgradeHandler handler cannot be null"); } } }
@Override public void close() throws Exception { // Make sure we run close logic only once if (isClosed.compareAndSet(false, true)) { final Request grizzlyRequest = request.getRequest(); HttpUpgradeHandler httpUpgradeHandler = request.getHttpUpgradeHandler(); try { httpUpgradeHandler.destroy(); } finally { try { inputStream.close(); } catch(Exception ignored) { } try { outputStream.close(); } catch(Exception ignored) { } grizzlyRequest.getResponse().resume(); } } } }
/** * Notifies this Request that the container-initiated dispatch * during which ServletRequest#startAsync was called is about to * return to the container */ void onAfterService() throws IOException { if (asyncContext != null) { asyncContext.setOkToConfigure(false); if (asyncStarted.get()) { request.getResponse().getSuspendContext().setTimeout( asyncContext.getTimeout(), MILLISECONDS); } } else if (isUpgrade()) { if (httpUpgradeHandler != null) { final WebConnection wc = WebConnectionFactory.create( this, getInputStream(), servletResponse.getOutputStream()); httpUpgradeHandler.init(wc); } else { LOGGER.log(Level.SEVERE, "HttpUpgradeHandler handler cannot be null"); } } }
@Override public void close() throws Exception { // Make sure we run close logic only once if (isClosed.compareAndSet(false, true)) { final Request grizzlyRequest = request.getRequest(); HttpUpgradeHandler httpUpgradeHandler = request.getHttpUpgradeHandler(); try { httpUpgradeHandler.destroy(); } finally { try { inputStream.close(); } catch(Exception ignored) { } try { outputStream.close(); } catch(Exception ignored) { } grizzlyRequest.getResponse().resume(); } } } }
/** * Notifies this Request that the container-initiated dispatch * during which ServletRequest#startAsync was called is about to * return to the container */ void onAfterService() throws IOException { if (asyncContext != null) { asyncContext.setOkToConfigure(false); if (asyncStarted.get()) { request.getResponse().getSuspendContext().setTimeout( asyncContext.getTimeout(), MILLISECONDS); } } else if (isUpgrade()) { if (httpUpgradeHandler != null) { final WebConnection wc = WebConnectionFactory.create( this, getInputStream(), servletResponse.getOutputStream()); httpUpgradeHandler.init(wc); } else { LOGGER.log(Level.SEVERE, "HttpUpgradeHandler handler cannot be null"); } } }
@Override public void close() throws Exception { // Make sure we run close logic only once if (isClosed.compareAndSet(false, true)) { final Request grizzlyRequest = request.getRequest(); HttpUpgradeHandler httpUpgradeHandler = request.getHttpUpgradeHandler(); try { httpUpgradeHandler.destroy(); } finally { try { inputStream.close(); } catch(Exception ignored) { } try { outputStream.close(); } catch(Exception ignored) { } grizzlyRequest.getResponse().resume(); } } } }
/** * Notifies this Request that the container-initiated dispatch * during which ServletRequest#startAsync was called is about to * return to the container */ void onAfterService() throws IOException { if (asyncContext != null) { asyncContext.setOkToConfigure(false); if (asyncStarted.get()) { request.getResponse().getSuspendContext().setTimeout( asyncContext.getTimeout(), MILLISECONDS); } } else if (isUpgrade()) { if (httpUpgradeHandler != null) { final WebConnection wc = WebConnectionFactory.create( this, getInputStream(), servletResponse.getOutputStream()); httpUpgradeHandler.init(wc); } else { LOGGER.log(Level.SEVERE, "HttpUpgradeHandler handler cannot be null"); } } }
@Override public void close() throws Exception { // Make sure we run close logic only once if (isClosed.compareAndSet(false, true)) { final Request grizzlyRequest = request.getRequest(); HttpUpgradeHandler httpUpgradeHandler = request.getHttpUpgradeHandler(); try { httpUpgradeHandler.destroy(); } finally { try { inputStream.close(); } catch(Exception ignored) { } try { outputStream.close(); } catch(Exception ignored) { } grizzlyRequest.getResponse().resume(); } } } }
try { context.fireContainerEvent(ContainerEvent.BEFORE_UPGRADE_HANDLER_INITIALIZED, handler); handler.init(wc); } finally { context.fireContainerEvent(ContainerEvent.AFTER_UPGRADE_HANDLER_INITIALIZED, handler);
ContainerEvent.BEFORE_UPGRADE_HANDLER_DESTROYED, httpUpgradeHandler); httpUpgradeHandler.destroy(); } finally { context.fireContainerEvent(