public void resume() throws Exception { try { endpoint.resume(); } catch (Exception ex) { log.error(sm.getString("ajpprotocol.endpoint.resumeerror"), ex); throw ex; } if (log.isInfoEnabled()) log.info(sm.getString("ajpprotocol.resume", 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("ajpprotocol.endpoint.starterror"), ex); throw ex; } if (log.isInfoEnabled()) log.info(sm.getString("ajpprotocol.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("ajpprotocol.endpoint.initerror"), ex); throw ex; } if (log.isDebugEnabled()) { log.debug(sm.getString("ajpprotocol.init", getName())); } }
public void resume() throws Exception { try { endpoint.resume(); } catch (Exception ex) { CoyoteLogger.AJP_LOGGER.errorResumingEndpoint(ex); throw ex; } CoyoteLogger.AJP_LOGGER.resumingAjpProtocol(getName()); }
/** Start the protocol */ public void init() throws Exception { endpoint.setName(getName()); endpoint.setHandler(cHandler); try { endpoint.init(); } catch (Exception ex) { CoyoteLogger.AJP_LOGGER.errorInitializingEndpoint(ex); throw ex; } }
/** Start the protocol */ public void init() throws Exception { endpoint.setName(getName()); endpoint.setHandler(cHandler); try { endpoint.init(); } catch (Exception ex) { log.error(sm.getString("ajpprotocol.endpoint.initerror"), ex); throw ex; } if (log.isInfoEnabled()) { log.info(sm.getString("ajpprotocol.init", getName())); } }
public void pause() throws Exception { try { endpoint.pause(); } catch (Exception ex) { log.error(sm.getString("ajpprotocol.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("ajpprotocol.pause", 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("ajpprotocol.endpoint.starterror"), ex); throw ex; } if (log.isInfoEnabled()) log.info(sm.getString("ajpprotocol.start", getName())); }
public void destroy() throws Exception { if (log.isInfoEnabled()) log.info(sm.getString("ajpprotocol.stop", getName())); endpoint.destroy(); if (tpOname!=null) Registry.getRegistry(null, null).unregisterComponent(tpOname); if (rgOname != null) Registry.getRegistry(null, null).unregisterComponent(rgOname); }
protected void register(AjpProcessor 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=AjpRequest" + 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 resume() throws Exception { try { endpoint.resume(); } catch (Exception ex) { log.error(sm.getString("ajpprotocol.endpoint.resumeerror"), ex); throw ex; } if (log.isInfoEnabled()) log.info(sm.getString("ajpprotocol.resume", getName())); }
public void pause() throws Exception { try { endpoint.pause(); } catch (Exception ex) { CoyoteLogger.AJP_LOGGER.errorPausingEndpoint(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 < org.apache.coyote.Constants.MAX_PAUSE_WAIT) { retry++; done = true; 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) { ; } done = false; break; } } } CoyoteLogger.AJP_LOGGER.pausingAjpProtocol(getName()); }
worker = ((Http11AprProtocol)handler).getName(); } else if (handler instanceof AjpProtocol) { worker = ((AjpProtocol)handler).getName(); } else if (handler instanceof AjpAprProtocol) { worker = ((AjpAprProtocol)handler).getName();
worker = ((Http11AprProtocol)handler).getName(); } else if (handler instanceof AjpProtocol) { worker = ((AjpProtocol)handler).getName(); } else if (handler instanceof AjpAprProtocol) { worker = ((AjpAprProtocol)handler).getName();
public void pause() throws Exception { try { endpoint.pause(); } catch (Exception ex) { log.error(sm.getString("ajpprotocol.endpoint.pauseerror"), ex); throw ex; } if (log.isInfoEnabled()) log.info(sm.getString("ajpprotocol.pause", getName())); }
public void destroy() throws Exception { CoyoteLogger.AJP_LOGGER.stoppingAjpProtocol(getName()); endpoint.destroy(); 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); } }
protected void register(AjpProcessor 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=AjpRequest" + 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("ajpprotocol.stop", getName())); endpoint.destroy(); if (tpOname!=null) Registry.getRegistry(null, null).unregisterComponent(tpOname); if (rgOname != null) Registry.getRegistry(null, null).unregisterComponent(rgOname); }
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.AJP_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.AJP_LOGGER.errorStartingEndpoint(ex); throw ex; } CoyoteLogger.AJP_LOGGER.startingAjpProtocol(getName()); }
protected void register(AjpProcessor 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=AjpRequest" + 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"); } } } }