public class InMemoryNamingStore extends Object implements WritableNamingStore
Constructor and Description |
---|
InMemoryNamingStore()
Construct instance with no event support.
|
InMemoryNamingStore(NamingEventCoordinator eventCoordinator)
Construct instance with an event coordinator.
|
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.
|
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.
|
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 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 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 © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.