AxisWSServiceImpl.java

00001 
00026 package org.objectweb.jonas.ws.axis;
00027 
00028 import javax.naming.Context;
00029 import javax.xml.namespace.QName;
00030 
00031 import org.apache.axis.AxisProperties;
00032 import org.apache.axis.deployment.wsdd.WSDDConstants;
00033 import org.apache.axis.deployment.wsdd.WSDDProvider;
00034 
00035 import org.objectweb.jonas_lib.loader.ThreadContextClassLoader;
00036 
00037 import org.objectweb.jonas.ws.AbsWebServicesServiceImpl;
00038 import org.objectweb.jonas.ws.WSServiceException;
00039 
00040 import org.objectweb.util.monolog.api.BasicLevel;
00041 
00049 public class AxisWSServiceImpl extends AbsWebServicesServiceImpl {
00050 
00052     private static final String AXIS_CONFIG_FACTORY_PROP =
00053         "axis.EngineConfigFactory";
00054 
00056     private static final String AXIS_MODULE_CONFIG_CLASS =
00057         "org.objectweb.jonas.ws.axis.JServletEngineConfigurationFactory";
00058 
00066     public void doInit(Context ctx) throws WSServiceException {
00067         super.doInit(ctx);
00068 
00069         getLogger().log(BasicLevel.DEBUG, "Adding " + AXIS_MODULE_CONFIG_CLASS + " as ConfigurationFactory");
00070 
00071         //set our custom provider
00072         QName javaURI = new QName(WSDDConstants.URI_WSDD_JAVA, WSDDJOnASEJBProvider.PROVIDER_NAME);
00073         WSDDProvider.registerProvider(javaURI, new WSDDJOnASEJBProvider());
00074 
00075         // Add our Config Factory in Axis
00076         AxisProperties.setProperty(AXIS_CONFIG_FACTORY_PROP,
00077                                    AXIS_MODULE_CONFIG_CLASS);
00078 
00079         // Fix for Bug #300844
00080         // Use a ClassLoader that will delegate to call-time real context ClassLoader
00081         ClassLoader old = Thread.currentThread().getContextClassLoader();
00082         Thread.currentThread().setContextClassLoader(new ThreadContextClassLoader());
00083         AxisProperties.getNameDiscoverer();
00084         Thread.currentThread().setContextClassLoader(old);
00085     }
00086 
00087 }

Generated on Tue Feb 15 15:05:34 2005 for JOnAS by  doxygen 1.3.9.1