站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

ContextClassLoaderSwitcher.SwitchContext (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.loading
Class ContextClassLoaderSwitcher.SwitchContext

java.lang.Object
  extended byorg.jboss.util.loading.ContextClassLoaderSwitcher.SwitchContext
Enclosing class:
ContextClassLoaderSwitcher

public class ContextClassLoaderSwitcher.SwitchContext
extends Object

A helper class to remember the original classloader and avoid continually retrieveing the current thread.


Method Summary
 void forceReset()
          Force a reset back to the original classloader, useful when somebody else might have changed the thread context classloader so we cannot optimize
 ClassLoader getCurrentClassLoader()
          Retrieve the current classloader (as set through this class).
 ClassLoader getOriginalClassLoader()
          Retrieve the original classloader
 Thread getThread()
          Retrieve the current thread
 void reset()
          Reset back to the original classloader, only when it has changed.
 void setClassLoader(ClassLoader cl)
          Change the context classloader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getThread

public Thread getThread()
Retrieve the current thread


getOriginalClassLoader

public ClassLoader getOriginalClassLoader()
Retrieve the original classloader


getCurrentClassLoader

public ClassLoader getCurrentClassLoader()
Retrieve the current classloader (as set through this class).


setClassLoader

public void setClassLoader(ClassLoader cl)
Change the context classloader

The operation is ignored if the classloader is null or has not changed

Parameters:
cl - the new classloader

reset

public void reset()
Reset back to the original classloader, only when it has changed.


forceReset

public void forceReset()
Force a reset back to the original classloader, useful when somebody else might have changed the thread context classloader so we cannot optimize



Copyright © 2002 JBoss Group, LLC. All Rights Reserved.