Java Code Examples for org.apache.catalina.LifecycleListener#lifecycleEvent()

The following examples show how to use org.apache.catalina.LifecycleListener#lifecycleEvent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StandardLifecycleSupport.java    From session-managers with Apache License 2.0 5 votes vote down vote up
private void notify(LifecycleEvent lifecycleEvent) {
    for (LifecycleListener lifecycleListener : this.lifecycleListeners) {
        try {
            lifecycleListener.lifecycleEvent(lifecycleEvent);
        } catch (RuntimeException e) {
            this.logger.warn("Exception encountered while notifying listener of lifecycle event", e);
        }
    }
}
 
Example 2
Source File: Runner.java    From myrrix-recommender with Apache License 2.0 5 votes vote down vote up
private static void configureServer(Server server) {
  //server.addLifecycleListener(new SecurityListener());
  //server.addLifecycleListener(new AprLifecycleListener());
  LifecycleListener jasperListener = new JasperListener();
  server.addLifecycleListener(jasperListener);
  jasperListener.lifecycleEvent(new LifecycleEvent(server, Lifecycle.BEFORE_INIT_EVENT, null));
  server.addLifecycleListener(new JreMemoryLeakPreventionListener());
  //server.addLifecycleListener(new GlobalResourcesLifecycleListener());
  server.addLifecycleListener(new ThreadLocalLeakPreventionListener());
}
 
Example 3
Source File: LifecycleBase.java    From Tomcat8-Source-Read with MIT License 3 votes vote down vote up
/**
 * Allow sub classes to fire {@link Lifecycle} events.
 * 允许子类去触发对应的生命周期事件。(Spring的)
 * @param type  Event type
 * @param data  Data associated 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);
    }
}