public class ContextBindings
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
protected static StringManager |
sm |
The string manager for this package.
|
Constructor | Description |
---|---|
ContextBindings() |
Modifier and Type | Method | Description |
---|---|---|
static void |
bindClassLoader(java.lang.Object obj,
java.lang.Object token,
java.lang.ClassLoader classLoader) |
Binds a naming context to a class loader.
|
static void |
bindContext(java.lang.Object obj,
javax.naming.Context context) |
Binds an object and a naming context.
|
static void |
bindContext(java.lang.Object obj,
javax.naming.Context context,
java.lang.Object token) |
Binds an object and a naming context.
|
static void |
bindThread(java.lang.Object obj,
java.lang.Object token) |
Binds a naming context to a thread.
|
static javax.naming.Context |
getClassLoader() |
Retrieves the naming context bound to a class loader.
|
static javax.naming.Context |
getThread() |
Retrieves the naming context bound to the current thread.
|
static boolean |
isClassLoaderBound() |
Tests if the thread context class loader is bound to a context.
|
static boolean |
isThreadBound() |
Tests if current thread is bound to a naming context.
|
static void |
unbindClassLoader(java.lang.Object obj,
java.lang.Object token,
java.lang.ClassLoader classLoader) |
Unbinds a naming context and a class loader.
|
static void |
unbindContext(java.lang.Object obj,
java.lang.Object token) |
Unbinds an object and a naming context.
|
static void |
unbindThread(java.lang.Object obj,
java.lang.Object token) |
Unbinds a thread and a naming context.
|
protected static final StringManager sm
public static void bindContext(java.lang.Object obj, javax.naming.Context context)
obj
- Object to bind with naming contextcontext
- Associated naming context instancepublic static void bindContext(java.lang.Object obj, javax.naming.Context context, java.lang.Object token)
obj
- Object to bind with naming contextcontext
- Associated naming context instancetoken
- Security tokenpublic static void unbindContext(java.lang.Object obj, java.lang.Object token)
obj
- Object to unbindtoken
- Security tokenpublic static void bindThread(java.lang.Object obj, java.lang.Object token) throws javax.naming.NamingException
obj
- Object bound to the required naming contexttoken
- Security tokenjavax.naming.NamingException
- If no naming context is bound to the provided
objectpublic static void unbindThread(java.lang.Object obj, java.lang.Object token)
obj
- Object bound to the required naming contexttoken
- Security tokenpublic static javax.naming.Context getThread() throws javax.naming.NamingException
javax.naming.NamingException
- If no naming context is bound to the current
threadpublic static boolean isThreadBound()
true
if the current thread is bound to a naming
context, otherwise false
public static void bindClassLoader(java.lang.Object obj, java.lang.Object token, java.lang.ClassLoader classLoader) throws javax.naming.NamingException
obj
- Object bound to the required naming contexttoken
- Security tokenclassLoader
- The class loader to bind to the naming contextjavax.naming.NamingException
- If no naming context is bound to the provided
objectpublic static void unbindClassLoader(java.lang.Object obj, java.lang.Object token, java.lang.ClassLoader classLoader)
obj
- Object bound to the required naming contexttoken
- Security tokenclassLoader
- The class loader bound to the naming contextpublic static javax.naming.Context getClassLoader() throws javax.naming.NamingException
javax.naming.NamingException
- If no naming context was boundpublic static boolean isClassLoaderBound()
true
if the thread context class loader or one of
its parents is bound to a naming context, otherwise
false
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.