Package org.jboss.as.naming
Class InMemoryNamingStore
java.lang.Object
org.jboss.as.naming.InMemoryNamingStore
- All Implemented Interfaces:
NamingStore,WritableNamingStore
In-memory implementation of the NamingStore. The backing for the entries is a basic tree structure with either context
nodes or binding nodes. The context nodes are allowed to have children and can be represented by a NamingContext. A
binding node is only allowed to have a normal object binding.
- Author:
- John E. Bailey
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct 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. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNamingListener(Name target, int scope, NamingListener listener) Add aNamingListenerto the naming event coordinator.voidBind and object into the naming store, creating parent contexts if needed.voidBind and object into the naming store, creating parent contexts if needed.voidclose()Close the store.createSubcontext(Name name) Create a sub-context for the provided name.Retrieves the store's base name, which is the prefix for the absolute name of each entry in the store.List all NameClassPair instances at a given location in the tree.listBindings(Name name) List all the Binding instances at a given location in the tree.Lookup the object value of a binding node in the tree.Look up an object from the naming store.voidRe-bind and object into the naming store.voidRe-bind and object into the naming store.voidremoveNamingListener(NamingListener listener) Remove aNamingListenerfrom the naming event coordinator.voidUnbind the entry in the provided location.
-
Constructor Details
-
InMemoryNamingStore
public InMemoryNamingStore()Construct instance with no event support, and an empty base name. -
InMemoryNamingStore
Construct instance with an event coordinator, and an empty base name.- Parameters:
eventCoordinator- The event coordinator
-
InMemoryNamingStore
Construct instance with no event support, and the specified base name.- Parameters:
baseName-
-
InMemoryNamingStore
Construct instance with an event coordinator, and the specified base name.- Parameters:
eventCoordinator-baseName-
-
-
Method Details
-
getBaseName
Retrieves the store's base name, which is the prefix for the absolute name of each entry in the store.- Specified by:
getBaseNamein interfaceNamingStore- Returns:
- Throws:
NamingException
-
bind
Bind and object into the naming store, creating parent contexts if needed. All parent contexts must be created before this can be executed. The bind object type will be determined by the class of the object being passed in.- Specified by:
bindin interfaceWritableNamingStore- Parameters:
name- The entry nameobject- The entry object- Throws:
NamingException- If any problems occur
-
bind
Bind and object into the naming store, creating parent contexts if needed. All parent contexts must be created before this can be executed.- Specified by:
bindin interfaceWritableNamingStore- Parameters:
name- The entry nameobject- The entry objectbindType- The entry class- Throws:
NamingException- If any problems occur
-
rebind
Re-bind and object into the naming store. All parent contexts must be created before this can be executed. The bind object type will be determined by the class of the object being passed in.- Specified by:
rebindin interfaceWritableNamingStore- Parameters:
name- The entry nameobject- The entry object- Throws:
NamingException- If any problems occur
-
rebind
Re-bind and object into the naming store. All parent contexts must be created before this can be executed.- Specified by:
rebindin interfaceWritableNamingStore- Parameters:
name- The entry nameobject- The entry objectbindType- The entry class- Throws:
NamingException- If any problems occur
-
unbind
Unbind the entry in the provided location. This will remove the node in the tree and no longer manage it.- Specified by:
unbindin interfaceWritableNamingStore- Parameters:
name- The entry name- Throws:
NamingException
-
lookup
Lookup the object value of a binding node in the tree.- Specified by:
lookupin interfaceNamingStore- Parameters:
name- The entry name- Returns:
- The object value of the binding
- Throws:
NamingException
-
lookup
Description copied from interface:NamingStoreLook up an object from the naming store. An entry for this name must already exist.- Specified by:
lookupin interfaceNamingStore- Parameters:
name- The entry namedereference- if true indicates that managed references should retrieve the instance.- Returns:
- The object from the store.
- Throws:
NamingException- If any errors occur.
-
list
List all NameClassPair instances at a given location in the tree.- Specified by:
listin interfaceNamingStore- Parameters:
name- The entry name- Returns:
- The NameClassPair instances
- Throws:
NamingException
-
listBindings
List all the Binding instances at a given location in the tree.- Specified by:
listBindingsin interfaceNamingStore- Parameters:
name- The entry name- Returns:
- The Binding instances
- Throws:
NamingException
-
createSubcontext
Description copied from interface:WritableNamingStoreCreate a sub-context for the provided name.- Specified by:
createSubcontextin interfaceWritableNamingStore- Parameters:
name- The entry name- Returns:
- The new sub-context
- Throws:
NamingException- If any errors occur
-
close
Close the store. This will clear all children from the root node.- Specified by:
closein interfaceNamingStore- Throws:
NamingException
-
addNamingListener
Add aNamingListenerto the naming event coordinator.- Specified by:
addNamingListenerin interfaceNamingStore- Parameters:
target- The target name to add the listener toscope- The listener scopelistener- The listener
-
removeNamingListener
Remove aNamingListenerfrom the naming event coordinator.- Specified by:
removeNamingListenerin interfaceNamingStore- Parameters:
listener- The listener
-