1 17 package org.apache.geronimo.axis; 18 19 import org.apache.axis.AxisProperties; 20 import org.apache.geronimo.gbean.GBeanInfo; 21 import org.apache.geronimo.gbean.GBeanInfoBuilder; 22 23 26 public class AxisDiscoveryCLWorkaroundGBean { 27 28 public AxisDiscoveryCLWorkaroundGBean(ClassLoader classLoader) { 29 Thread currentThread = Thread.currentThread(); 30 ClassLoader oldClassLoader = currentThread.getContextClassLoader(); 31 currentThread.setContextClassLoader(classLoader); 32 try { 33 AxisProperties.getNameDiscoverer(); 35 } finally { 36 currentThread.setContextClassLoader(oldClassLoader); 37 } 38 } 39 40 public static final GBeanInfo GBEAN_INFO; 41 42 static { 43 GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(AxisDiscoveryCLWorkaroundGBean.class); 44 infoBuilder.addAttribute("classLoader", ClassLoader .class, false); 45 infoBuilder.setConstructor(new String [] {"classLoader"}); 46 GBEAN_INFO = infoBuilder.getBeanInfo(); 47 } 48 49 public static GBeanInfo getGBeanInfo() { 50 return GBEAN_INFO; 51 } 52 } 53 | Popular Tags |