|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.media.naming.MemoryContext
An in-memory JNDI service provider. 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 namespace and serve as the root of that namespace.
Such a namespace is no accessible except through the creating 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 Context.PROVIDER_URL
is set,
the context will reference a node in a namespace shared by all such
contexts. That tree is statically held in memory for the life time
of the virtual machine.
This class 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 :).
MemoryContextFactory
Field Summary | |
static NameParser |
DefaultNameParser
The default name parser for this context. |
static String |
NameSeparator
The default name separator for this context is '/'. |
static String |
ReadOnly
Environment attribute to set a context read-only. |
Fields inherited from interface javax.naming.Context |
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES |
Constructor Summary | |
MemoryContext(Hashtable env)
Construct a new context with the specified environment attributes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String ReadOnly
public static final String NameSeparator
public static final NameParser DefaultNameParser
Constructor Detail |
public MemoryContext(Hashtable env) throws NamingException
Context.PROVIDER_URL
names the underlying bindings. If the property is absent, the
returned context has it's own binding space which is not shared
with other contexts created in this manner.
env
- The environment attributes
NotContextException
- The attribute Context.PROVIDER_URL
does not specify a context
InvalidNameException
- The attribute Context.PROVIDER_URL
is an invalid name
NamingException
Method Detail |
public Object lookup(String name) throws NamingException
lookup
in interface Context
NamingException
public Object lookup(Name name) throws NamingException
lookup
in interface Context
NamingException
public Object lookupLink(String name) throws NamingException
lookupLink
in interface Context
NamingException
public Object lookupLink(Name name) throws NamingException
lookupLink
in interface Context
NamingException
public void bind(String name, Object value) throws NamingException
bind
in interface Context
NamingException
public void bind(Name name, Object value) throws NamingException
bind
in interface Context
NamingException
public void rebind(String name, Object value) throws NamingException
rebind
in interface Context
NamingException
public void rebind(Name name, Object value) throws NamingException
rebind
in interface Context
NamingException
public void unbind(String name) throws NamingException
unbind
in interface Context
NamingException
public void unbind(Name name) throws NamingException
unbind
in interface Context
NamingException
public void rename(String oldName, String newName) throws NamingException
rename
in interface Context
NamingException
public void rename(Name oldName, Name newName) throws NamingException
rename
in interface Context
NamingException
public NamingEnumeration list(String name) throws NamingException
list
in interface Context
NamingException
public NamingEnumeration list(Name name) throws NamingException
list
in interface Context
NamingException
public NamingEnumeration listBindings(String name) throws NamingException
listBindings
in interface Context
NamingException
public NamingEnumeration listBindings(Name name) throws NamingException
listBindings
in interface Context
NamingException
public Context createSubcontext(String name) throws NamingException
createSubcontext
in interface Context
NamingException
public Context createSubcontext(Name name) throws NamingException
createSubcontext
in interface Context
NamingException
public void destroySubcontext(String name) throws NamingException
destroySubcontext
in interface Context
NamingException
public void destroySubcontext(Name name) throws NamingException
destroySubcontext
in interface Context
NamingException
public NameParser getNameParser(String name) throws NamingException
getNameParser
in interface Context
NamingException
public NameParser getNameParser(Name name) throws NamingException
getNameParser
in interface Context
NamingException
public Name composeName(Name name, Name prefix) throws NamingException
composeName
in interface Context
NamingException
public String composeName(String name, String prefix)
composeName
in interface Context
public String getNameInNamespace() throws NamingException
getNameInNamespace
in interface Context
NamingException
public Object addToEnvironment(String name, Object value) throws NamingException
addToEnvironment
in interface Context
NamingException
public Hashtable getEnvironment()
getEnvironment
in interface Context
public Object removeFromEnvironment(String name)
removeFromEnvironment
in interface Context
public void close()
close
in interface Context
public String toString()
toString
in class Object
public MemoryBinding getBindings()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |