|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
MemoryBinding | Name/value bindings for use inside MemoryContext . |
MemoryContext | An in-memory JNDI service provider. |
MemoryContextFactory | Implements a context factory for MemoryContext . |
MemoryContextTest | Simple calss to show the MemoryContext usage mode. |
Provides the JNDI Environment & Service Naming Contexts
This package was inspired by the tyrex.naming package from the Tyrex project. All credits for the good stuff should go to Assaf Arkin and the Exolab group, all the bad stuff blame it on me :).
An in-memory namespace is available through the MemoryContext
JNDI service provider. The in-memory namespace holds objects directly in memory
including factories and services that cannot be held in a persistent namespace.
It supports two modes of operation, a tree shared between all instances through
a shared namespace, and trees created dynamically with access controlled by their
creator. See In-Memory Context for more details.
The in-memory JNDI service provider has the following properties:
The caller must had adequate security permission to access the shared in-memory namespace (creating a private namespace requires no permission) and to set/unset the ENC for the current thread, see Access Permissions for more details.
MemoryContext
is an in-memory JNDI service provider. It binds
objects into a namespace held entirely in memory, supporting serializable, remoteable
and local objects. The in-memory service provider is particularly useful for holding
resource factories (the JNDI ENC) and exposing run-time services and configuration objects.
An instance of MemoryContext
constructed with no environment attribute will use
it's own tree of bindings. Such a tree is no accessible except through context created from
the original context, and is garbage collected when all such contexts are no longer referenced.
If necessary the root context can be duplicated using lookup( "" ).
If the environment attribute PROVIDER_URL
is used, the context will reference
a node in a tree shared by all such contexts. That tree is statically held in memory for the
life time of the virtual machine.
MemoryContextFactory
implements a context factory for MemoryContext
.
When set properly InitialContext
will return a MemoryContext
referencing the named path in the memory model. Typically applications will use it to
construct an in-memory namespace under the shared root, e.g.:
MemoryContextFactory factory; Hashtable env; // Set up the path env = new Hashtable(); env.put( Context.PROVIDER_URL, "services" ); // Obtain the context for services factory = new MemoryContextFactory(); ctx = factory.getInitialContext( env ); // Alternatively, construct MemoryContext directly env = new Hashtable(); env.put( Context.PROVIDER_URL, "services" ); ctx = new MemoryContext( env );
|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |