":type=GlobalRequestProcessor,name=" + getName()); Registry.getRegistry(null, null).registerComponent( getHandler().getGlobal(), rgOname, null );
Handler.SocketState state = getHandler().process(socket, SocketEvent.OPEN_READ); if (state == Handler.SocketState.CLOSED) {
/** * Deallocate APR memory pools, and close server socket. */ @Override public void unbind() throws Exception { if (running) { stop(); } // Destroy pool if it was initialised if (serverSockPool != 0) { Pool.destroy(serverSockPool); serverSockPool = 0; } doCloseServerSocket(); if (sslContext != 0) { Long ctx = Long.valueOf(sslContext); SSLContext.unregisterDefault(ctx); for (SSLHostConfig sslHostConfig : sslHostConfigs.values()) { sslHostConfig.setOpenSslContext(null); } sslContext = 0; } // Close all APR memory pools and resources if initialised if (rootPool != 0) { Pool.destroy(rootPool); rootPool = 0; } getHandler().recycle(); }
getHandler().release(ka);
getHandler().release(socket); } catch (Throwable e) { ExceptionUtils.handleThrowable(e);
":type=GlobalRequestProcessor,name=" + getName()); Registry.getRegistry(null, null).registerComponent( getHandler().getGlobal(), rgOname, null );
":type=GlobalRequestProcessor,name=" + getName()); Registry.getRegistry(null, null).registerComponent( getHandler().getGlobal(), rgOname, null );
":type=GlobalRequestProcessor,name=" + getName()); Registry.getRegistry(null, null).registerComponent( getHandler().getGlobal(), rgOname, null );
/** * Deallocate NIO memory pools, and close server socket. */ @Override public void unbind() throws Exception { if (log.isDebugEnabled()) { log.debug("Destroy initiated for "+new InetSocketAddress(getAddress(),getPort())); } if (running) { stop(); } doCloseServerSocket(); destroySsl(); super.unbind(); if (getHandler() != null ) { getHandler().recycle(); } selectorPool.close(); if (log.isDebugEnabled()) { log.debug("Destroy completed for "+new InetSocketAddress(getAddress(),getPort())); } }
@Override public void init() throws Exception { if (getLog().isInfoEnabled()) { getLog().info(sm.getString("abstractProtocolHandler.init", getName())); } if (oname == null) { // Component not pre-registered so register it oname = createObjectName(); if (oname != null) { Registry.getRegistry(null, null).registerComponent(this, oname, null); } } if (this.domain != null) { rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getName()); Registry.getRegistry(null, null).registerComponent( getHandler().getGlobal(), rgOname, null); } String endpointName = getName(); endpoint.setName(endpointName.substring(1, endpointName.length()-1)); endpoint.setDomain(domain); endpoint.init(); }
@Override protected void doRun() { try { // Process the request from this socket SocketState state = getHandler().process(socketWrapper, event); if (state == Handler.SocketState.CLOSED) { // Close socket and pool closeSocket(socketWrapper.getSocket().longValue()); } } finally { socketWrapper = null; event = null; //return to cache if (running && !paused) { processorCache.push(this); } } } }
/** * Deallocate NIO memory pools, and close server socket. */ @Override public void unbind() throws Exception { if (running) { stop(); } doCloseServerSocket(); destroySsl(); super.unbind(); // Unlike other connectors, the thread pool is tied to the server socket shutdownExecutor(); if (getHandler() != null) { getHandler().recycle(); } }
@Override public void close() { getEndpoint().getHandler().release(this); synchronized (closedLock) { // APR typically crashes if the same socket is closed twice so // make sure that doesn't happen. if (closed) { return; } closed = true; if (sslOutputBuffer != null) { ByteBufferUtils.cleanDirectBuffer(sslOutputBuffer); } ((AprEndpoint) getEndpoint()).getPoller().close(getSocket().longValue()); } }
@Override public void run() { // Then close all active connections if any remain try { for (Nio2Channel channel : getHandler().getOpenSockets()) { closeSocket(channel.getSocket()); } } catch (Throwable t) { ExceptionUtils.handleThrowable(t); } finally { allClosed = true; } } });
protected RequestGroupInfo getRequestGroupInfo(Object connectionHandler) { AbstractEndpoint.Handler handler = (AbstractEndpoint.Handler) connectionHandler; return (RequestGroupInfo) handler.getGlobal(); } }
/** * Pause the endpoint, which will stop it accepting new connections and * unlock the acceptor. */ public void pause() { if (running && !paused) { paused = true; releaseConnectionLatch(); unlockAccept(); getHandler().pause(); } }