Package org.jboss.as.naming.context
Class NamespaceContextSelector
java.lang.Object
org.jboss.as.naming.context.NamespaceContextSelector
Selects a naming context based on the provided identifier (eg. comp). Maintains a thread local used to managed the current selector.
The current selector will be used by instances of
org.jboss.as.naming.contexts.NamespaceObjectFactory to determine
which context to return.- Author:
- John E. Bailey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ContextgetContext(String identifier) Get the context for a given identifier (eg. comp -> java:comp).static NamespaceContextSelectorGet the current context selector for the current thread.static NamespaceContextSelectorPops the current selector for the thread, replacing it with the previous selectorstatic voidpushCurrentSelector(NamespaceContextSelector selector) Set the current context selector for the current thread.static voidsetDefault(NamespaceContextSelector selector)
-
Constructor Details
-
NamespaceContextSelector
public NamespaceContextSelector()
-
-
Method Details
-
pushCurrentSelector
Set the current context selector for the current thread.- Parameters:
selector- The current selector
-
popCurrentSelector
Pops the current selector for the thread, replacing it with the previous selector- Returns:
- selector The current selector
-
getCurrentSelector
Get the current context selector for the current thread.- Returns:
- The current context selector.
-
getContext
Get the context for a given identifier (eg. comp -> java:comp). Implementers of this method can use any means to determine which context to return.- Parameters:
identifier- The context identifier- Returns:
- The context for this identifier
-
setDefault
-