1 7 8 package org.jboss.net.axis; 10 11 import org.jboss.axis.EngineConfiguration; 12 import org.jboss.axis.Handler; 13 import org.jboss.axis.deployment.wsdd.WSDDService; 14 import org.jboss.axis.deployment.wsdd.providers.WSDDHandlerProvider; 15 16 26 27 public class ServiceClassLoaderAwareWSDDHandlerProvider 28 extends WSDDHandlerProvider 29 { 30 31 34 public Handler newProviderInstance(WSDDService arg0, 35 EngineConfiguration arg1) 36 throws Exception 37 { 38 39 Deployment deployment = (Deployment)arg0.getParametersTable(). 40 get(Constants.SERVICE_DEPLOYMENT_PARAMETER); 41 42 if (deployment != null) 43 { 44 ClassLoader loader = deployment.getDeploymentLoader(); 45 ClassLoader old = Thread.currentThread().getContextClassLoader(); 46 Thread.currentThread().setContextClassLoader(loader); 47 try 48 { 49 return super.newProviderInstance(arg0, arg1); 50 } 51 finally 52 { 53 Thread.currentThread().setContextClassLoader(old); 54 } 55 } 56 else 57 { 58 return super.newProviderInstance(arg0, arg1); 59 } 60 } 61 62 } 63 | Popular Tags |