Package org.apache.tomcat
Interface ContextBind
public interface ContextBind
-
Method Summary
Modifier and TypeMethodDescriptionbind(boolean usePrivilegedAction, ClassLoader originalClassLoader) Change the current thread context class loader to the web application class loader.voidunbind(boolean usePrivilegedAction, ClassLoader originalClassLoader) Restore the current thread context class loader to the original class loader in used beforebind(boolean, ClassLoader)was called.
-
Method Details
-
bind
Change the current thread context class loader to the web application class loader. If no web application class loader is defined, or if the current thread is already using the web application class loader then no change will be made. If the class loader is changed and ais configured theninvalid @link
org.apache.catalina.ThreadBindingListenerwill be called after the change has been made.invalid @link
org.apache.catalina.ThreadBindingListener#bind()- Parameters:
usePrivilegedAction- Should aPrivilegedActionbe used when obtaining the current thread context class loader and setting the new one?originalClassLoader- The current class loader if known to save this method having to look it up- Returns:
- If the class loader has been changed by the method it will return the thread context class loader in use when the method was called. If no change was made then this method returns null.
-
unbind
Restore the current thread context class loader to the original class loader in used beforebind(boolean, ClassLoader)was called. If no original class loader is passed to this method then no change will be made. If the class loader is changed and ais configured theninvalid @link
org.apache.catalina.ThreadBindingListenerwill be called before the change is made.invalid @link
org.apache.catalina.ThreadBindingListener#unbind()- Parameters:
usePrivilegedAction- Should aPrivilegedActionbe used when setting the current thread context class loader?originalClassLoader- The class loader to restore as the thread context class loader
-