Package org.apache.sshd.agent.unix
Class AprLibrary
java.lang.Object
org.apache.sshd.agent.unix.AprLibrary
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 poolgetRootPool()
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
chmodOwner
(String authSocket, boolean execute) (package private) static String
protected void
finalize()
static AprLibrary
get the shared instance of APR library, if none, initialize one(package private) long
get the package wide root pool, the mother of all the pool created in APR transport module.private static void
initialize the APR Library by loading the associated native libraries and creating the associated singletonstatic boolean
is the APR library was initialized.(package private) static void
secureLocalSocket
(String authSocket, long handle)
-
Field Details
-
library
-
pool
private final long pool
-
-
Constructor Details
-
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:
RuntimeException
- if failed to load the library. Note: callers should inspect the cause of the exception in case anError
was thrown (e.g.,UnsatisfiedLinkError
).
-
-
Method Details
-
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
-
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
- Throws:
IOException
-
secureLocalSocket
- Throws:
IOException
-
chmodOwner
- Throws:
IOException
-