JniLifecycleListener (Apache Tomcat 9.0.111 API Documentation)
Description: declaration: package: org.apache.catalina.core, class: JniLifecycleListener

# Class JniLifecycleListener

java.lang.Object
org.apache.catalina.core.JniLifecycleListener

All Implemented Interfaces:
  `LifecycleListener`

public class JniLifecycleListener extends Object implements LifecycleListener
An implementation of LifeCycleListener that loads a native library into the JVM.

Native libraries are associated with the class loader of the class that loaded them, and the same library may not be loaded by more than one class loader. Due to that restriction, loading a native library from a Webapp's class loader makes it impossible for other Webapps to load the native library.

Loading the native library using this listener solves the issue as it is loaded by a shared class loader (typically the Common class loader, but may vary in some configurations).

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final StringManager`
  `sm`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JniLifecycleListener()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getLibraryName()`
  `String`
  `getLibraryPath()`
  `void`
  `lifecycleEvent(LifecycleEvent event)`
  Acknowledge the occurrence of the specified event.
  `void`
  `setLibraryName(String libraryName)`
  `void`
  `setLibraryPath(String libraryPath)`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### sm

    protected static final StringManager sm

- ## Constructor Details

  - ### JniLifecycleListener

    public JniLifecycleListener()

- ## Method Details

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

  - ### setLibraryName

    public void setLibraryName(String libraryName)

  - ### getLibraryName

    public String getLibraryName()

  - ### setLibraryPath

    public void setLibraryPath(String libraryPath)

  - ### getLibraryPath

    public String getLibraryPath()