@Override public void setContainer(Container container) { super.setContainer(container); if (container instanceof Engine || container instanceof Host) { clBindRequired = true; } else { clBindRequired = false; } }
@Override protected synchronized void stopInternal() throws LifecycleException { super.stopInternal(); engine = null; } }
public ObjectName[] getValveObjectNames() { ObjectName oname[]=new ObjectName[valves.length + 1]; for( int i=0; i<valves.length; i++ ) { if( valves[i] instanceof ValveBase ) oname[i]=((ValveBase)valves[i]).getObjectName(); } if( basic instanceof ValveBase ) oname[valves.length]=((ValveBase)basic).getObjectName(); return oname; }
/** {@inheritDoc} */ protected void startInternal() throws LifecycleException { super.startInternal(); logger.info("Starting..."); this.handler.init(); logger.info("Startup completed."); } }
@Override public String getDomainInternal() { Container c = getContainer(); if (c == null) { return null; } else { return c.getDomain(); } } }
/** * Start this component and implement the requirements * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected synchronized void startInternal() throws LifecycleException { setState(LifecycleState.STARTING); }
/** * Process a Comet event. This method will rarely need to be provided by * a subclass, unless it needs to reassociate a particular object with * the thread that is processing the request. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs, or is thrown * by a subsequently invoked Valve, Filter, or Servlet * @exception ServletException if a servlet error occurs, or is thrown * by a subsequently invoked Valve, Filter, or Servlet */ public void event(org.apache.catalina.connector.Request request, org.apache.catalina.connector.Response response, CometEvent event) throws IOException, ServletException { // Perform the request if (getNext() != null) { getNext().event(request, response, event); } }
private void unregisterValve(Valve valve) { if( valve instanceof ValveBase ) { try { ValveBase vb=(ValveBase)valve; if( vb.getController()!=null && vb.getController() == ((ContainerBase)container).getJmxName() ) { ObjectName vname=vb.getObjectName(); Registry.getRegistry(null, null).getMBeanServer() .unregisterMBean(vname); ((ValveBase)valve).setObjectName(null); } } catch( Throwable t ) { log.info( "Can't unregister valve " + valve , t ); } } }
@Override protected void initInternal() throws LifecycleException { super.initInternal(); uaPattern = Pattern.compile(crawlerUserAgents); }
@Override public void backgroundProcess() { super.backgroundProcess(); long thresholdInMillis = threshold * 1000; // Check monitored threads, being careful that the request might have // completed by the time we examine it for (MonitoredThread monitoredThread : activeThreads.values()) { long activeTime = monitoredThread.getActiveTimeInMillis(); if (activeTime >= thresholdInMillis && monitoredThread.markAsStuckIfStillRunning()) { int numStuckThreads = stuckCount.incrementAndGet(); notifyStuckThreadDetected(monitoredThread, activeTime, numStuckThreads); } } // Check if any threads previously reported as stuck, have finished. for (CompletedStuckThread completedStuckThread = completedStuckThreadsQueue.poll(); completedStuckThread != null; completedStuckThread = completedStuckThreadsQueue.poll()) { int numStuckThreads = stuckCount.decrementAndGet(); notifyStuckThreadCompleted(completedStuckThread, numStuckThreads); } }
/** {@inheritDoc} */ protected void startInternal() throws LifecycleException { super.startInternal(); logger.info("Starting..."); this.handler.init(); logger.info("Startup completed."); } }
@Override public String getDomainInternal() { return MBeanUtils.getDomain(getContainer()); } }
/** * Stop this component and implement the requirements * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected synchronized void stopInternal() throws LifecycleException { setState(LifecycleState.STOPPING); }
/** * Process a Comet event. This method will rarely need to be provided by * a subclass, unless it needs to reassociate a particular object with * the thread that is processing the request. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs, or is thrown * by a subsequently invoked Valve, Filter, or Servlet * @exception ServletException if a servlet error occurs, or is thrown * by a subsequently invoked Valve, Filter, or Servlet */ @Override public void event(Request request, Response response, CometEvent event) throws IOException, ServletException { // Perform the request getNext().event(request, response, event); }
private void unregisterValve(Valve valve) { if( valve instanceof ValveBase ) { try { ValveBase vb=(ValveBase)valve; if( vb.getController()!=null && vb.getController() == ((ContainerBase)container).getJmxName() ) { ObjectName vname=vb.getObjectName(); Registry.getRegistry(null, null).getMBeanServer() .unregisterMBean(vname); ((ValveBase)valve).setObjectName(null); } } catch( Throwable t ) { log.info( "Can't unregister valve " + valve , t ); } } }
@Override protected void initInternal() throws LifecycleException { super.initInternal(); uaPattern = Pattern.compile(crawlerUserAgents); }
@Override public void backgroundProcess() { super.backgroundProcess(); long thresholdInMillis = threshold * 1000; // Check monitored threads, being careful that the request might have // completed by the time we examine it for (MonitoredThread monitoredThread : activeThreads.values()) { long activeTime = monitoredThread.getActiveTimeInMillis(); if (activeTime >= thresholdInMillis && monitoredThread.markAsStuckIfStillRunning()) { int numStuckThreads = stuckCount.incrementAndGet(); notifyStuckThreadDetected(monitoredThread, activeTime, numStuckThreads); } } // Check if any threads previously reported as stuck, have finished. for (CompletedStuckThread completedStuckThread = completedStuckThreadsQueue.poll(); completedStuckThread != null; completedStuckThread = completedStuckThreadsQueue.poll()) { int numStuckThreads = stuckCount.decrementAndGet(); notifyStuckThreadCompleted(completedStuckThread, numStuckThreads); } }
/** {@inheritDoc} */ protected void startInternal() throws LifecycleException { super.startInternal(); logger.info("Starting..."); this.handler.init(); logger.info("Startup completed."); } }
/** * Cast to a StandardContext right away, as it will be needed later. * * @see org.apache.catalina.Contained#setContainer(org.apache.catalina.Container) */ public void setContainer(Container container) { super.setContainer(container); context = (SipStandardContext) container; }
@Override protected synchronized void stopInternal() throws LifecycleException { super.stopInternal(); engine = null; } }