/** * Retrieves executor by name, null if not found * @param executorName String * @return Executor */ @Override public Executor getExecutor(String executorName) { synchronized (executors) { for (Executor executor: executors) { if (executorName.equals(executor.getName())) return executor; } } return null; }
/** * Adds a named executor to the service * @param ex Executor */ public void addExecutor(Executor ex) { synchronized (executors) { if (!executors.contains(ex)) { executors.add(ex); if (started) try { ex.start(); } catch (LifecycleException x) { log.error("Executor.start", x); } } } }
/** * Removes an executor from the service * @param ex Executor */ public void removeExecutor(Executor ex) { synchronized (executors) { if ( executors.remove(ex) && started ) { try { ex.stop(); } catch (LifecycleException e) { log.error("Executor.stop", e); } } } }
@Override protected void destroyInternal() throws LifecycleException { mapperListener.destroy(); // Destroy our defined Connectors synchronized (connectorsLock) { for (Connector connector : connectors) { connector.destroy(); } } // Destroy any Executors for (Executor executor : findExecutors()) { executor.destroy(); } if (engine != null) { engine.destroy(); } super.destroyInternal(); }
/** * Invoke a pre-startup initialization. This is used to allow connectors * to bind to restricted ports under Unix operating environments. */ @Override protected void initInternal() throws LifecycleException { super.initInternal(); if (engine != null) { engine.init(); } // Initialize any Executors for (Executor executor : findExecutors()) { if (executor instanceof JmxEnabled) { ((JmxEnabled) executor).setDomain(getDomain()); } executor.init(); } // Initialize mapper listener mapperListener.init(); // Initialize our defined Connectors synchronized (connectorsLock) { for (Connector connector : connectors) { connector.init(); } } }
@Override protected void destroyInternal() throws LifecycleException { mapperListener.destroy(); // Destroy our defined Connectors synchronized (connectorsLock) { for (Connector connector : connectors) { connector.destroy(); } } // Destroy any Executors for (Executor executor : findExecutors()) { executor.destroy(); } if (engine != null) { engine.destroy(); } super.destroyInternal(); }
((LifecycleMBeanBase) executor).setDomain(getDomain()); executor.init();
/** * Retrieves executor by name, null if not found * @param executorName String * @return Executor */ @Override public Executor getExecutor(String executorName) { synchronized (executors) { for (Executor executor: executors) { if (executorName.equals(executor.getName())) return executor; } } return null; }
/** * Adds a named executor to the service * @param ex Executor */ public void addExecutor(Executor ex) { synchronized (executors) { if (!executors.contains(ex)) { executors.add(ex); if (started) try { ex.start(); } catch (LifecycleException x) { CatalinaLogger.CORE_LOGGER.errorStartingExecutor(x); } } } }
/** * Removes an executor from the service * @param ex Executor */ public void removeExecutor(Executor ex) { synchronized (executors) { if ( executors.remove(ex) && started ) { try { ex.stop(); } catch (LifecycleException e) { CatalinaLogger.CORE_LOGGER.errorStoppingExecutor(e); } } } }
@Override protected void destroyInternal() throws LifecycleException { // Destroy our defined Connectors synchronized (connectors) { for (Connector connector : connectors) { try { connector.destroy(); } catch (Exception e) { log.error(sm.getString( "standardService.connector.destroyfailed", connector), e); } } } // Destroy any Executors for (Executor executor : findExecutors()) { executor.destroy(); } if (container != null) { container.destroy(); } super.destroyInternal(); }
((LifecycleMBeanBase) executor).setDomain(getDomain()); executor.init();
/** * Retrieves executor by name, null if not found * @param executorName String * @return Executor */ @Override public Executor getExecutor(String executorName) { synchronized (executors) { for (Executor executor: executors) { if (executorName.equals(executor.getName())) return executor; } } return null; }
/** * Adds a named executor to the service * @param ex Executor */ @Override public void addExecutor(Executor ex) { synchronized (executors) { if (!executors.contains(ex)) { executors.add(ex); if (getState().isAvailable()) try { ex.start(); } catch (LifecycleException x) { log.error("Executor.start", x); } } } }
/** * Removes an executor from the service * @param ex Executor */ @Override public void removeExecutor(Executor ex) { synchronized (executors) { if ( executors.remove(ex) && getState().isAvailable() ) { try { ex.stop(); } catch (LifecycleException e) { log.error("Executor.stop", e); } } } }
@Override protected void destroyInternal() throws LifecycleException { // Destroy our defined Connectors synchronized (connectors) { for (Connector connector : connectors) { try { connector.destroy(); } catch (Exception e) { log.error(sm.getString( "standardService.connector.destroyfailed", connector), e); } } } // Destroy any Executors for (Executor executor : findExecutors()) { executor.destroy(); } if (container != null) { container.destroy(); } super.destroyInternal(); }
((LifecycleMBeanBase) executor).setDomain(getDomain()); executor.init();
/** * Retrieves executor by name, null if not found * @param executorName String * @return Executor */ @Override public Executor getExecutor(String executorName) { synchronized (executors) { for (Executor executor: executors) { if (executorName.equals(executor.getName())) return executor; } } return null; }