org.jboss.net.axis
public class: SetClassLoaderHandler [javadoc |
source]
java.lang.Object
org.apache.axis.handlers.BasicHandler
org.jboss.net.axis.ResetClassLoaderHandler
org.jboss.net.axis.SetClassLoaderHandler
This handler is to embed an incoming request into
the right classloader and should be put into a request
chain after the service detection handlers. It should be
complemented by a seperate
org.jboss.net.axis.ResetClassLoaderHandler
in the response chain to reinstall the thread association
in case of success.
- created:
11.03.2002 -
- author:
< - a href="mailto:Christoph.Jung@infor.de">Christoph G. Jung
- version:
$ - Revision: 1.1.4.1 $
| Method from org.jboss.net.axis.SetClassLoaderHandler Summary: |
|---|
|
invoke |
| Method from org.jboss.net.axis.SetClassLoaderHandler Detail: |
public void invoke(MessageContext msgContext) {
EngineConfiguration engineConfig=msgContext.getAxisEngine().getConfig();
if(engineConfig instanceof XMLResourceProvider) {
XMLResourceProvider config=(XMLResourceProvider) engineConfig;
ClassLoader newLoader=config.getMyDeployment().getClassLoader(new QName(null,
msgContext.getTargetService()));
if(newLoader!=null) {
ClassLoader currentLoader=Thread.currentThread().getContextClassLoader();
if(!newLoader.equals(currentLoader)) {
msgContext.setProperty(Constants.OLD_CLASSLOADER_PROPERTY,currentLoader);
Thread.currentThread().setContextClassLoader(newLoader);
}
}
}
}
reroutes the thread associated classloader to
the one that deployed the corresponding service |