|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tyrex.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.
MemoryContextFactory
Field Summary | |
static javax.naming.NameParser |
DefaultNameParser
The default name parser for this context. |
static java.lang.String |
NameSeparator
The default name separator for this context is '/'. |
static java.lang.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(java.util.Hashtable env)
Construct a new context with the specified environment attributes. |
(package private) |
MemoryContext(MemoryBinding bindings,
java.util.Hashtable env)
Construct a new context with the specified bindings and environment attributes. |
Method Summary | |
java.lang.Object |
addToEnvironment(java.lang.String name,
java.lang.Object value)
|
void |
bind(javax.naming.Name name,
java.lang.Object value)
|
void |
bind(java.lang.String name,
java.lang.Object value)
|
void |
close()
|
javax.naming.Name |
composeName(javax.naming.Name name,
javax.naming.Name prefix)
|
java.lang.String |
composeName(java.lang.String name,
java.lang.String prefix)
|
javax.naming.Context |
createSubcontext(javax.naming.Name name)
|
javax.naming.Context |
createSubcontext(java.lang.String name)
|
(package private) void |
debug(java.io.PrintWriter writer)
|
void |
destroySubcontext(javax.naming.Name name)
|
void |
destroySubcontext(java.lang.String name)
|
MemoryBinding |
getBindings()
Returns the bindings represented by this context. |
java.util.Hashtable |
getEnvironment()
|
java.lang.String |
getNameInNamespace()
|
javax.naming.NameParser |
getNameParser(javax.naming.Name name)
|
javax.naming.NameParser |
getNameParser(java.lang.String name)
|
javax.naming.NamingEnumeration |
list(javax.naming.Name name)
|
javax.naming.NamingEnumeration |
list(java.lang.String name)
|
javax.naming.NamingEnumeration |
listBindings(javax.naming.Name name)
|
javax.naming.NamingEnumeration |
listBindings(java.lang.String name)
|
java.lang.Object |
lookup(javax.naming.Name name)
|
java.lang.Object |
lookup(java.lang.String name)
|
java.lang.Object |
lookupLink(javax.naming.Name name)
|
java.lang.Object |
lookupLink(java.lang.String name)
|
void |
rebind(javax.naming.Name name,
java.lang.Object value)
|
void |
rebind(java.lang.String name,
java.lang.Object value)
|
java.lang.Object |
removeFromEnvironment(java.lang.String name)
|
void |
rename(javax.naming.Name oldName,
javax.naming.Name newName)
|
void |
rename(java.lang.String oldName,
java.lang.String newName)
|
java.lang.String |
toString()
|
void |
unbind(javax.naming.Name name)
|
void |
unbind(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String ReadOnly
public static final java.lang.String NameSeparator
public static final javax.naming.NameParser DefaultNameParser
Constructor Detail |
public MemoryContext(java.util.Hashtable env) throws javax.naming.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
javax.naming.NotContextException
- The attribute Context.PROVIDER_URL
does not specify a context
javax.naming.InvalidNameException
- The attribute Context.PROVIDER_URL
is an invalid name
javax.naming.NamingException
MemoryContext(MemoryBinding bindings, java.util.Hashtable env)
Method Detail |
public java.lang.Object lookup(java.lang.String name) throws javax.naming.NamingException
lookup
in interface javax.naming.Context
javax.naming.NamingException
public java.lang.Object lookup(javax.naming.Name name) throws javax.naming.NamingException
lookup
in interface javax.naming.Context
javax.naming.NamingException
public java.lang.Object lookupLink(java.lang.String name) throws javax.naming.NamingException
lookupLink
in interface javax.naming.Context
javax.naming.NamingException
public java.lang.Object lookupLink(javax.naming.Name name) throws javax.naming.NamingException
lookupLink
in interface javax.naming.Context
javax.naming.NamingException
public void bind(java.lang.String name, java.lang.Object value) throws javax.naming.NamingException
bind
in interface javax.naming.Context
javax.naming.NamingException
public void bind(javax.naming.Name name, java.lang.Object value) throws javax.naming.NamingException
bind
in interface javax.naming.Context
javax.naming.NamingException
public void rebind(java.lang.String name, java.lang.Object value) throws javax.naming.NamingException
rebind
in interface javax.naming.Context
javax.naming.NamingException
public void rebind(javax.naming.Name name, java.lang.Object value) throws javax.naming.NamingException
rebind
in interface javax.naming.Context
javax.naming.NamingException
public void unbind(java.lang.String name) throws javax.naming.NamingException
unbind
in interface javax.naming.Context
javax.naming.NamingException
public void unbind(javax.naming.Name name) throws javax.naming.NamingException
unbind
in interface javax.naming.Context
javax.naming.NamingException
public void rename(java.lang.String oldName, java.lang.String newName) throws javax.naming.NamingException
rename
in interface javax.naming.Context
javax.naming.NamingException
public void rename(javax.naming.Name oldName, javax.naming.Name newName) throws javax.naming.NamingException
rename
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.NamingEnumeration list(java.lang.String name) throws javax.naming.NamingException
list
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.NamingEnumeration list(javax.naming.Name name) throws javax.naming.NamingException
list
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.NamingEnumeration listBindings(java.lang.String name) throws javax.naming.NamingException
listBindings
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.NamingEnumeration listBindings(javax.naming.Name name) throws javax.naming.NamingException
listBindings
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.Context createSubcontext(java.lang.String name) throws javax.naming.NamingException
createSubcontext
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.Context createSubcontext(javax.naming.Name name) throws javax.naming.NamingException
createSubcontext
in interface javax.naming.Context
javax.naming.NamingException
public void destroySubcontext(java.lang.String name) throws javax.naming.NamingException
destroySubcontext
in interface javax.naming.Context
javax.naming.NamingException
public void destroySubcontext(javax.naming.Name name) throws javax.naming.NamingException
destroySubcontext
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.NameParser getNameParser(java.lang.String name) throws javax.naming.NamingException
getNameParser
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.NameParser getNameParser(javax.naming.Name name) throws javax.naming.NamingException
getNameParser
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.Name composeName(javax.naming.Name name, javax.naming.Name prefix) throws javax.naming.NamingException
composeName
in interface javax.naming.Context
javax.naming.NamingException
public java.lang.String composeName(java.lang.String name, java.lang.String prefix)
composeName
in interface javax.naming.Context
public java.lang.String getNameInNamespace() throws javax.naming.NamingException
getNameInNamespace
in interface javax.naming.Context
javax.naming.NamingException
public java.lang.Object addToEnvironment(java.lang.String name, java.lang.Object value) throws javax.naming.NamingException
addToEnvironment
in interface javax.naming.Context
javax.naming.NamingException
public java.util.Hashtable getEnvironment()
getEnvironment
in interface javax.naming.Context
public java.lang.Object removeFromEnvironment(java.lang.String name)
removeFromEnvironment
in interface javax.naming.Context
public void close()
close
in interface javax.naming.Context
public java.lang.String toString()
public MemoryBinding getBindings()
void debug(java.io.PrintWriter writer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |