Class AprLibrary


  • public final class AprLibrary
    extends java.lang.Object

    Internal singleton used for initializing correctly the APR native library and the associated root memory pool.

    It'll finalize nicely the native resources (libraries and memory pools).

    Each memory pool used in the APR transport module needs to be children of the root pool getRootPool().
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static AprLibrary library  
      private long pool  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private AprLibrary()
      APR library singleton constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void chmodOwner​(java.lang.String authSocket, boolean execute)  
      (package private) static java.lang.String createLocalSocketAddress()  
      protected void finalize()  
      static AprLibrary getInstance()
      get the shared instance of APR library, if none, initialize one
      (package private) long getRootPool()
      get the package wide root pool, the mother of all the pool created in APR transport module.
      private static void initialize()
      initialize the APR Library by loading the associated native libraries and creating the associated singleton
      static boolean isInitialized()
      is the APR library was initialized.
      (package private) static void secureLocalSocket​(java.lang.String authSocket, long handle)  
      • Methods inherited from class java.lang.Object

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

      • pool

        private final long pool
    • Constructor Detail

      • AprLibrary

        private AprLibrary()
        APR library singleton constructor. Called only when accessing the singleton the first time. It is initializing an APR memory pool for the whole package (a.k.a mother or root pool).
        Throws:
        java.lang.RuntimeException - if failed to load the library. Note: callers should inspect the cause of the exception in case an Error was thrown (e.g., UnsatisfiedLinkError).
    • Method Detail

      • getInstance

        public static AprLibrary getInstance()
        get the shared instance of APR library, if none, initialize one
        Returns:
        the current APR library singleton
      • initialize

        private static void initialize()
        initialize the APR Library by loading the associated native libraries and creating the associated singleton
      • isInitialized

        public static boolean isInitialized()
        is the APR library was initialized.
        Returns:
        true if the Library is initialized, false otherwise
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • getRootPool

        long getRootPool()
        get the package wide root pool, the mother of all the pool created in APR transport module.
        Returns:
        number identifying the root pool
      • createLocalSocketAddress

        static java.lang.String createLocalSocketAddress()
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • secureLocalSocket

        static void secureLocalSocket​(java.lang.String authSocket,
                                      long handle)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • chmodOwner

        private static void chmodOwner​(java.lang.String authSocket,
                                       boolean execute)
                                throws java.io.IOException
        Throws:
        java.io.IOException