ListenerCreateRule.OptionalListener (Apache Tomcat 9.0.37 API Documentation)

org.apache.catalina.startup

## Class ListenerCreateRule.OptionalListener

- java.lang.Object
- - org.apache.catalina.startup.ListenerCreateRule.OptionalListener

- All Implemented Interfaces:
    LifecycleListener
  Enclosing class:
    ListenerCreateRule

      public static class ListenerCreateRule.OptionalListener
      extends Object
      implements LifecycleListener

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `className`
    `protected HashMap<String,String>` | `properties`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OptionalListener(String className)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getClassName()`
    `Set<String>` | `getProperties()` Return a set of the property keys.
    `Object` | `getProperty(String name)` Return a property from the protocol handler.
    `void` | `lifecycleEvent(LifecycleEvent event)` Acknowledge the occurrence of the specified event.
    `boolean` | `setProperty(String name, String value)` Set the given property.

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

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

- - ### Field Detail

    - #### className

          protected final String className

    - #### properties

          protected final HashMap<String,String> properties

  - ### Constructor Detail

    - #### OptionalListener

          public OptionalListener(String className)

  - ### Method Detail

    - #### getClassName

          public String getClassName()

      Returns:
        the className

    - #### 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

    - #### getProperties

          public Set<String> getProperties()

      Return a set of the property keys.
      Returns:
        the set

    - #### getProperty

          public Object getProperty(String name)

      Return a property from the protocol handler.
      Parameters:
        `name` - the property name
      Returns:
        the property value

    - #### setProperty

          public boolean setProperty(String name,
                                     String value)

      Set the given property.
      Parameters:
        `name` - the property name
        `value` - the property value
      Returns:
        `true`

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