Refine search
private void stopProtocolHandler(Connector connector) { try { connector.getProtocolHandler().stop(); } catch (Exception ex) { logger.error("Cannot pause connector: ", ex); } }
@Override public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception { final Optional<Adapter> coyoteAdapter = connector().map(c -> c.getProtocolHandler().getAdapter());
@Override public int getBusyThreads() { Executor executor = this.connector.getProtocolHandler().getExecutor(); if (executor != null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor) executor).getActiveCount(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor) executor).getActiveCount(); } } return 0; }
/** * Perform a pause on the server. * @throw InterruptedException if we have an interruption */ public void pause() { // Used to properly handle the work queue. final Executor executor = connector.getProtocolHandler().getExecutor(); // Start the pause. connector.pause(); }
/** * Begin processing requests via this Connector. * * @exception LifecycleException if a fatal startup error occurs */ @Override protected void startInternal() throws LifecycleException { // Validate settings before starting if (getPort() < 0) { throw new LifecycleException(sm.getString( "coyoteConnector.invalidPort", Integer.valueOf(getPort()))); } setState(LifecycleState.STARTING); try { protocolHandler.start(); } catch (Exception e) { throw new LifecycleException( sm.getString("coyoteConnector.protocolHandlerStartFailed"), e); } }
@Override protected void initInternal() throws LifecycleException { super.initInternal(); // Initialize adapter adapter = new CoyoteAdapter(this); protocolHandler.setAdapter(adapter); // Make sure parseBodyMethodsSet has a default if( null == parseBodyMethodsSet ) { setParseBodyMethods(getParseBodyMethods()); } if (protocolHandler.isAprRequired() && !AprLifecycleListener.isAprAvailable()) { throw new LifecycleException( sm.getString("coyoteConnector.protocolHandlerNoApr", getProtocolHandlerClassName())); } try { protocolHandler.init(); } catch (Exception e) { throw new LifecycleException (sm.getString ("coyoteConnector.protocolHandlerInitializationFailed"), e); } }
Charset uriCharset = request.getConnector().getURICharset(); String originalQueryStringEncoded = request.getQueryString(); MessageBytes urlMB = if (!connector.getProtocolHandler().getAdapter().prepare( request.getCoyoteRequest(), response.getCoyoteResponse())) { return; Pipeline pipeline = connector.getService().getContainer().getPipeline(); request.setAsyncSupported(pipeline.isAsyncSupported()); pipeline.getFirst().invoke(request, response);
@Override protected void initInternal() throws LifecycleException { super.initInternal(); // Initialize adapter adapter = new CoyoteAdapter(this); protocolHandler.setAdapter(adapter); // Make sure parseBodyMethodsSet has a default if( null == parseBodyMethodsSet ) setParseBodyMethods(getParseBodyMethods()); try { protocolHandler.init(); } catch (Exception e) { throw new LifecycleException (sm.getString ("coyoteConnector.protocolHandlerInitializationFailed"), e); } // Initialize mapper listener mapperListener.init(); }
@Override protected void destroyInternal() throws LifecycleException { try { protocolHandler.destroy(); } catch (Exception e) { throw new LifecycleException (sm.getString ("coyoteConnector.protocolHandlerDestroyFailed"), e); } if (getService() != null) { getService().removeConnector(this); } super.destroyInternal(); }
oname = createObjectName(cb.getName(), "Connector"); Registry.getRegistry(null, null) .registerComponent(this, oname, null); protocolHandler.setAdapter(adapter); protocolHandler.init(); } catch (Exception e) { throw new LifecycleException
/** * Terminate processing requests via this Connector. * * @exception LifecycleException if a fatal shutdown error occurs */ @Override protected void stopInternal() throws LifecycleException { setState(LifecycleState.STOPPING); try { if (protocolHandler != null) { protocolHandler.stop(); } } catch (Exception e) { throw new LifecycleException( sm.getString("coyoteConnector.protocolHandlerStopFailed"), e); } }
public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return INTERNAL_EXECUTOR_NAME; }
/** * Pause the connector. */ public void pause() throws LifecycleException { try { protocolHandler.pause(); } catch (Exception e) { log.error(sm.getString ("coyoteConnector.protocolHandlerPauseFailed"), e); } }
/** * Pause the connector. */ public void resume() throws LifecycleException { try { protocolHandler.resume(); } catch (Exception e) { log.error(sm.getString ("coyoteConnector.protocolHandlerResumeFailed"), e); } }
/** * Begin processing requests via this Connector. * * @exception LifecycleException if a fatal startup error occurs */ @Override protected void startInternal() throws LifecycleException { setState(LifecycleState.STARTING); try { protocolHandler.start(); } catch (Exception e) { String errPrefix = ""; if(this.service != null) { errPrefix += "service.getName(): \"" + this.service.getName() + "\"; "; } throw new LifecycleException (errPrefix + " " + sm.getString ("coyoteConnector.protocolHandlerStartFailed"), e); } mapperListener.start(); }
initialize(); (protocolHandler, createObjectName(this.domain,"ProtocolHandler"), null); } catch (Exception ex) { log.error(sm.getString protocolHandler.start(); } catch (Exception e) { String errPrefix = ""; ObjectName mapperOname = createObjectName(this.domain,"Mapper"); if (log.isDebugEnabled()) log.debug(sm.getString(
/** * Terminate processing requests via this Connector. * * @exception LifecycleException if a fatal shutdown error occurs */ public void stop() throws LifecycleException { // Validate and update our current state if (!started) { log.error(sm.getString("coyoteConnector.notStarted")); return; } lifecycle.fireLifecycleEvent(STOP_EVENT, null); started = false; try { Registry.getRegistry(null, null).unregisterComponent (createObjectName(this.domain,"ProtocolHandler")); } catch (MalformedObjectNameException e) { log.error( sm.getString ("coyoteConnector.protocolUnregistrationFailed"), e); } try { protocolHandler.destroy(); } catch (Exception e) { throw new LifecycleException (sm.getString ("coyoteConnector.protocolHandlerDestroyFailed", e)); } }
init(); (protocolHandler, createObjectName(this.domain,"ProtocolHandler"), null); } catch (Exception ex) { CatalinaLogger.CONNECTOR_LOGGER.failedProtocolJmxRegistration(oname, ex); protocolHandler.start(); } catch (Exception e) { throw new LifecycleException
/** * Begin processing requests via this Connector. * * @exception LifecycleException if a fatal startup error occurs */ @Override protected void startInternal() throws LifecycleException { // Validate settings before starting if (getPortWithOffset() < 0) { throw new LifecycleException(sm.getString( "coyoteConnector.invalidPort", Integer.valueOf(getPortWithOffset()))); } setState(LifecycleState.STARTING); try { protocolHandler.start(); } catch (Exception e) { throw new LifecycleException( sm.getString("coyoteConnector.protocolHandlerStartFailed"), e); } }