|
|||||||||||
| 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 ContextNamingException
public Object lookup(Name name)
throws NamingException
lookup in interface ContextNamingException
public Object lookupLink(String name)
throws NamingException
lookupLink in interface ContextNamingException
public Object lookupLink(Name name)
throws NamingException
lookupLink in interface ContextNamingException
public void bind(String name,
Object value)
throws NamingException
bind in interface ContextNamingException
public void bind(Name name,
Object value)
throws NamingException
bind in interface ContextNamingException
public void rebind(String name,
Object value)
throws NamingException
rebind in interface ContextNamingException
public void rebind(Name name,
Object value)
throws NamingException
rebind in interface ContextNamingException
public void unbind(String name)
throws NamingException
unbind in interface ContextNamingException
public void unbind(Name name)
throws NamingException
unbind in interface ContextNamingException
public void rename(String oldName,
String newName)
throws NamingException
rename in interface ContextNamingException
public void rename(Name oldName,
Name newName)
throws NamingException
rename in interface ContextNamingException
public NamingEnumeration list(String name)
throws NamingException
list in interface ContextNamingException
public NamingEnumeration list(Name name)
throws NamingException
list in interface ContextNamingException
public NamingEnumeration listBindings(String name)
throws NamingException
listBindings in interface ContextNamingException
public NamingEnumeration listBindings(Name name)
throws NamingException
listBindings in interface ContextNamingException
public Context createSubcontext(String name)
throws NamingException
createSubcontext in interface ContextNamingException
public Context createSubcontext(Name name)
throws NamingException
createSubcontext in interface ContextNamingException
public void destroySubcontext(String name)
throws NamingException
destroySubcontext in interface ContextNamingException
public void destroySubcontext(Name name)
throws NamingException
destroySubcontext in interface ContextNamingException
public NameParser getNameParser(String name)
throws NamingException
getNameParser in interface ContextNamingException
public NameParser getNameParser(Name name)
throws NamingException
getNameParser in interface ContextNamingException
public Name composeName(Name name,
Name prefix)
throws NamingException
composeName in interface ContextNamingException
public String composeName(String name,
String prefix)
composeName in interface Context
public String getNameInNamespace()
throws NamingException
getNameInNamespace in interface ContextNamingException
public Object addToEnvironment(String name,
Object value)
throws NamingException
addToEnvironment in interface ContextNamingExceptionpublic Hashtable getEnvironment()
getEnvironment in interface Contextpublic Object removeFromEnvironment(String name)
removeFromEnvironment in interface Contextpublic void close()
close in interface Contextpublic String toString()
toString in class Objectpublic MemoryBinding getBindings()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||