org.apache.catalina.LifecycleEvent - java examples

Here are the examples of the java api org.apache.catalina.LifecycleEvent taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

95 Examples 7

19 View Complete Implementation : JmxRemoteLifecycleListener.java
Copyright Apache License 2.0
Author : how2j
@Override
public void lifecycleEvent(LifecycleEvent event) {
    // When the server starts, configure JMX/RMI
    if (Lifecycle.START_EVENT.equals(event.getType())) {
        // Configure using standard jmx system properties
        init();
        // Prevent an attacker guessing the RMI object ID
        System.setProperty("java.rmi.server.randomIDs", "true");
        // Create the environment
        HashMap<String, Object> env = new HashMap<String, Object>();
        RMIClientSocketFactory registryCsf = null;
        RMIServerSocketFactory registrySsf = null;
        RMIClientSocketFactory serverCsf = null;
        RMIServerSocketFactory serverSsf = null;
        // Configure registry socket factories
        if (rmiRegistrySSL) {
            registryCsf = new SslRMIClientSocketFactory();
            if (rmiBindAddress == null) {
                registrySsf = new SslRMIServerSocketFactory(ciphers, protocols, clientAuth);
            } else {
                registrySsf = new SslRmiServerBindSocketFactory(ciphers, protocols, clientAuth, rmiBindAddress);
            }
        } else {
            if (rmiBindAddress != null) {
                registrySsf = new RmiServerBindSocketFactory(rmiBindAddress);
            }
        }
        // Configure server socket factories
        if (rmiServerSSL) {
            serverCsf = new SslRMIClientSocketFactory();
            if (rmiBindAddress == null) {
                serverSsf = new SslRMIServerSocketFactory(ciphers, protocols, clientAuth);
            } else {
                serverSsf = new SslRmiServerBindSocketFactory(ciphers, protocols, clientAuth, rmiBindAddress);
            }
        } else {
            if (rmiBindAddress != null) {
                serverSsf = new RmiServerBindSocketFactory(rmiBindAddress);
            }
        }
        // By default, the registry will pick an address to listen on.
        // Setting this property overrides that and ensures it listens on
        // the configured address.
        if (rmiBindAddress != null) {
            System.setProperty("java.rmi.server.hostname", rmiBindAddress);
        }
        // Force the use of local ports if required
        if (useLocalPorts) {
            registryCsf = new RmiClientLocalhostSocketFactory(registryCsf);
            serverCsf = new RmiClientLocalhostSocketFactory(serverCsf);
        }
        env.put("jmx.remote.rmi.server.credential.types", new String[] { String[].clreplaced.getName(), String.clreplaced.getName() });
        // Populate the env properties used to create the server
        if (serverCsf != null) {
            env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, serverCsf);
            env.put("com.sun.jndi.rmi.factory.socket", registryCsf);
        }
        if (serverSsf != null) {
            env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, serverSsf);
        }
        // Configure authentication
        if (authenticate) {
            env.put("jmx.remote.x.preplacedword.file", preplacedwordFile);
            env.put("jmx.remote.x.access.file", accessFile);
            env.put("jmx.remote.x.login.config", loginModuleName);
        }
        // Create the Platform server
        csPlatform = createServer("Platform", rmiBindAddress, rmiRegistryPortPlatform, rmiServerPortPlatform, env, registryCsf, registrySsf, serverCsf, serverSsf);
    } else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
        destroyServer("Platform", csPlatform);
    }
}

19 View Complete Implementation : TomcatEventHandlerAdapter.java
Copyright GNU Lesser General Public License v3.0
Author : modcluster
protected boolean isAfterInit(LifecycleEvent event) {
    return event.getType().equals(Lifecycle.AFTER_INIT_EVENT);
}

19 View Complete Implementation : OpenEJBListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(final LifecycleEvent event) {
    // only install once
    if (listenerInstalled || !Lifecycle.AFTER_INIT_EVENT.equals(event.getType())) {
        return;
    }
    try {
        File webappDir = findOpenEjbWar();
        if (webappDir == null && event.getSource() instanceof StandardServer) {
            final StandardServer server = (StandardServer) event.getSource();
            webappDir = tryToFindAndExtractWar(server);
            if (webappDir != null) {
                // we are using webapp startup
                final File exploded = extractDirectory(webappDir);
                if (exploded != null) {
                    extract(webappDir, exploded);
                }
                webappDir = exploded;
                TomcatHelper.setServer(server);
            }
        }
        if (webappDir != null) {
            LOGGER.log(Level.INFO, "found the tomee webapp on {0}", webappDir.getPath());
            final Properties properties = new Properties();
            properties.setProperty("tomee.war", webappDir.getAbsolutePath());
            properties.setProperty("openejb.embedder.source", OpenEJBListener.clreplaced.getSimpleName());
            TomcatEmbedder.embed(properties, StandardServer.clreplaced.getClreplacedLoader());
            listenerInstalled = true;
        } else if (logWebappNotFound) {
            LOGGER.info("tomee webapp not found from the listener, will try from the webapp if exists");
            logWebappNotFound = false;
        }
    } catch (final Exception e) {
        LOGGER.log(Level.SEVERE, "TomEE Listener can't start OpenEJB", e);
    // e.printStackTrace(System.err);
    }
}

19 View Complete Implementation : ClientServerLifecycleListener.java
Copyright Apache License 2.0
Author : hazelcast
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (getConfigLocation() == null) {
        setConfigLocation("hazelcast-client-default.xml");
    }
    if ("before_start".equals(event.getType())) {
        try {
            XmlClientConfigBuilder builder = new XmlClientConfigBuilder(getConfigLocation());
            config = builder.build();
        } catch (IOException e) {
            throw new RuntimeException("failed to load Config:", e);
        }
        if (config == null) {
            throw new RuntimeException("failed to find configLocation:" + getConfigLocation());
        }
    }
}

19 View Complete Implementation : JniLifecycleListener.java
Copyright MIT License
Author : chenmudu
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) {
        if (!libraryName.isEmpty()) {
            System.loadLibrary(libraryName);
            log.info("Loaded native library " + libraryName);
        } else if (!libraryPath.isEmpty()) {
            System.load(libraryPath);
            log.info("Loaded native library from " + libraryPath);
        } else {
            throw new IllegalArgumentException("Either libraryName or libraryPath must be set");
        }
    }
}

19 View Complete Implementation : LifecycleSupport.java
Copyright Apache License 2.0
Author : apache
/**
 * Notify all lifecycle event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireLifecycleEvent(String type, Object data) {
    LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);
    for (LifecycleListener listener : listeners) {
        listener.lifecycleEvent(event);
    }
}

19 View Complete Implementation : AbstractSamlAuthenticatorValve.java
Copyright Apache License 2.0
Author : keycloak
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.START_EVENT.equals(event.getType())) {
        cache = false;
    } else if (Lifecycle.AFTER_START_EVENT.equals(event.getType())) {
        keycloakInit();
    } else if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType())) {
        beforeStop();
    }
}

19 View Complete Implementation : UserConfig.java
Copyright Apache License 2.0
Author : apache
// --------------------------------------------------------- Public Methods
/**
 * Process the START event for an replacedociated Host.
 *
 * @param event The lifecycle event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    // Identify the host we are replacedociated with
    try {
        host = (Host) event.getLifecycle();
    } catch (ClreplacedCastException e) {
        log.error(sm.getString("hostConfig.cce", event.getLifecycle()), e);
        return;
    }
    // Process the event that has occurred
    if (event.getType().equals(Lifecycle.START_EVENT))
        start();
    else if (event.getType().equals(Lifecycle.STOP_EVENT))
        stop();
}

19 View Complete Implementation : ContainerEventHandlerAdapterTestCase.java
Copyright GNU Lesser General Public License v3.0
Author : modcluster
@Test
public void periodicEvent() throws Exception {
    TomcatEventHandler handler = this.createEventHandler(this.eventHandler, this.provider, this.factory);
    LifecycleEngine engine = mock(LifecycleEngine.clreplaced);
    LifecycleEvent event = new LifecycleEvent(engine, Lifecycle.PERIODIC_EVENT, null);
    handler.lifecycleEvent(event);
    verifyNoInteractions(this.eventHandler);
    LifecycleServer server = mock(LifecycleServer.clreplaced);
    this.initServer(handler, server);
    handler.lifecycleEvent(event);
    verifyNoInteractions(this.eventHandler);
    this.startServer(handler, server);
    Service service = mock(Service.clreplaced);
    Engine catalinaEngine = mock(Engine.clreplaced);
    when(engine.getService()).thenReturn(service);
    when(service.getServer()).thenReturn(server);
    when(this.factory.createEngine(same(engine))).thenReturn(catalinaEngine);
    handler.lifecycleEvent(event);
    verify(this.eventHandler).status(same(catalinaEngine));
}

19 View Complete Implementation : StoreConfigLifecycleListener.java
Copyright Apache License 2.0
Author : apache
/**
 * Register StoreRegistry after Start the complete Server.
 *
 * @see org.apache.catalina.LifecycleListener#lifecycleEvent(org.apache.catalina.LifecycleEvent)
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.AFTER_START_EVENT.equals(event.getType())) {
        if (event.getSource() instanceof Server) {
            createMBean((Server) event.getSource());
        } else {
            log.warn(sm.getString("storeConfigListener.notServer"));
        }
    } else if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType())) {
        if (oname != null) {
            registry.unregisterComponent(oname);
            oname = null;
        }
    }
}

19 View Complete Implementation : LifecycleSupport.java
Copyright Apache License 2.0
Author : codefollower
/**
 * Notify all lifecycle event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireLifecycleEvent(String type, Object data) {
    LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);
    LifecycleListener[] interested = listeners;
    for (int i = 0; i < interested.length; i++) interested[i].lifecycleEvent(event);
}

19 View Complete Implementation : UaaStartupFailureListenerTest.java
Copyright Apache License 2.0
Author : cloudfoundry
private LifecycleEvent mockLifecycleEvent(Server server, String type) {
    LifecycleEvent mockEvent = mock(LifecycleEvent.clreplaced);
    when(mockEvent.getType()).thenReturn(type);
    when(mockEvent.getLifecycle()).thenReturn(server);
    return mockEvent;
}

19 View Complete Implementation : JmxRemoteLifecycleListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(LifecycleEvent event) {
    // When the server starts, configure JMX/RMI
    if (Lifecycle.START_EVENT.equals(event.getType())) {
        // Configure using standard jmx system properties
        init();
        // Prevent an attacker guessing the RMI object ID
        System.setProperty("java.rmi.server.randomIDs", "true");
        // Create the environment
        HashMap<String, Object> env = new HashMap<>();
        RMIClientSocketFactory registryCsf = null;
        RMIServerSocketFactory registrySsf = null;
        RMIClientSocketFactory serverCsf = null;
        RMIServerSocketFactory serverSsf = null;
        // Configure registry socket factories
        if (rmiRegistrySSL) {
            registryCsf = new SslRMIClientSocketFactory();
            if (rmiBindAddress == null) {
                registrySsf = new SslRMIServerSocketFactory(ciphers, protocols, clientAuth);
            } else {
                registrySsf = new SslRmiServerBindSocketFactory(ciphers, protocols, clientAuth, rmiBindAddress);
            }
        } else {
            if (rmiBindAddress != null) {
                registrySsf = new RmiServerBindSocketFactory(rmiBindAddress);
            }
        }
        // Configure server socket factories
        if (rmiServerSSL) {
            serverCsf = new SslRMIClientSocketFactory();
            if (rmiBindAddress == null) {
                serverSsf = new SslRMIServerSocketFactory(ciphers, protocols, clientAuth);
            } else {
                serverSsf = new SslRmiServerBindSocketFactory(ciphers, protocols, clientAuth, rmiBindAddress);
            }
        } else {
            if (rmiBindAddress != null) {
                serverSsf = new RmiServerBindSocketFactory(rmiBindAddress);
            }
        }
        // By default, the registry will pick an address to listen on.
        // Setting this property overrides that and ensures it listens on
        // the configured address.
        if (rmiBindAddress != null) {
            System.setProperty("java.rmi.server.hostname", rmiBindAddress);
        }
        // Force the use of local ports if required
        if (useLocalPorts) {
            registryCsf = new RmiClientLocalhostSocketFactory(registryCsf);
            serverCsf = new RmiClientLocalhostSocketFactory(serverCsf);
        }
        env.put("jmx.remote.rmi.server.credential.types", new String[] { String[].clreplaced.getName(), String.clreplaced.getName() });
        // Populate the env properties used to create the server
        if (serverCsf != null) {
            env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, serverCsf);
            env.put("com.sun.jndi.rmi.factory.socket", registryCsf);
        }
        if (serverSsf != null) {
            env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, serverSsf);
        }
        // Configure authentication
        if (authenticate) {
            env.put("jmx.remote.x.preplacedword.file", preplacedwordFile);
            env.put("jmx.remote.x.access.file", accessFile);
            env.put("jmx.remote.x.login.config", loginModuleName);
        }
        // Create the Platform server
        csPlatform = createServer("Platform", rmiBindAddress, rmiRegistryPortPlatform, rmiServerPortPlatform, env, registryCsf, registrySsf, serverCsf, serverSsf);
    } else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
        destroyServer("Platform", csPlatform);
    }
}

19 View Complete Implementation : AprLifecycleListener.java
Copyright Apache License 2.0
Author : how2j
// ---------------------------------------------- LifecycleListener Methods
/**
 * Primary entry point for startup and shutdown events.
 *
 * @param event
 *            The event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) {
        synchronized (lock) {
            init();
            for (String msg : initInfoLogMessages) {
                log.info(msg);
            }
            initInfoLogMessages.clear();
            if (aprAvailable) {
                try {
                    initializeSSL();
                } catch (Throwable t) {
                    t = ExceptionUtils.unwrapInvocationTargetException(t);
                    ExceptionUtils.handleThrowable(t);
                    log.error(sm.getString("aprListener.sslInit"), t);
                }
            }
            // Failure to initialize FIPS mode is fatal
            if (!(null == FIPSMode || "off".equalsIgnoreCase(FIPSMode)) && !isFIPSModeActive()) {
                Error e = new Error(sm.getString("aprListener.initializeFIPSFailed"));
                // Log here, because thrown error might be not logged
                log.fatal(e.getMessage(), e);
                throw e;
            }
        }
    } else if (Lifecycle.AFTER_DESTROY_EVENT.equals(event.getType())) {
        synchronized (lock) {
            if (!aprAvailable) {
                return;
            }
            try {
                terminateAPR();
            } catch (Throwable t) {
                t = ExceptionUtils.unwrapInvocationTargetException(t);
                ExceptionUtils.handleThrowable(t);
                log.info(sm.getString("aprListener.aprDestroy"));
            }
        }
    }
}

19 View Complete Implementation : SecurityListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(LifecycleEvent event) {
    // This is the earliest event in Lifecycle
    if (event.getType().equals(Lifecycle.BEFORE_INIT_EVENT)) {
        doChecks();
    }
}

19 View Complete Implementation : UserConfig.java
Copyright Apache License 2.0
Author : how2j
// --------------------------------------------------------- Public Methods
/**
 * Process the START event for an replacedociated Host.
 *
 * @param event
 *            The lifecycle event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    // Identify the host we are replacedociated with
    try {
        host = (Host) event.getLifecycle();
    } catch (ClreplacedCastException e) {
        log.error(sm.getString("hostConfig.cce", event.getLifecycle()), e);
        return;
    }
    // Process the event that has occurred
    if (event.getType().equals(Lifecycle.START_EVENT))
        start();
    else if (event.getType().equals(Lifecycle.STOP_EVENT))
        stop();
}

19 View Complete Implementation : StandardContextCustomizer.java
Copyright Apache License 2.0
Author : apache
public void customize(@Observes final LifecycleEvent event) {
    final Object data = event.getSource();
    if (!StandardContext.clreplaced.isInstance(data)) {
        return;
    }
    final StandardContext context = StandardContext.clreplaced.cast(data);
    final String contextRoot = module.getContextRoot();
    final String path = context.getPath();
    final boolean rightPath = (path.isEmpty() && contextRoot.equals(path)) || (contextRoot.startsWith("/") ? contextRoot : '/' + contextRoot).equals(path);
    if (!rightPath) {
        return;
    }
    switch(event.getType()) {
        case Lifecycle.BEFORE_START_EVENT:
            final StandardRoot resources = new StandardRoot(context);
            resources.setCachingAllowed(config.areWebResourcesCached());
            context.setResources(resources);
            if (!module.getProperties().containsKey("fakeJarLocation")) {
                context.setDocBase(module.getJarLocation());
            }
            // move last fake folder, tomcat is broken without it so we can't remove it
            final List allResources = List.clreplaced.cast(Reflections.get(resources, "allResources"));
            final Object mainResources = allResources.remove(1);
            allResources.add(mainResources);
            for (final URL url : module.getScannableUrls()) {
                final File file = URLs.toFile(url);
                final String absolutePath = file.getAbsolutePath();
                if (file.isDirectory()) {
                    resources.createWebResourceSet(WebResourceRoot.ResourceSetType.CLreplacedES_JAR, "/WEB-INF/clreplacedes", absolutePath, "", "/");
                    if (new File(file, "META-INF/resources").exists()) {
                        resources.createWebResourceSet(WebResourceRoot.ResourceSetType.RESOURCE_JAR, "/", absolutePath, "", "/META-INF/resources");
                    }
                } else {
                    if (absolutePath.endsWith(".jar") || Boolean.getBoolean("tomee.embedded.resources.add-war-as-jar")) {
                        resources.createWebResourceSet(WebResourceRoot.ResourceSetType.CLreplacedES_JAR, "/WEB-INF/lib", absolutePath, null, "/");
                        resources.createWebResourceSet(WebResourceRoot.ResourceSetType.RESOURCE_JAR, "/", url, "/META-INF/resources");
                    }
                // else endsWith .war => ignore
                }
            }
            if (config.getCustomWebResources() != null) {
                for (final String web : config.getCustomWebResources()) {
                    final File file = new File(web);
                    if (file.isDirectory()) {
                        try {
                            resources.createWebResourceSet(WebResourceRoot.ResourceSetType.RESOURCE_JAR, "/", file.toURI().toURL(), "/");
                        } catch (final MalformedURLException e) {
                            throw new IllegalArgumentException(e);
                        }
                    } else {
                        Logger.getLogger(StandardContextCustomizer.clreplaced.getName()).log(Level.WARNING, "''{0}'' is not a directory, ignoring", web);
                    }
                }
            }
            if (config.getLoginConfig() != null) {
                context.setLoginConfig(config.getLoginConfig().build());
            }
            for (final SecurityConstaintBuilder sc : config.getSecurityConstraints()) {
                context.addConstraint(sc.build());
            }
            if (config.getWebXml() != null) {
                context.getServletContext().setAttribute(Globals.ALT_DD_ATTR, config.getWebXml());
            }
            if (loader != null) {
                context.setLoader(new ProvidedLoader(loader));
            }
            break;
        case Lifecycle.CONFIGURE_START_EVENT:
            SystemInstance.get().getComponent(TomcatWebAppBuilder.clreplaced).setFinderOnContextConfig(context, module.appModule());
            break;
        default:
    }
}

19 View Complete Implementation : ModClusterListener.java
Copyright GNU Lesser General Public License v3.0
Author : modcluster
@Override
public void lifecycleEvent(LifecycleEvent event) {
    this.listener.lifecycleEvent(event);
    Lifecycle source = event.getLifecycle();
    if (source instanceof Server) {
        Server server = (Server) source;
        String type = event.getType();
        // Register/unregister ModClusterListener mbean on server start/stop
        if (Lifecycle.AFTER_START_EVENT.equals(type)) {
            try {
                ObjectName name = this.getObjectName(server);
                Registry.getRegistry(null, null).registerComponent(this, name, ModClusterListener.clreplaced.getName());
            } catch (Exception e) {
                log.error(e.getLocalizedMessage(), e);
            }
        } else if (Lifecycle.STOP_EVENT.equals(type)) {
            try {
                ObjectName name = this.getObjectName(server);
                Registry.getRegistry(null, null).unregisterComponent(name);
            } catch (Exception e) {
                log.error(e.getLocalizedMessage(), e);
            }
        }
    }
}

19 View Complete Implementation : FrameworkListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(LifecycleEvent event) {
    Lifecycle lifecycle = event.getLifecycle();
    if (Lifecycle.BEFORE_START_EVENT.equals(event.getType()) && lifecycle instanceof Server) {
        Server server = (Server) lifecycle;
        registerListenersForServer(server);
    }
}

19 View Complete Implementation : ContainerEventHandlerAdapterTestCase.java
Copyright GNU Lesser General Public License v3.0
Author : modcluster
@Test
public void destroyServer() throws Exception {
    TomcatEventHandler handler = this.createEventHandler(this.eventHandler, this.provider, this.factory);
    LifecycleServer server = mock(LifecycleServer.clreplaced);
    LifecycleEvent event = createBeforeDestroyInitEvent(server);
    handler.lifecycleEvent(event);
    verifyNoInteractions(this.eventHandler);
    this.initServer(handler, server);
    Service service = mock(Service.clreplaced);
    LifecycleEngine engine = mock(LifecycleEngine.clreplaced);
    Container container = mock(Container.clreplaced);
    LifecycleContainer childContainer = mock(LifecycleContainer.clreplaced);
    when(server.findServices()).thenReturn(new Service[] { service });
    when(service.getContainer()).thenReturn(engine);
    when(engine.findChildren()).thenReturn(new Container[] { container });
    when(container.findChildren()).thenReturn(new Container[] { childContainer });
    handler.lifecycleEvent(event);
    verify(engine).removeContainerListener(handler);
    verify(engine).removeLifecycleListener(handler);
    verify(container).removeContainerListener(handler);
    verify(childContainer).removeLifecycleListener(handler);
    verify(this.eventHandler).shutdown();
    reset(this.eventHandler);
    handler.lifecycleEvent(event);
    verifyNoInteractions(this.eventHandler);
}

19 View Complete Implementation : Log4j2ShutdownHooksExecutor.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(final LifecycleEvent event) {
    if (Server.clreplaced.isInstance(event.getSource()) && Lifecycle.AFTER_DESTROY_EVENT.equals(event.getType())) {
        final Collection<Runnable> copy = new ArrayList<>(CaptureLog4j2ShutdownHooks.HOOKS);
        CaptureLog4j2ShutdownHooks.HOOKS.removeAll(copy);
        for (final Runnable runnable : copy) {
            runnable.run();
        }
    }
}

19 View Complete Implementation : TomcatBpmPlatformBootstrap.java
Copyright Apache License 2.0
Author : camunda
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.START_EVENT.equals(event.getType())) {
        // the Apache Tomcat integration uses the Jmx Container for managing process engines and applications.
        containerDelegate = (RuntimeContainerDelegateImpl) RuntimeContainerDelegate.INSTANCE.get();
        deployBpmPlatform(event);
    } else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
        undeployBpmPlatform(event);
    }
}

19 View Complete Implementation : JniLifecycleListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) {
        if (!libraryName.isEmpty()) {
            System.loadLibrary(libraryName);
            log.info(sm.getString("jniLifecycleListener.load.name", libraryName));
        } else if (!libraryPath.isEmpty()) {
            System.load(libraryPath);
            log.info(sm.getString("jniLifecycleListener.load.path", libraryPath));
        } else {
            throw new IllegalArgumentException(sm.getString("jniLifecycleListener.missingPathOrName"));
        }
    }
}

19 View Complete Implementation : LifecycleBase.java
Copyright MIT License
Author : chenmudu
/**
 * Allow sub clreplacedes to fire {@link Lifecycle} events.
 * 允许子类去触发对应的生命周期事件。(Spring的)
 * @param type  Event type
 * @param data  Data replacedociated with event.
 *
 *  相应所有的config_start事件。包括最重要的ContextConfig 类。
 */
protected void fireLifecycleEvent(String type, Object data) {
    LifecycleEvent event = new LifecycleEvent(this, type, data);
    for (LifecycleListener listener : lifecycleListeners) {
        listener.lifecycleEvent(event);
    }
}

19 View Complete Implementation : LifecycleBase.java
Copyright Apache License 2.0
Author : apache
/**
 * Allow sub clreplacedes to fire {@link Lifecycle} events.
 *
 * @param type  Event type
 * @param data  Data replacedociated with event.
 */
protected void fireLifecycleEvent(String type, Object data) {
    LifecycleEvent event = new LifecycleEvent(this, type, data);
    for (LifecycleListener listener : lifecycleListeners) {
        listener.lifecycleEvent(event);
    }
}

19 View Complete Implementation : StoreConfigLifecycleListener.java
Copyright Apache License 2.0
Author : codefollower
/*
     * register StoreRegistry after Start the complete Server
     *
     * @see org.apache.catalina.LifecycleListener#lifecycleEvent(org.apache.catalina.LifecycleEvent)
     */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.AFTER_START_EVENT.equals(event.getType())) {
        if (event.getSource() instanceof StandardServer) {
            createMBean((StandardServer) event.getSource());
        }
    }
}

19 View Complete Implementation : AprLifecycleListener.java
Copyright Apache License 2.0
Author : codefollower
// ---------------------------------------------- LifecycleListener Methods
/**
 * Primary entry point for startup and shutdown events.
 *
 * @param event The event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) {
        synchronized (lock) {
            init();
            if (aprAvailable) {
                try {
                    initializeSSL();
                } catch (Throwable t) {
                    t = ExceptionUtils.unwrapInvocationTargetException(t);
                    ExceptionUtils.handleThrowable(t);
                    log.error(sm.getString("aprListener.sslInit"), t);
                }
            }
            // Failure to initialize FIPS mode is fatal
            if ("on".equalsIgnoreCase(FIPSMode) && !isFIPSModeActive()) {
                Error e = new Error(sm.getString("aprListener.initializeFIPSFailed"));
                // Log here, because thrown error might be not logged
                log.fatal(e.getMessage(), e);
                throw e;
            }
        }
    } else if (Lifecycle.AFTER_DESTROY_EVENT.equals(event.getType())) {
        synchronized (lock) {
            if (!aprAvailable) {
                return;
            }
            try {
                terminateAPR();
            } catch (Throwable t) {
                t = ExceptionUtils.unwrapInvocationTargetException(t);
                ExceptionUtils.handleThrowable(t);
                log.info(sm.getString("aprListener.aprDestroy"));
            }
        }
    }
}

19 View Complete Implementation : ThreadLocalLeakPreventionListener.java
Copyright Apache License 2.0
Author : apache
/**
 * Listens for {@link LifecycleEvent} for the start of the {@link Server} to
 * initialize itself and then for after_stop events of each {@link Context}.
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    try {
        Lifecycle lifecycle = event.getLifecycle();
        if (Lifecycle.AFTER_START_EVENT.equals(event.getType()) && lifecycle instanceof Server) {
            // when the server starts, we register ourself as listener for
            // all context
            // as well as container event listener so that we know when new
            // Context are deployed
            Server server = (Server) lifecycle;
            registerListenersForServer(server);
        }
        if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType()) && lifecycle instanceof Server) {
            // Server is shutting down, so thread pools will be shut down so
            // there is no need to clean the threads
            serverStopping = true;
        }
        if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType()) && lifecycle instanceof Context) {
            stopIdleThreads((Context) lifecycle);
        }
    } catch (Exception e) {
        String msg = sm.getString("threadLocalLeakPreventionListener.lifecycleEvent.error", event);
        log.error(msg, e);
    }
}

19 View Complete Implementation : TomcatConfigurator.java
Copyright Apache License 2.0
Author : gammaliu
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.START_EVENT.equals(event.getType())) {
        TagmeConfig.init(configFilePath, initialize);
    }
}

19 View Complete Implementation : GlobalResourcesLifecycleListener.java
Copyright Apache License 2.0
Author : apache
// ---------------------------------------------- LifecycleListener Methods
/**
 * Primary entry point for startup and shutdown events.
 *
 * @param event The event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.START_EVENT.equals(event.getType())) {
        component = event.getLifecycle();
        createMBeans();
    } else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
        destroyMBeans();
        component = null;
    }
}

19 View Complete Implementation : StaticResourceConfigurer.java
Copyright MIT License
Author : hengyunabc
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) {
        URL location = this.getClreplaced().getProtectionDomain().getCodeSource().getLocation();
        if (ResourceUtils.isFileURL(location)) {
            // when run as exploded directory
            String rootFile = location.getFile();
            if (rootFile.endsWith("/BOOT-INF/clreplacedes/")) {
                rootFile = rootFile.substring(0, rootFile.length() - "/BOOT-INF/clreplacedes/".length() + 1);
            }
            if (!new File(rootFile, "META-INF" + File.separator + "resources").isDirectory()) {
                return;
            }
            try {
                location = new File(rootFile).toURI().toURL();
            } catch (MalformedURLException e) {
                throw new IllegalStateException("Can not add tomcat resources", e);
            }
        }
        String locationStr = location.toString();
        if (locationStr.endsWith("/BOOT-INF/clreplacedes!/")) {
            // when run as fat jar
            locationStr = locationStr.substring(0, locationStr.length() - "/BOOT-INF/clreplacedes!/".length() + 1);
            try {
                location = new URL(locationStr);
            } catch (MalformedURLException e) {
                throw new IllegalStateException("Can not add tomcat resources", e);
            }
        }
        this.context.getResources().createWebResourceSet(ResourceSetType.RESOURCE_JAR, "/", location, "/META-INF/resources");
    }
}

19 View Complete Implementation : StoreConfigLifecycleListener.java
Copyright Apache License 2.0
Author : apache
/*
     * register StoreRegistry after Start the complete Server
     *
     * @see org.apache.catalina.LifecycleListener#lifecycleEvent(org.apache.catalina.LifecycleEvent)
     */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.AFTER_START_EVENT.equals(event.getType())) {
        if (event.getSource() instanceof Server) {
            createMBean((Server) event.getSource());
        } else {
            log.warn(sm.getString("storeConfigListener.notServer"));
        }
    } else if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType())) {
        if (oname != null) {
            registry.unregisterComponent(oname);
            oname = null;
        }
    }
}

19 View Complete Implementation : GlobalResourcesLifecycleListener.java
Copyright Apache License 2.0
Author : how2j
// ---------------------------------------------- LifecycleListener Methods
/**
 * Primary entry point for startup and shutdown events.
 *
 * @param event
 *            The event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.START_EVENT.equals(event.getType())) {
        component = event.getLifecycle();
        createMBeans();
    } else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
        destroyMBeans();
        component = null;
    }
}

19 View Complete Implementation : AprLifecycleListener.java
Copyright Apache License 2.0
Author : apache
// ---------------------------------------------- LifecycleListener Methods
/**
 * Primary entry point for startup and shutdown events.
 *
 * @param event The event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) {
        synchronized (lock) {
            init();
            for (String msg : initInfoLogMessages) {
                log.info(msg);
            }
            initInfoLogMessages.clear();
            if (aprAvailable) {
                try {
                    initializeSSL();
                } catch (Throwable t) {
                    t = ExceptionUtils.unwrapInvocationTargetException(t);
                    ExceptionUtils.handleThrowable(t);
                    log.error(sm.getString("aprListener.sslInit"), t);
                }
            }
            // Failure to initialize FIPS mode is fatal
            if (!(null == FIPSMode || "off".equalsIgnoreCase(FIPSMode)) && !isFIPSModeActive()) {
                String errorMessage = sm.getString("aprListener.initializeFIPSFailed");
                Error e = new Error(errorMessage);
                // Log here, because thrown error might be not logged
                log.fatal(errorMessage, e);
                throw e;
            }
        }
    } else if (Lifecycle.AFTER_DESTROY_EVENT.equals(event.getType())) {
        synchronized (lock) {
            if (!aprAvailable) {
                return;
            }
            try {
                terminateAPR();
            } catch (Throwable t) {
                t = ExceptionUtils.unwrapInvocationTargetException(t);
                ExceptionUtils.handleThrowable(t);
                log.info(sm.getString("aprListener.aprDestroy"));
            }
        }
    }
}

19 View Complete Implementation : EngineConfig.java
Copyright Apache License 2.0
Author : how2j
// --------------------------------------------------------- Public Methods
/**
 * Process the START event for an replacedociated Engine.
 *
 * @param event
 *            The lifecycle event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    // Identify the engine we are replacedociated with
    try {
        engine = (Engine) event.getLifecycle();
    } catch (ClreplacedCastException e) {
        log.error(sm.getString("engineConfig.cce", event.getLifecycle()), e);
        return;
    }
    // Process the event that has occurred
    if (event.getType().equals(Lifecycle.START_EVENT))
        start();
    else if (event.getType().equals(Lifecycle.STOP_EVENT))
        stop();
}

19 View Complete Implementation : OpenEJBNamingContextListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(final LifecycleEvent event) {
    if (event.getLifecycle() != standardServer) {
        return;
    }
    if (Lifecycle.START_EVENT.equals(event.getType())) {
        start();
    } else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
        stop();
    }
}

19 View Complete Implementation : LifecycleSupport.java
Copyright Apache License 2.0
Author : how2j
/**
 * Notify all lifecycle event listeners that a particular event has occurred
 * for this Container. The default implementation performs this notification
 * synchronously using the calling thread.
 *
 * @param type
 *            Event type
 * @param data
 *            Event data
 */
public void fireLifecycleEvent(String type, Object data) {
    LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);
    LifecycleListener[] interested = listeners;
    for (int i = 0; i < interested.length; i++) interested[i].lifecycleEvent(event);
}

19 View Complete Implementation : EngineConfig.java
Copyright Apache License 2.0
Author : apache
// --------------------------------------------------------- Public Methods
/**
 * Process the START event for an replacedociated Engine.
 *
 * @param event The lifecycle event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    // Identify the engine we are replacedociated with
    try {
        engine = (Engine) event.getLifecycle();
    } catch (ClreplacedCastException e) {
        log.error(sm.getString("engineConfig.cce", event.getLifecycle()), e);
        return;
    }
    // Process the event that has occurred
    if (event.getType().equals(Lifecycle.START_EVENT))
        start();
    else if (event.getType().equals(Lifecycle.STOP_EVENT))
        stop();
}

19 View Complete Implementation : RealmProviderLifeCycleListener.java
Copyright Apache License 2.0
Author : kiegroup
@Override
public void lifecycleEvent(LifecycleEvent lifecycleEvent) {
    Lifecycle lifecycle = lifecycleEvent.getLifecycle();
    if (Lifecycle.AFTER_START_EVENT.equals(lifecycleEvent.getType())) {
        if (lifecycle instanceof Container) {
            TomcatRealmLoginModule.setRealm(((Container) lifecycle).getRealm());
        }
    }
}

19 View Complete Implementation : JMXServerListener.java
Copyright Apache License 2.0
Author : apache
@Override
public synchronized void lifecycleEvent(final LifecycleEvent event) {
    try {
        if (server == null && Lifecycle.START_EVENT.equals(event.getType())) {
            serviceURL = new JMXServiceURL(protocol, host, port, urlPath);
            server = JMXConnectorServerFactory.newJMXConnectorServer(serviceURL, null, ManagementFactory.getPlatformMBeanServer());
            server.start();
            LOGGER.info("Started JMX server: " + serviceURL.toString());
        } else if (server != null && Lifecycle.STOP_EVENT.equals(event.getType())) {
            server.stop();
            server = null;
            LOGGER.info("Stopped JMX server: " + serviceURL.toString());
        }
    } catch (final Exception e) {
        throw new JMXException(e);
    }
}

19 View Complete Implementation : TomcatEventHandlerAdapter.java
Copyright GNU Lesser General Public License v3.0
Author : modcluster
/**
 * Primary entry point for startup and shutdown events.
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    Lifecycle source = event.getLifecycle();
    String type = event.getType();
    if (isAfterInit(event)) {
        if (source instanceof Server) {
            if (this.init.compareAndSet(false, true)) {
                Server server = (Server) source;
                init(server);
            }
        }
    } else if (type.equals(Lifecycle.START_EVENT)) {
        if (source instanceof Server) {
            if (this.init.compareAndSet(false, true)) {
                Server server = (Server) source;
                init(server);
            }
        }
    } else if (type.equals(Lifecycle.AFTER_START_EVENT)) {
        if (source instanceof Server) {
            if (this.init.get() && this.start.compareAndSet(false, true)) {
                this.eventHandler.start(this.factory.createServer((Server) source));
            }
        } else if (source instanceof Context) {
            // Start a webapp
            this.eventHandler.start(this.factory.createContext((Context) source));
        }
    } else if (type.equals(Lifecycle.BEFORE_STOP_EVENT)) {
        if (source instanceof Context) {
            if (this.start.get()) {
                // Stop a webapp
                this.eventHandler.stop(this.factory.createContext((Context) source));
            }
        } else if (source instanceof Server) {
            if (this.init.get() && this.start.compareAndSet(true, false)) {
                this.eventHandler.stop(this.factory.createServer((Server) source));
            }
        }
    } else if (isBeforeDestroy(event)) {
        if (source instanceof Server) {
            if (this.init.compareAndSet(true, false)) {
                this.destroy((Server) source);
            }
        }
    } else if (type.equals(Lifecycle.PERIODIC_EVENT)) {
        if (source instanceof Engine) {
            Engine engine = (Engine) source;
            this.statusCount = (this.statusCount + 1) % STATUS_FREQUENCY;
            if (this.statusCount == 0) {
                if (this.start.get()) {
                    this.eventHandler.status(this.factory.createEngine(engine));
                }
            }
        }
    }
}

19 View Complete Implementation : ContextLifecycleListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(LifecycleEvent event) {
    try {
        if (event.getSource() instanceof StandardContext) {
            StandardContext context = (StandardContext) event.getSource();
            if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) {
                ServletContext scontext = context.getServletContext();
                URL url = getBeansXml(scontext);
                if (url != null) {
                    // Registering ELResolver with JSP container
                    System.setProperty("org.apache.webbeans.application.jsp", "true");
                    addOwbListeners(context);
                    addOwbFilters(context);
                    context.addApplicationListener(TomcatSecurityFilter.clreplaced.getName());
                    context.addApplicationEventListener(this);
                }
            }
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}

19 View Complete Implementation : TomcatEventHandlerAdapter.java
Copyright GNU Lesser General Public License v3.0
Author : modcluster
protected boolean isBeforeDestroy(LifecycleEvent event) {
    return event.getType().equals(Lifecycle.BEFORE_DESTROY_EVENT);
}

19 View Complete Implementation : TomEEListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(final LifecycleEvent lifecycleEvent) {
    try {
        delegateMethod.invoke(delegate, lifecycleEvent);
    } catch (final Exception e) {
        LOGGER.log(Level.SEVERE, "error invoking {0} for {1}", new Object[] { delegateMethod.getName(), lifecycleEvent });
    }
}

19 View Complete Implementation : VersionLoggerListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) {
        log();
    }
}

19 View Complete Implementation : AbstractCacheLifecycleListener.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(LifecycleEvent le) {
    cache.lifecycleEvent(LifecycleTypeAdapter.valueOf(le.getType().toUpperCase()));
}

19 View Complete Implementation : MeecrowaveContextConfig.java
Copyright Apache License 2.0
Author : apache
@Override
public void lifecycleEvent(final LifecycleEvent event) {
    super.lifecycleEvent(event);
    if (watcher != null && watcher.shouldRun() && Context.clreplaced.cast(event.getLifecycle()) == context) {
        if (Lifecycle.AFTER_START_EVENT.equals(event.getType())) {
            watcher.start();
        } else if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType())) {
            watcher.close();
        }
    }
}

19 View Complete Implementation : ThreadLocalLeakPreventionListener.java
Copyright Apache License 2.0
Author : apache
/**
 * Listens for {@link LifecycleEvent} for the start of the {@link Server} to
 * initialize itself and then for after_stop events of each {@link Context}.
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    try {
        super.lifecycleEvent(event);
        Lifecycle lifecycle = event.getLifecycle();
        if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType()) && lifecycle instanceof Server) {
            // Server is shutting down, so thread pools will be shut down so
            // there is no need to clean the threads
            serverStopping = true;
        }
        if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType()) && lifecycle instanceof Context) {
            stopIdleThreads((Context) lifecycle);
        }
    } catch (Exception e) {
        String msg = sm.getString("threadLocalLeakPreventionListener.lifecycleEvent.error", event);
        log.error(msg, e);
    }
}

19 View Complete Implementation : AprLifecycleListener.java
Copyright Apache License 2.0
Author : apache
// ---------------------------------------------- LifecycleListener Methods
/**
 * Primary entry point for startup and shutdown events.
 *
 * @param event The event that has occurred
 */
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) {
        synchronized (lock) {
            init();
            for (String msg : initInfoLogMessages) {
                log.info(msg);
            }
            initInfoLogMessages.clear();
            if (aprAvailable) {
                try {
                    initializeSSL();
                } catch (Throwable t) {
                    t = ExceptionUtils.unwrapInvocationTargetException(t);
                    ExceptionUtils.handleThrowable(t);
                    log.error(sm.getString("aprListener.sslInit"), t);
                }
            }
            // Failure to initialize FIPS mode is fatal
            if (!(null == FIPSMode || "off".equalsIgnoreCase(FIPSMode)) && !isFIPSModeActive()) {
                Error e = new Error(sm.getString("aprListener.initializeFIPSFailed"));
                // Log here, because thrown error might be not logged
                log.fatal(e.getMessage(), e);
                throw e;
            }
        }
    } else if (Lifecycle.AFTER_DESTROY_EVENT.equals(event.getType())) {
        synchronized (lock) {
            if (!aprAvailable) {
                return;
            }
            try {
                terminateAPR();
            } catch (Throwable t) {
                t = ExceptionUtils.unwrapInvocationTargetException(t);
                ExceptionUtils.handleThrowable(t);
                log.info(sm.getString("aprListener.aprDestroy"));
            }
        }
    }
}

19 View Complete Implementation : JmxRemoteLifecycleListener.java
Copyright Apache License 2.0
Author : codefollower
@Override
public void lifecycleEvent(LifecycleEvent event) {
    // When the server starts, configure JMX/RMI
    if (Lifecycle.START_EVENT == event.getType()) {
        // Configure using standard jmx system properties
        init();
        // Prevent an attacker guessing the RMI object ID
        System.setProperty("java.rmi.server.randomIDs", "true");
        // Create the environment
        HashMap<String, Object> env = new HashMap<>();
        RMIClientSocketFactory csf = null;
        RMIServerSocketFactory ssf = null;
        // Configure SSL for RMI connection if required
        if (rmiSSL) {
            if (rmiBindAddress != null) {
                throw new IllegalStateException(sm.getString("jmxRemoteLifecycleListener.sslRmiBindAddress"));
            }
            csf = new SslRMIClientSocketFactory();
            ssf = new SslRMIServerSocketFactory(ciphers, protocols, clientAuth);
        }
        // Force server bind address if required
        if (rmiBindAddress != null) {
            try {
                ssf = new RmiServerBindSocketFactory(InetAddress.getByName(rmiBindAddress));
            } catch (UnknownHostException e) {
                log.error(sm.getString("jmxRemoteLifecycleListener.invalidRmiBindAddress", rmiBindAddress), e);
            }
        }
        // Force the use of local ports if required
        if (useLocalPorts) {
            csf = new RmiClientLocalhostSocketFactory(csf);
        }
        // Populate the env properties used to create the server
        if (csf != null) {
            env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
        }
        if (ssf != null) {
            env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, ssf);
        }
        // Configure authentication
        if (authenticate) {
            env.put("jmx.remote.x.preplacedword.file", preplacedwordFile);
            env.put("jmx.remote.x.access.file", accessFile);
            env.put("jmx.remote.x.login.config", loginModuleName);
        }
        // Create the Platform server
        csPlatform = createServer("Platform", rmiRegistryPortPlatform, rmiServerPortPlatform, env, csf, ssf, ManagementFactory.getPlatformMBeanServer());
    } else if (Lifecycle.STOP_EVENT == event.getType()) {
        destroyServer("Platform", csPlatform);
    }
}