/** Start the protocol */ public void init() throws Exception { endpoint.setName(getName()); endpoint.setHandler(cHandler); try { endpoint.init(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.initerror"), ex); throw ex; } if(log.isDebugEnabled()) log.debug(sm.getString("http11protocol.init", getName())); }
public void resume() throws Exception { try { endpoint.resume(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.resumeerror"), ex); throw ex; } if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.resume", getName())); }
/** Start the protocol */ public void init() throws Exception { endpoint.setName(getName()); endpoint.setHandler(cHandler); try { endpoint.init(); } catch (Exception ex) { CoyoteLogger.HTTP_APR_LOGGER.errorInitializingEndpoint(ex); throw ex; } CoyoteLogger.HTTP_APR_LOGGER.initHttpConnector(getName()); }
public void start() throws Exception { if( this.domain != null ) { try { tpOname=new ObjectName (domain + ":" + "type=ThreadPool,name=" + getName()); Registry.getRegistry(null, null) .registerComponent(endpoint, tpOname, null ); } catch (Exception e) { log.error("Can't register threadpool" ); } rgOname=new ObjectName (domain + ":type=GlobalRequestProcessor,name=" + getName()); Registry.getRegistry(null, null).registerComponent ( cHandler.global, rgOname, null ); } try { endpoint.start(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.starterror"), ex); throw ex; } if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.start", getName())); }
public void resume() throws Exception { try { endpoint.resume(); } catch (Exception ex) { CoyoteLogger.HTTP_APR_LOGGER.errorResumingEndpoint(ex); throw ex; } CoyoteLogger.HTTP_APR_LOGGER.resumeHttpConnector(getName()); }
public void start() throws Exception { if( this.domain != null ) { try { tpOname=new ObjectName (domain + ":" + "type=ThreadPool,name=" + getName()); Registry.getRegistry(null, null) .registerComponent(endpoint, tpOname, null ); } catch (Exception e) { log.error("Can't register threadpool" ); } rgOname=new ObjectName (domain + ":type=GlobalRequestProcessor,name=" + getName()); Registry.getRegistry(null, null).registerComponent ( cHandler.global, rgOname, null ); } try { endpoint.start(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.starterror"), ex); throw ex; } if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.start", getName())); }
/** Start the protocol */ public void init() throws Exception { endpoint.setName(getName()); endpoint.setHandler(cHandler); try { endpoint.init(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.initerror"), ex); throw ex; } if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.init", getName())); }
protected void register(Http11AprProcessor processor) { if (proto.getDomain() != null) { synchronized (this) { try { long count = registerCount.incrementAndGet(); RequestInfo rp = processor.getRequest().getRequestProcessor(); rp.setGlobalProcessor(global); ObjectName rpName = new ObjectName (proto.getDomain() + ":type=RequestProcessor,worker=" + proto.getName() + ",name=HttpRequest" + count); if (log.isDebugEnabled()) { log.debug("Register " + rpName); } Registry.getRegistry(null, null).registerComponent(rp, rpName, null); rp.setRpName(rpName); } catch (Exception e) { log.warn("Error registering request"); } } } }
public void destroy() throws Exception { CoyoteLogger.HTTP_APR_LOGGER.stopHttpConnector(getName()); if (canDestroy) { endpoint.destroy(); } else { CoyoteLogger.HTTP_APR_LOGGER.cannotDestroyHttpProtocol(getName()); try { RequestInfo[] states = cHandler.global.getRequestProcessors(); for (int i = 0; i < states.length; i++) { if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) { // FIXME: Log RequestInfo content } } } catch (Exception ex) { CoyoteLogger.HTTP_APR_LOGGER.cannotDestroyHttpProtocolWithException(getName(), ex); throw ex; } } if (org.apache.tomcat.util.Constants.ENABLE_MODELER) { if( tpOname!=null ) Registry.getRegistry(null, null).unregisterComponent(tpOname); if( rgOname != null ) Registry.getRegistry(null, null).unregisterComponent(rgOname); } }
public void pause() throws Exception { try { endpoint.pause(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.pauseerror"), ex); throw ex; } // Wait for a while until all the processors are idle RequestInfo[] states = cHandler.global.getRequestProcessors(); int retry = 0; boolean done = false; while (!done && retry < 20) { retry++; for (int i = 0; i < states.length; i++) { if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) { try { Thread.sleep(1000); } catch (InterruptedException e) { ; } continue; } } done = true; } if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.pause", getName())); }
public void destroy() throws Exception { if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.stop", getName())); endpoint.destroy(); if( tpOname!=null ) Registry.getRegistry(null, null).unregisterComponent(tpOname); if( rgOname != null ) Registry.getRegistry(null, null).unregisterComponent(rgOname); }
CoyoteLogger.HTTP_APR_LOGGER.pauseHttpConnector(getName());
public void pause() throws Exception { try { endpoint.pause(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.pauseerror"), ex); throw ex; } if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.pause", getName())); }
public void resume() throws Exception { try { endpoint.resume(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.resumeerror"), ex); throw ex; } if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.resume", getName())); }
worker = ((Http11NioProtocol)handler).getName(); } else if (handler instanceof Http11AprProtocol) { worker = ((Http11AprProtocol)handler).getName(); } else if (handler instanceof AjpProtocol) { worker = ((AjpProtocol)handler).getName();
worker = ((Http11NioProtocol)handler).getName(); } else if (handler instanceof Http11AprProtocol) { worker = ((Http11AprProtocol)handler).getName(); } else if (handler instanceof AjpProtocol) { worker = ((AjpProtocol)handler).getName();
public void start() throws Exception { if (org.apache.tomcat.util.Constants.ENABLE_MODELER) { if( this.domain != null ) { try { tpOname=new ObjectName (domain + ":" + "type=ThreadPool,name=" + getJmxName()); Registry.getRegistry(null, null) .registerComponent(endpoint, tpOname, null ); } catch (Exception e) { CoyoteLogger.HTTP_APR_LOGGER.errorRegisteringPool(e); } rgOname=new ObjectName (domain + ":type=GlobalRequestProcessor,name=" + getJmxName()); Registry.getRegistry(null, null).registerComponent ( cHandler.global, rgOname, null ); } } try { endpoint.start(); } catch (Exception ex) { CoyoteLogger.HTTP_APR_LOGGER.errorStartingEndpoint(ex); throw ex; } CoyoteLogger.HTTP_APR_LOGGER.startHttpConnector(getName()); }
protected void register(Http11AprProcessor processor) { if (proto.getDomain() != null) { synchronized (this) { try { long count = registerCount.incrementAndGet(); RequestInfo rp = processor.getRequest().getRequestProcessor(); rp.setGlobalProcessor(global); ObjectName rpName = new ObjectName (proto.getDomain() + ":type=RequestProcessor,worker=" + proto.getName() + ",name=HttpRequest" + count); if (log.isDebugEnabled()) { log.debug("Register " + rpName); } Registry.getRegistry(null, null).registerComponent(rp, rpName, null); rp.setRpName(rpName); } catch (Exception e) { log.warn("Error registering request"); } } } }
public void destroy() throws Exception { if(log.isInfoEnabled()) log.info(sm.getString("http11protocol.stop", getName())); endpoint.destroy(); if( tpOname!=null ) Registry.getRegistry(null, null).unregisterComponent(tpOname); if( rgOname != null ) Registry.getRegistry(null, null).unregisterComponent(rgOname); }
final ObjectName rpName = new ObjectName (proto.getDomain() + ":type=RequestProcessor,worker=" + proto.getName() + ",name=HttpRequest" + count); if (log.isDebugEnabled()) { log.debug("Register " + rpName);