public abstract class OSResourceManager
extends java.lang.Object
memptr
or library
, to be remoted
either from the server or client-side.
Server-side resources can be enabled via a directory configuration, per account, group, server or global. The directory node is:
<node class="string" name="server-side-resources"> <node-attribute name="value" value="memptr,library,streams"> </node>
The special value all
can be used to enable all OS resources at server-side, to not specify
them by name.
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ALL_RESOURCES
Enable all resources as server-side.
|
protected static java.lang.String |
LIBRARY_RESOURCE
The name of the
library calls OS resource. |
protected static java.util.logging.Logger |
LOG
Logger.
|
protected static java.lang.String |
MEMPTR_RESOURCE
The name of the
memptr OS resource. |
private static ContextLocal<OSResourceManager> |
mgr
The OS resource manager singleton (client or server side).
|
private static java.util.Map<java.lang.String,java.lang.Boolean> |
RESOURCE_INITIALIZED
Map with flags for each resource who has already been initialized - this is required to initialize a
resource only once per JVM.
|
protected java.util.Map<java.lang.String,java.lang.Runnable> |
resourceInitialization
Map with code to be executed when a resource is first initialized.
|
protected java.util.Map<java.lang.String,java.lang.Boolean> |
serverSideResources
Map with flags for each server-side enabled OS resource.
|
protected static java.lang.String |
STREAMS_RESOURCE
The name of the streams OS resource.
|
Constructor and Description |
---|
OSResourceManager()
Initialize this instance with the current context's server-side resource configuration.
|
Modifier and Type | Method and Description |
---|---|
static OSResourceManager |
getInstance()
Get the OS resource manager instance.
|
protected void |
initialize()
Initialize each resource, either on client or server-side.
|
abstract NativeAPICaller |
initializeLibrary()
Initialize the OS
LIBRARY_RESOURCE resource. |
abstract LowLevelBuffer |
initializeMemptr()
Initialize the OS
MEMPTR_RESOURCE resource. |
boolean |
isServerSideLibrary()
Check if the
LIBRARY_RESOURCE is enabled on server-side. |
boolean |
isServerSideMemptr()
Check if the
MEMPTR_RESOURCE is enabled on server-side. |
protected static final java.util.logging.Logger LOG
protected static final java.lang.String MEMPTR_RESOURCE
memptr
OS resource.protected static final java.lang.String LIBRARY_RESOURCE
library calls
OS resource.protected static final java.lang.String STREAMS_RESOURCE
protected static final java.lang.String ALL_RESOURCES
private static ContextLocal<OSResourceManager> mgr
private static final java.util.Map<java.lang.String,java.lang.Boolean> RESOURCE_INITIALIZED
protected final java.util.Map<java.lang.String,java.lang.Runnable> resourceInitialization
protected final java.util.Map<java.lang.String,java.lang.Boolean> serverSideResources
public OSResourceManager()
public static OSResourceManager getInstance()
public abstract LowLevelBuffer initializeMemptr()
MEMPTR_RESOURCE
resource.LowLevelBuffer
network or local object.public abstract NativeAPICaller initializeLibrary()
LIBRARY_RESOURCE
resource.NativeAPICaller
network or local object.public boolean isServerSideMemptr()
MEMPTR_RESOURCE
is enabled on server-side.public boolean isServerSideLibrary()
LIBRARY_RESOURCE
is enabled on server-side.protected void initialize()