public class InMemoryNamingStore extends Object implements WritableNamingStore
Constructor and Description |
---|
InMemoryNamingStore()
Construct instance with no event support, and an empty base name.
|
InMemoryNamingStore(Name baseName)
Construct instance with no event support, and the specified base name.
|
InMemoryNamingStore(NamingEventCoordinator eventCoordinator)
Construct instance with an event coordinator, and an empty base name.
|
InMemoryNamingStore(NamingEventCoordinator eventCoordinator,
Name baseName)
Construct instance with an event coordinator, and the specified base name.
|
Modifier and Type | Method and Description |
---|---|
void |
addNamingListener(Name target,
int scope,
NamingListener listener)
Add a
NamingListener to the naming event coordinator. |
void |
bind(Name name,
Object object)
Bind and object into the naming store, creating parent contexts if needed.
|
void |
bind(Name name,
Object object,
Class<?> bindType)
Bind and object into the naming store, creating parent contexts if needed.
|
void |
close()
Close the store.
|
Context |
createSubcontext(Name name)
Create a sub-context for the provided name.
|
Name |
getBaseName()
Retrieves the store's base name, which is the prefix for the absolute name of each entry in the store.
|
List<NameClassPair> |
list(Name name)
List all NameClassPair instances at a given location in the tree.
|
List<Binding> |
listBindings(Name name)
List all the Binding instances at a given location in the tree.
|
Object |
lookup(Name name)
Lookup the object value of a binding node in the tree.
|
Object |
lookup(Name name,
boolean dereference)
Look up an object from the naming store.
|
void |
rebind(Name name,
Object object)
Re-bind and object into the naming store.
|
void |
rebind(Name name,
Object object,
Class<?> bindType)
Re-bind and object into the naming store.
|
void |
removeNamingListener(NamingListener listener)
Remove a
NamingListener from the naming event coordinator. |
void |
unbind(Name name)
Unbind the entry in the provided location.
|
public InMemoryNamingStore()
public InMemoryNamingStore(NamingEventCoordinator eventCoordinator)
eventCoordinator
- The event coordinatorpublic InMemoryNamingStore(Name baseName)
baseName
- public InMemoryNamingStore(NamingEventCoordinator eventCoordinator, Name baseName)
eventCoordinator
- baseName
- public Name getBaseName() throws NamingException
getBaseName
in interface NamingStore
NamingException
public void bind(Name name, Object object) throws NamingException
bind
in interface WritableNamingStore
name
- The entry nameobject
- The entry objectNamingException
- If any problems occurpublic void bind(Name name, Object object, Class<?> bindType) throws NamingException
bind
in interface WritableNamingStore
name
- The entry nameobject
- The entry objectbindType
- The entry classNamingException
- If any problems occurpublic void rebind(Name name, Object object) throws NamingException
rebind
in interface WritableNamingStore
name
- The entry nameobject
- The entry objectNamingException
- If any problems occurpublic void rebind(Name name, Object object, Class<?> bindType) throws NamingException
rebind
in interface WritableNamingStore
name
- The entry nameobject
- The entry objectbindType
- The entry classNamingException
- If any problems occurpublic void unbind(Name name) throws NamingException
unbind
in interface WritableNamingStore
name
- The entry nameNamingException
public Object lookup(Name name) throws NamingException
lookup
in interface NamingStore
name
- The entry nameNamingException
public Object lookup(Name name, boolean dereference) throws NamingException
NamingStore
lookup
in interface NamingStore
name
- The entry namedereference
- if true indicates that managed references should retrieve the instance.NamingException
- If any errors occur.public List<NameClassPair> list(Name name) throws NamingException
list
in interface NamingStore
name
- The entry nameNamingException
public List<Binding> listBindings(Name name) throws NamingException
listBindings
in interface NamingStore
name
- The entry nameNamingException
public Context createSubcontext(Name name) throws NamingException
WritableNamingStore
createSubcontext
in interface WritableNamingStore
name
- The entry nameNamingException
- If any errors occurpublic void close() throws NamingException
close
in interface NamingStore
NamingException
public void addNamingListener(Name target, int scope, NamingListener listener)
NamingListener
to the naming event coordinator.addNamingListener
in interface NamingStore
target
- The target name to add the listener toscope
- The listener scopelistener
- The listenerpublic void removeNamingListener(NamingListener listener)
NamingListener
from the naming event coordinator.removeNamingListener
in interface NamingStore
listener
- The listenerCopyright © 2014 JBoss by Red Hat. All rights reserved.