Class JniLifecycleListener

  • All Implemented Interfaces:
    LifecycleListener

    public class JniLifecycleListener
    extends java.lang.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 StringManager sm
      StringManager for this class.
    • Constructor Summary

      Constructors 
      Constructor Description
      JniLifecycleListener()
      Constructs a new JniLifecycleListener.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLibraryName()
      Get the name of the library to load.
      java.lang.String getLibraryPath()
      Get the path of the library to load.
      void lifecycleEvent​(LifecycleEvent event)
      Acknowledge the occurrence of the specified event.
      void setLibraryName​(java.lang.String libraryName)
      Set the name of the library to load.
      void setLibraryPath​(java.lang.String libraryPath)
      Set the path of the library to load.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sm

        protected static final StringManager sm
        StringManager for this class.
    • Constructor Detail

      • JniLifecycleListener

        public JniLifecycleListener()
        Constructs a new JniLifecycleListener.
    • Method Detail

      • setLibraryName

        public void setLibraryName​(java.lang.String libraryName)
        Set the name of the library to load.
        Parameters:
        libraryName - the library name
      • getLibraryName

        public java.lang.String getLibraryName()
        Get the name of the library to load.
        Returns:
        the library name
      • setLibraryPath

        public void setLibraryPath​(java.lang.String libraryPath)
        Set the path of the library to load.
        Parameters:
        libraryPath - the library path
      • getLibraryPath

        public java.lang.String getLibraryPath()
        Get the path of the library to load.
        Returns:
        the library path