FrameworkListener (Apache Tomcat 9.0.37 API Documentation)

org.apache.catalina.core

## Class FrameworkListener

- java.lang.Object
- - org.apache.catalina.core.FrameworkListener

- All Implemented Interfaces:
    ContainerListener, LifecycleListener
  Direct Known Subclasses:
    ThreadLocalLeakPreventionListener

      public abstract class FrameworkListener
      extends Object
      implements LifecycleListener, ContainerListener

  This listener must be declared in server.xml as a Server listener, possibly optional. It will register a lifecycle listener on all contexts. This is an alternative to adding a Listener in context.xml with more flexibility.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ConcurrentHashMap<Context,LifecycleListener>` | `contextListeners`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FrameworkListener()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `containerEvent(ContainerEvent event)` Acknowledge the occurrence of the specified event.
    `protected abstract LifecycleListener` | `createLifecycleListener(Context context)` Create a lifecycle listener which will then be added to the specified context.
    `void` | `lifecycleEvent(LifecycleEvent event)` Acknowledge the occurrence of the specified event.
    `protected void` | `processContainerAddChild(Container child)`
    `protected void` | `processContainerRemoveChild(Container child)`
    `protected void` | `registerContextListener(Context context)`
    `protected void` | `registerListenersForEngine(Engine engine)`
    `protected void` | `registerListenersForHost(Host host)`
    `protected void` | `registerListenersForServer(Server server)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### contextListeners

          protected final ConcurrentHashMap<Context,LifecycleListener> contextListeners

  - ### Constructor Detail

    - #### FrameworkListener

          public FrameworkListener()

  - ### Method Detail

    - #### createLifecycleListener

          protected abstract LifecycleListener createLifecycleListener(Context context)

      Create a lifecycle listener which will then be added to the specified context.
      Parameters:
        `context` - the associated Context
      Returns:
        the lifecycle listener

    - #### lifecycleEvent

          public void lifecycleEvent(LifecycleEvent event)

      Description copied from interface: `LifecycleListener`
      Acknowledge the occurrence of the specified event.
      Specified by:
        `lifecycleEvent` in interface `LifecycleListener`
      Parameters:
        `event` - LifecycleEvent that has occurred

    - #### containerEvent

          public void containerEvent(ContainerEvent event)

      Description copied from interface: `ContainerListener`
      Acknowledge the occurrence of the specified event.
      Specified by:
        `containerEvent` in interface `ContainerListener`
      Parameters:
        `event` - ContainerEvent that has occurred

    - #### registerListenersForServer

          protected void registerListenersForServer(Server server)

    - #### registerListenersForEngine

          protected void registerListenersForEngine(Engine engine)

    - #### registerListenersForHost

          protected void registerListenersForHost(Host host)

    - #### registerContextListener

          protected void registerContextListener(Context context)

    - #### processContainerAddChild

          protected void processContainerAddChild(Container child)

    - #### processContainerRemoveChild

          protected void processContainerRemoveChild(Container child)

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.