Package org.apache.naming
Class ContextBindings
java.lang.Object
org.apache.naming.ContextBindings
Handles the associations :
 
- Object with a NamingContext
- Calling thread with a NamingContext
- Calling thread with object bound to the same naming context
- Thread context class loader with a NamingContext
- Thread context class loader with object bound to the same NamingContext
- Author:
- Remy Maucherat
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final StringManagerThe string manager for this package.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidbindClassLoader(Object obj, Object token, ClassLoader classLoader) Binds a naming context to a class loader.static voidbindContext(Object obj, Context context) Binds an object and a naming context.static voidbindContext(Object obj, Context context, Object token) Binds an object and a naming context.static voidbindThread(Object obj, Object token) Binds a naming context to a thread.static ContextRetrieves the naming context bound to a class loader.static ContextRetrieves the naming context bound to the current thread.static booleanTests if the thread context class loader is bound to a context.static booleanTests if current thread is bound to a naming context.static voidunbindClassLoader(Object obj, Object token, ClassLoader classLoader) Unbinds a naming context and a class loader.static voidunbindContext(Object obj, Object token) Unbinds an object and a naming context.static voidunbindThread(Object obj, Object token) Unbinds a thread and a naming context.
- 
Field Details- 
smThe string manager for this package.
 
- 
- 
Constructor Details- 
ContextBindingspublic ContextBindings()
 
- 
- 
Method Details- 
bindContextBinds an object and a naming context.- Parameters:
- obj- Object to bind with naming context
- context- Associated naming context instance
 
- 
bindContextBinds an object and a naming context.- Parameters:
- obj- Object to bind with naming context
- context- Associated naming context instance
- token- Security token
 
- 
unbindContextUnbinds an object and a naming context.- Parameters:
- obj- Object to unbind
- token- Security token
 
- 
bindThreadBinds a naming context to a thread.- Parameters:
- obj- Object bound to the required naming context
- token- Security token
- Throws:
- NamingException- If no naming context is bound to the provided object
 
- 
unbindThreadUnbinds a thread and a naming context.- Parameters:
- obj- Object bound to the required naming context
- token- Security token
 
- 
getThreadRetrieves the naming context bound to the current thread.- Returns:
- The naming context bound to the current thread.
- Throws:
- NamingException- If no naming context is bound to the current thread
 
- 
isThreadBoundpublic static boolean isThreadBound()Tests if current thread is bound to a naming context.- Returns:
- trueif the current thread is bound to a naming context, otherwise- false
 
- 
bindClassLoaderpublic static void bindClassLoader(Object obj, Object token, ClassLoader classLoader) throws NamingException Binds a naming context to a class loader.- Parameters:
- obj- Object bound to the required naming context
- token- Security token
- classLoader- The class loader to bind to the naming context
- Throws:
- NamingException- If no naming context is bound to the provided object
 
- 
unbindClassLoaderUnbinds a naming context and a class loader.- Parameters:
- obj- Object bound to the required naming context
- token- Security token
- classLoader- The class loader bound to the naming context
 
- 
getClassLoaderRetrieves the naming context bound to a class loader.- Returns:
- the naming context bound to current class loader or one of its parents
- Throws:
- NamingException- If no naming context was bound
 
- 
isClassLoaderBoundpublic static boolean isClassLoaderBound()Tests if the thread context class loader is bound to a context.- Returns:
- trueif the thread context class loader or one of its parents is bound to a naming context, otherwise- false
 
 
-