You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2010/05/25 05:26:54 UTC

svn commit: r947901 [3/3] - in /geronimo/server/trunk: framework/configs/geronimo-gbean-deployer-bootstrap/src/main/history/ framework/configs/jsr88-cli/src/main/history/ framework/configs/jsr88-deploymentfactory/src/main/history/ framework/configs/onl...

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml Tue May 25 03:26:52 2010
@@ -106,6 +106,14 @@
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.xmlbeans</artifactId>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${project.version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
 
     </dependencies>
 

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java Tue May 25 03:26:52 2010
@@ -19,7 +19,6 @@ package org.apache.geronimo.jaxws;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.lang.reflect.Modifier;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
@@ -30,19 +29,21 @@ import javax.xml.namespace.QName;
 import javax.xml.ws.BindingType;
 import javax.xml.ws.WebServiceProvider;
 
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
+import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class JAXWSUtils {
-    
+
     public static final String DEFAULT_CATALOG_WEB = "WEB-INF/jax-ws-catalog.xml";
     public static final String DEFAULT_CATALOG_EJB = "META-INF/jax-ws-catalog.xml";
 
     private static final Logger LOG = LoggerFactory.getLogger(JAXWSUtils.class);
-    
-    private static final Map<String, String> BINDING_MAP = 
+
+    private static final Map<String, String> BINDING_MAP =
         new HashMap<String, String>();
-    
+
     static {
         BINDING_MAP.put("##SOAP11_HTTP", "http://schemas.xmlsoap.org/wsdl/soap/http");
         BINDING_MAP.put("##SOAP12_HTTP", "http://www.w3.org/2003/05/soap/bindings/HTTP/");
@@ -50,12 +51,12 @@ public class JAXWSUtils {
         BINDING_MAP.put("##SOAP12_HTTP_MTOM", "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true");
         BINDING_MAP.put("##XML_HTTP", "http://www.w3.org/2004/08/wsdl/http");
     }
-    
+
     private JAXWSUtils() {
     }
 
     public static QName getPortType(Class seiClass) {
-        WebService webService = (WebService) seiClass.getAnnotation(WebService.class);        
+        WebService webService = (WebService) seiClass.getAnnotation(WebService.class);
         if (webService != null) {
             String localName = webService.name();
             if (localName == null || localName.length() == 0) {
@@ -78,39 +79,39 @@ public class JAXWSUtils {
             }
             return uri;
         } else {
-            return token;            
+            return token;
         }
     }
-    
+
     public static boolean isWebService(Class clazz) {
-        return ((clazz.isAnnotationPresent(WebService.class) || 
+        return ((clazz.isAnnotationPresent(WebService.class) ||
                  clazz.isAnnotationPresent(WebServiceProvider.class)) &&
                  isProperWebService(clazz));
     }
-    
+
     public static boolean isWebServiceProvider(Class clazz) {
         return (clazz.isAnnotationPresent(WebServiceProvider.class) && isProperWebService(clazz));
     }
-    
+
     private static boolean isProperWebService(Class clazz) {
         int modifiers = clazz.getModifiers();
         return (Modifier.isPublic(modifiers) &&
                 !Modifier.isFinal(modifiers) &&
                 !Modifier.isAbstract(modifiers));
     }
-    
+
     public static String getServiceName(Class clazz) {
         return getServiceQName(clazz).getLocalPart();
     }
-    
+
     private static String getServiceName(Class clazz, String name) {
         if (name == null || name.trim().length() == 0) {
             return clazz.getSimpleName() + "Service";
         } else {
             return name.trim();
-        }       
+        }
     }
-    
+
     private static String getPortName(Class clazz, String name, String portName) {
         if (portName == null || portName.trim().length() == 0) {
             if (name == null || name.trim().length() == 0) {
@@ -122,7 +123,7 @@ public class JAXWSUtils {
             return portName.trim();
         }
     }
-    
+
     private static String getNamespace(Class clazz, String namespace) {
         if (namespace == null || namespace.trim().length() == 0) {
             Package pkg = clazz.getPackage();
@@ -135,7 +136,7 @@ public class JAXWSUtils {
             return namespace.trim();
         }
     }
-    
+
     private static String getNamespace(String packageName) {
         if (packageName == null || packageName.length() == 0) {
             return null;
@@ -161,16 +162,16 @@ public class JAXWSUtils {
         namespace.append('/');
         return namespace.toString();
     }
-    
+
     private static QName getServiceQName(Class clazz, String namespace, String name) {
-        return new QName(getNamespace(clazz, namespace), getServiceName(clazz, name));         
+        return new QName(getNamespace(clazz, namespace), getServiceName(clazz, name));
     }
-    
+
     public static QName getServiceQName(Class clazz) {
-        WebService webService = 
+        WebService webService =
             (WebService)clazz.getAnnotation(WebService.class);
         if (webService == null) {
-            WebServiceProvider webServiceProvider = 
+            WebServiceProvider webServiceProvider =
                 (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
             if (webServiceProvider == null) {
                 throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
@@ -180,16 +181,16 @@ public class JAXWSUtils {
             return getServiceQName(clazz, webService.targetNamespace(), webService.serviceName());
         }
     }
-    
+
     private static QName getPortQName(Class clazz, String namespace, String name, String portName) {
-        return new QName(getNamespace(clazz, namespace), getPortName(clazz, name, portName));         
+        return new QName(getNamespace(clazz, namespace), getPortName(clazz, name, portName));
     }
-    
+
     public static QName getPortQName(Class clazz) {
-        WebService webService = 
+        WebService webService =
             (WebService)clazz.getAnnotation(WebService.class);
         if (webService == null) {
-            WebServiceProvider webServiceProvider = 
+            WebServiceProvider webServiceProvider =
                 (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
             if (webServiceProvider == null) {
                 throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
@@ -199,17 +200,17 @@ public class JAXWSUtils {
             return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
         }
     }
-        
+
     public static String getName(Class clazz) {
-        WebService webService = 
+        WebService webService =
             (WebService)clazz.getAnnotation(WebService.class);
         if (webService == null) {
-            WebServiceProvider webServiceProvider = 
+            WebServiceProvider webServiceProvider =
                 (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
             if (webServiceProvider == null) {
                 throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
-            } 
-            return clazz.getSimpleName();         
+            }
+            return clazz.getSimpleName();
         } else {
             String sei = webService.endpointInterface();
             if (sei == null || sei.trim().length() == 0) {
@@ -222,30 +223,30 @@ public class JAXWSUtils {
                     throw new RuntimeException("Unable to load SEI class: " + sei, e);
                 }
             }
-        }        
+        }
     }
-        
+
     private static String getNameFromSEI(Class seiClass) {
-        WebService webService = 
+        WebService webService =
             (WebService)seiClass.getAnnotation(WebService.class);
         if (webService == null) {
             throw new IllegalArgumentException("The " + seiClass.getName() + " is not annotated");
-        } 
+        }
         return getName(seiClass, webService.name());
     }
-    
+
     private static String getName(Class clazz, String name) {
         if (name == null || name.trim().length() == 0) {
             return clazz.getSimpleName();
         } else {
             return name.trim();
-        }  
+        }
     }
 
     private static String getWsdlLocation(Class clazz) {
-        WebService webService = (WebService) clazz.getAnnotation(WebService.class); 
+        WebService webService = (WebService) clazz.getAnnotation(WebService.class);
         if (webService == null) {
-            WebServiceProvider webServiceProvider = 
+            WebServiceProvider webServiceProvider =
                 (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
             if (webServiceProvider == null) { //no WebService or WebServiceProvider annotation
                 return "";
@@ -255,23 +256,23 @@ public class JAXWSUtils {
         } else {
             return webService.wsdlLocation().trim();
         }
-    } 
-    
+    }
+
     private static String getServiceInterface(Class clazz) {
-        WebService webService = (WebService) clazz.getAnnotation(WebService.class); 
+        WebService webService = (WebService) clazz.getAnnotation(WebService.class);
         if (webService == null) {
             //WebServiceProvider doesn't support endpointInterface property (JAX-WS 2.0 sec 7.7)
-            return "";  
+            return "";
         } else {
-            if (webService.endpointInterface() == null || webService.endpointInterface().trim().equals("")) {       
+            if (webService.endpointInterface() == null || webService.endpointInterface().trim().equals("")) {
                 return "";
             } else {
                 return webService.endpointInterface().trim();
             }
         }
     }
-    
-    public static String getServiceWsdlLocation(Class clazz, ClassLoader loader) {
+
+    public static String getServiceWsdlLocation(Class clazz, Bundle bundle) {
         String wsdlLocation = getWsdlLocation(clazz);
         if (wsdlLocation != null && !wsdlLocation.equals("")) {
             return wsdlLocation;
@@ -279,48 +280,48 @@ public class JAXWSUtils {
             String serviceInterfaceClassName = getServiceInterface(clazz);
             if (serviceInterfaceClassName != null && !serviceInterfaceClassName.equals("")) {
                 try {
-                    Class serviceInterfaceClass = loader.loadClass(serviceInterfaceClassName);
-                    return getWsdlLocation(serviceInterfaceClass);                    
+                    Class serviceInterfaceClass = bundle.loadClass(serviceInterfaceClassName);
+                    return getWsdlLocation(serviceInterfaceClass);
                 } catch (Exception e) {
                     return "";
                 }
-            } 
+            }
         }
-        return "";        
+        return "";
     }
-    
-    public static boolean containsWsdlLocation(Class clazz, ClassLoader loader) {
-        String wsdlLocSEIFromAnnotation = getServiceWsdlLocation(clazz, loader);
+
+    public static boolean containsWsdlLocation(Class clazz, Bundle bundle) {
+        String wsdlLocSEIFromAnnotation = getServiceWsdlLocation(clazz, bundle);
         if (wsdlLocSEIFromAnnotation != null && !wsdlLocSEIFromAnnotation.equals("")) {
             return true;
         } else {
             return false;
         }
     }
-    
-    public static String getBindingURIFromAnnot(Class clazz, ClassLoader loader) {
+
+    public static String getBindingURIFromAnnot(Class clazz) {
         BindingType bindingType = (BindingType) clazz.getAnnotation(BindingType.class);
         if (bindingType == null) {
-            return ""; 
+            return "";
         } else {
             return bindingType.value();
         }
     }
-    
-    public static URL getOASISCatalogURL(URL configurationBaseUrl, ClassLoader classLoader, String catalogName) {
+
+    public static URL getOASISCatalogURL(Bundle bundle, String catalogName) {
         if (catalogName == null) {
             return null;
         }
         LOG.debug("Checking for {} catalog in classloader", catalogName);
-        URL catalogURL = classLoader.getResource(catalogName);
-        if (catalogURL == null && configurationBaseUrl != null) {
+        URL catalogURL = bundle.getResource(catalogName);
+        if (catalogURL == null ) {
             try {
-                LOG.debug("Checking for {} catalog in module directory", catalogName);  
-                URL tmpCatalogURL = new URL(configurationBaseUrl, catalogName);
-                tmpCatalogURL.openStream().close();
-                catalogURL = tmpCatalogURL;
-            } catch (MalformedURLException e) {
-                LOG.warn("Error constructing catalog URL {} {}", configurationBaseUrl, catalogName);
+                LOG.debug("Checking for {} catalog in module directory", catalogName);
+                URL tmpCatalogURL = BundleUtils.getEntry(bundle, catalogName);
+                if (tmpCatalogURL != null) {
+                    tmpCatalogURL.openStream().close();
+                    catalogURL = tmpCatalogURL;
+                }
             } catch (FileNotFoundException e) {
                 LOG.debug("Catalog {} is not present in the module", catalogName);
             } catch (IOException e) {
@@ -329,5 +330,5 @@ public class JAXWSUtils {
         }
         return catalogURL;
     }
-    
+
 }

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/annotations/EJBAnnotationHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/annotations/EJBAnnotationHandler.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/annotations/EJBAnnotationHandler.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/annotations/EJBAnnotationHandler.java Tue May 25 03:26:52 2010
@@ -16,11 +16,12 @@
  */
 package org.apache.geronimo.jaxws.annotations;
 
-import javax.ejb.EJB;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
+import javax.ejb.EJB;
+
 public abstract class EJBAnnotationHandler extends InjectingAnnotationHandler {
 
     public Class<? extends Annotation> getAnnotationType() {

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java Tue May 25 03:26:52 2010
@@ -17,54 +17,54 @@
 
 package org.apache.geronimo.jaxws.client;
 
-import org.apache.geronimo.naming.reference.SimpleReference;
-import org.apache.geronimo.naming.reference.ClassLoaderAwareReference;
-import org.apache.geronimo.naming.reference.KernelAwareReference;
-import org.apache.geronimo.jaxws.JAXWSUtils;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.gbean.AbstractName;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.Map;
 
 import javax.naming.NamingException;
+import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.namespace.QName;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
 
 import net.sf.cglib.proxy.Callback;
-import net.sf.cglib.proxy.NoOp;
 import net.sf.cglib.proxy.Enhancer;
 import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.reflect.FastConstructor;
+import net.sf.cglib.proxy.NoOp;
 import net.sf.cglib.reflect.FastClass;
+import net.sf.cglib.reflect.FastConstructor;
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.jaxws.JAXWSUtils;
+import org.apache.geronimo.naming.reference.BundleAwareReference;
+import org.apache.geronimo.naming.reference.SimpleReference;
+import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
+import org.osgi.framework.Bundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class JAXWSServiceReference extends SimpleReference implements BundleAwareReference {
 
-public abstract class JAXWSServiceReference extends SimpleReference implements ClassLoaderAwareReference, KernelAwareReference {
-    
     private final static Logger LOG = LoggerFactory.getLogger(JAXWSServiceReference.class);
-    
+
     private static final Class[] URL_SERVICE_NAME_CONSTRUCTOR =
         new Class[] { URL.class, QName.class };
-    
+
     protected String serviceClassName;
-    protected ClassLoader classLoader;
+    protected Bundle bundle;
     protected AbstractName moduleName;
     protected URI wsdlURI;
     protected QName serviceQName;
-    private Kernel kernel;
     protected String handlerChainsXML;
     protected Map<Object, EndpointInfo> seiInfoMap;
     protected String referenceClassName;
-    
+
     protected Class enhancedServiceClass;
     protected Callback[] methodInterceptors;
     protected FastConstructor serviceConstructor;
-    
-    protected transient URL moduleBaseUrl;
+
 
     public JAXWSServiceReference(String handlerChainsXML, Map<Object, EndpointInfo> seiInfoMap, AbstractName name, QName serviceQName, URI wsdlURI, String referenceClassName, String serviceClassName) {
         this.handlerChainsXML = handlerChainsXML;
@@ -75,27 +75,14 @@ public abstract class JAXWSServiceRefere
         this.referenceClassName = referenceClassName;
         this.serviceClassName = serviceClassName;
     }
-    
-    public void setClassLoader(ClassLoader classLoader) {
-        this.classLoader = classLoader;
-    }
 
-    public void setKernel(Kernel kernel) {
-        this.kernel = kernel;
-        init();
+    public void setBundle(Bundle bundle) {
+        this.bundle = bundle;
     }
 
-    private void init() {
-        try {
-            this.moduleBaseUrl = (URL) this.kernel.getAttribute(this.moduleName, "configurationBaseUrl");
-        } catch (Exception e) {
-            // ignore
-        }
-    }
-    
     private Class loadClass(String name) throws NamingException {
         try {
-            return this.classLoader.loadClass(name);
+            return bundle.loadClass(name);
         } catch (ClassNotFoundException e) {
             NamingException exception = new NamingException(
                     "Count not load class " + name);
@@ -108,41 +95,34 @@ public abstract class JAXWSServiceRefere
         if (this.wsdlURI == null) {
             return null;
         }
-        
+
         URL wsdlURL = null;
         try {
             wsdlURL = new URL(this.wsdlURI.toString());
         } catch (MalformedURLException e1) {
-            // not a URL, assume it's a local reference
-            
-            if (this.moduleBaseUrl != null) {
-                try {
-                    wsdlURL = new URL(this.moduleBaseUrl.toString() + this.wsdlURI.toString());
-                } catch (Exception e) {
-                    // ignore
-                }
-            }
-            
             if (wsdlURL == null) {
-                wsdlURL = this.classLoader.getResource(this.wsdlURI.toString());
+                wsdlURL = bundle.getResource(this.wsdlURI.toString());
+                if (wsdlURL == null) {
+                    wsdlURL = BundleUtils.getEntry(bundle, wsdlURI.toString());
+                }
                 if (wsdlURL == null) {
                     LOG.warn("Failed to obtain WSDL: " + this.wsdlURI);
                 }
                 return wsdlURL;
             }
         }
-        
+
         return wsdlURL;
     }
 
     protected URL getCatalog() {
-        URL catalogURL = JAXWSUtils.getOASISCatalogURL(this.moduleBaseUrl, this.classLoader, JAXWSUtils.DEFAULT_CATALOG_WEB);
+        URL catalogURL = JAXWSUtils.getOASISCatalogURL(bundle, JAXWSUtils.DEFAULT_CATALOG_WEB);
         if (catalogURL == null) {
-            catalogURL = JAXWSUtils.getOASISCatalogURL(this.moduleBaseUrl, this.classLoader, JAXWSUtils.DEFAULT_CATALOG_EJB);
+            catalogURL = JAXWSUtils.getOASISCatalogURL(bundle, JAXWSUtils.DEFAULT_CATALOG_EJB);
         }
         return catalogURL;
     }
-    
+
     private Class getReferenceClass() throws NamingException {
         return (this.referenceClassName != null) ? loadClass(this.referenceClassName) : null;
     }
@@ -150,19 +130,19 @@ public abstract class JAXWSServiceRefere
     public Object getContent() throws NamingException {
         Service instance = null;
         URL wsdlURL = getWsdlURL();
-        
+
         Class serviceClass = loadClass(this.serviceClassName);
-        Class referenceClass = getReferenceClass();              
-        
+        Class referenceClass = getReferenceClass();
+
         if (referenceClass != null && Service.class.isAssignableFrom(referenceClass)) {
             serviceClass = referenceClass;
         }
-                
+
         if (Service.class.equals(serviceClass)) {
             serviceClass = GenericService.class;
         }
 
-        instance = createServiceProxy(serviceClass, this.classLoader, this.serviceQName, wsdlURL);
+        instance = createServiceProxy(serviceClass, bundle, this.serviceQName, wsdlURL);
 
         HandlerResolver handlerResolver = getHandlerResolver(serviceClass);
         if(handlerResolver != null) {
@@ -183,35 +163,35 @@ public abstract class JAXWSServiceRefere
     protected PortMethodInterceptor getPortMethodInterceptor() {
         return new PortMethodInterceptor(this.seiInfoMap);
     }
-    
-    private Service createServiceProxy(Class superClass, ClassLoader classLoader, QName serviceName, URL wsdlLocation) throws NamingException {
-        if (this.serviceConstructor == null) {            
+
+    private Service createServiceProxy(Class superClass, Bundle bundle, QName serviceName, URL wsdlLocation) throws NamingException {
+        if (this.serviceConstructor == null) {
             // create method interceptors
             Callback callback = getPortMethodInterceptor();
             this.methodInterceptors = new Callback[] {NoOp.INSTANCE, callback};
 
             // create service class
             Enhancer enhancer = new Enhancer();
-            enhancer.setClassLoader(classLoader);
+            enhancer.setClassLoader(new BundleClassLoader(bundle));
             enhancer.setSuperclass(superClass);
             enhancer.setCallbackFilter(new PortMethodFilter());
             enhancer.setCallbackTypes(new Class[] { NoOp.class, MethodInterceptor.class });
             enhancer.setUseFactory(false);
             enhancer.setUseCache(false);
-            this.enhancedServiceClass = enhancer.createClass(); 
+            this.enhancedServiceClass = enhancer.createClass();
 
             // get constructor
-            this.serviceConstructor = 
+            this.serviceConstructor =
                 FastClass.create(this.enhancedServiceClass).getConstructor(URL_SERVICE_NAME_CONSTRUCTOR);
         }
-        
+
         LOG.debug("Initializing service with: " + wsdlLocation + " " + serviceName);
 
         // associate the method interceptors with the generated service class on the current thread
         Enhancer.registerCallbacks(this.enhancedServiceClass, this.methodInterceptors);
-        
+
         Object[] arguments = new Object[] {wsdlLocation, serviceName};
-        
+
         try {
             return (Service)this.serviceConstructor.newInstance(arguments);
         } catch (InvocationTargetException e) {

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java Tue May 25 03:26:52 2010
@@ -17,46 +17,49 @@
 
 package org.apache.geronimo.jaxws.handler;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.geronimo.jaxws.JAXWSUtils;
-import org.apache.geronimo.xbeans.javaee.HandlerChainType;
-import org.apache.xmlbeans.XmlCursor;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.PortInfo;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.PortInfo;
+
+import org.apache.geronimo.jaxws.JAXWSUtils;
+import org.apache.geronimo.xbeans.javaee.HandlerChainType;
+import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
+import org.apache.xmlbeans.XmlCursor;
+import org.osgi.framework.Bundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * @version $Rev$ $Date$
  */
 public class GeronimoHandlerChainBuilder extends AnnotationHandlerChainBuilder {
     private static final Logger log = LoggerFactory.getLogger(GeronimoHandlerChainBuilder.class);
 
-    private ClassLoader classLoader = null;
+    private Bundle bundle = null;
     private PortInfo portInfo;
 
-    public GeronimoHandlerChainBuilder(ClassLoader classloader,
+    public GeronimoHandlerChainBuilder(Bundle bundle,
                                        PortInfo portInfo) {
-        this.classLoader = classloader;
+        this.bundle = bundle;
         this.portInfo = portInfo;
     }
 
-    public ClassLoader getHandlerClassLoader() {
-        return this.classLoader;
+    public Bundle getHandlerBundle() {
+        return bundle;
     }
 
     protected List<Handler> buildHandlerChain(HandlerChainType hc,
-                                              ClassLoader classLoader) {
+                                              Bundle bundle) {
         if (matchServiceName(portInfo, hc)
                 && matchPortName(portInfo, hc)
                 && matchBinding(portInfo, hc)) {
-            return super.buildHandlerChain(hc, classLoader);
+            return super.buildHandlerChain(hc, new BundleClassLoader(bundle));
         } else {
             return Collections.emptyList();
         }
@@ -111,7 +114,7 @@ public class GeronimoHandlerChainBuilder
         if (null == hc) {
             return null;
         }
-        return sortHandlers(buildHandlerChain(hc, getHandlerClassLoader()));
+        return sortHandlers(buildHandlerChain(hc, getHandlerBundle()));
     }
 
     /*

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java Tue May 25 03:26:52 2010
@@ -26,9 +26,9 @@ import javax.xml.ws.handler.HandlerResol
 
 import org.apache.geronimo.jaxws.annotations.AnnotationException;
 import org.apache.geronimo.jaxws.annotations.AnnotationProcessor;
-import org.apache.geronimo.jaxws.handler.GeronimoHandlerChainBuilder;
 import org.apache.geronimo.xbeans.javaee.HandlerChainType;
 import org.apache.geronimo.xbeans.javaee.HandlerChainsType;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev$ $Date$
@@ -37,17 +37,17 @@ public class GeronimoHandlerResolver imp
 
     private HandlerChainsType handlerChains;
 
-    private ClassLoader classLoader;
+    private Bundle bundle;
 
     private Class serviceClass;
 
     private AnnotationProcessor annotationProcessor;
 
-    public GeronimoHandlerResolver(ClassLoader classLoader,
+    public GeronimoHandlerResolver(Bundle bundle,
                                    Class serviceClass,
                                    HandlerChainsType handlerChains,
                                    AnnotationProcessor annotationProcessor) {
-        this.classLoader = classLoader;
+        this.bundle = bundle;
         this.serviceClass = serviceClass;
         this.handlerChains = handlerChains;
         this.annotationProcessor = annotationProcessor;
@@ -56,7 +56,7 @@ public class GeronimoHandlerResolver imp
     public List<Handler> getHandlerChain(javax.xml.ws.handler.PortInfo portInfo) {
 
         GeronimoHandlerChainBuilder builder =
-                new GeronimoHandlerChainBuilder(this.classLoader, portInfo);
+                new GeronimoHandlerChainBuilder(bundle, portInfo);
 
         List<Handler> handlers = null;
         if (this.handlerChains == null) {

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java Tue May 25 03:26:52 2010
@@ -16,15 +16,17 @@
  */
 package org.apache.geronimo.jaxws.handler;
 
-import org.apache.geronimo.testsupport.TestSupport;
-import org.apache.geronimo.xbeans.javaee.HandlerChainsDocument;
-import org.apache.geronimo.xbeans.javaee.HandlerChainsType;
+import java.io.InputStream;
+import java.util.List;
 
 import javax.xml.namespace.QName;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.handler.PortInfo;
-import java.io.InputStream;
-import java.util.List;
+
+import org.apache.geronimo.kernel.osgi.MockBundle;
+import org.apache.geronimo.testsupport.TestSupport;
+import org.apache.geronimo.xbeans.javaee.HandlerChainsDocument;
+import org.apache.geronimo.xbeans.javaee.HandlerChainsType;
 
 public class GeronimoHandlerResolverTest extends TestSupport {
 
@@ -34,8 +36,7 @@ public class GeronimoHandlerResolverTest
         HandlerChainsType handlerChains = toHandlerChains(in);
         assertEquals(3, handlerChains.getHandlerChainArray().length);
 
-        GeronimoHandlerResolver resolver =
-            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
+        GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
 
         List<Handler> handlers = null;
 
@@ -49,8 +50,7 @@ public class GeronimoHandlerResolverTest
         HandlerChainsType handlerChains = toHandlerChains(in);
         assertEquals(4, handlerChains.getHandlerChainArray().length);
 
-        GeronimoHandlerResolver resolver =
-            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
+        GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
 
         List<Handler> handlers = null;
 
@@ -84,9 +84,7 @@ public class GeronimoHandlerResolverTest
         HandlerChainsType handlerChains = toHandlerChains(in);
         assertEquals(4, handlerChains.getHandlerChainArray().length);
 
-        GeronimoHandlerResolver resolver =
-            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
-
+        GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
         List<Handler> handlers = null;
 
         handlers = resolver.getHandlerChain(new TestPortInfo(null, null, null));
@@ -117,8 +115,7 @@ public class GeronimoHandlerResolverTest
         HandlerChainsType handlerChains = toHandlerChains(in);
         assertEquals(4, handlerChains.getHandlerChainArray().length);
 
-        GeronimoHandlerResolver resolver =
-            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
+        GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
 
         List<Handler> handlers = null;
 
@@ -152,8 +149,7 @@ public class GeronimoHandlerResolverTest
         HandlerChainsType handlerChains = toHandlerChains(in);
         assertEquals(3, handlerChains.getHandlerChainArray().length);
 
-        GeronimoHandlerResolver resolver =
-            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
+        GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
 
         List<Handler> handlers = null;
 

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java Tue May 25 03:26:52 2010
@@ -146,6 +146,7 @@ public class AbstractWebModuleTest exten
                 transactionManager,
                 null,
                 cl,
+                null,
                 null);
         WebAppContextWrapper app = new WebAppContextWrapper(null,
                 contextPath,

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/main/java/org/apache/geronimo/openejb/cluster/stateful/deployment/ClusteredStatefulDeployment.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/main/java/org/apache/geronimo/openejb/cluster/stateful/deployment/ClusteredStatefulDeployment.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/main/java/org/apache/geronimo/openejb/cluster/stateful/deployment/ClusteredStatefulDeployment.java (original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/main/java/org/apache/geronimo/openejb/cluster/stateful/deployment/ClusteredStatefulDeployment.java Tue May 25 03:26:52 2010
@@ -40,6 +40,7 @@ import org.apache.geronimo.security.jacc
 import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
 import org.apache.openejb.Container;
 import org.apache.openejb.core.CoreDeploymentInfo;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev:$ $Date:$
@@ -59,6 +60,7 @@ public class ClusteredStatefulDeployment
                          @ParamAttribute(name = "serviceEndpointInterfaceName") String serviceEndpointInterfaceName,
                          @ParamAttribute(name = "beanClassName") String beanClassName,
                          @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader classLoader,
+                         @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle,
                          @ParamAttribute(name = "securityEnabled") boolean securityEnabled,
                          @ParamAttribute(name = "defaultRole") String defaultRole,
                          @ParamAttribute(name = "runAsRole") String runAsRole,
@@ -83,6 +85,7 @@ public class ClusteredStatefulDeployment
                 serviceEndpointInterfaceName,
                 beanClassName,
                 classLoader,
+                bundle,
                 securityEnabled,
                 defaultRole,
                 runAsRole,

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java (original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java Tue May 25 03:26:52 2010
@@ -18,7 +18,6 @@
 package org.apache.geronimo.openejb;
 
 import java.lang.reflect.Method;
-import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicReference;
@@ -49,8 +48,8 @@ import org.apache.openejb.InterfaceType;
 import org.apache.openejb.core.CoreDeploymentInfo;
 import org.apache.openejb.core.ivm.EjbObjectProxyHandler;
 import org.apache.openejb.core.transaction.TransactionType;
-import org.apache.xbean.naming.context.ContextFederation;
 import org.apache.xbean.naming.context.ImmutableFederatedContext;
+import org.osgi.framework.Bundle;
 
 public class EjbDeployment implements EJB, EjbDeploymentIdAccessor {
     private final String objectName;
@@ -64,7 +63,7 @@ public class EjbDeployment implements EJ
     private final String serviceEndpointInterfaceName;
     private final String beanClassName;
     private final ClassLoader classLoader;
-
+    private final Bundle bundle;
     private final boolean securityEnabled;
     private final Subject defaultSubject;
     private final Subject runAs;
@@ -93,6 +92,7 @@ public class EjbDeployment implements EJ
                          @ParamAttribute(name = "serviceEndpointInterfaceName") String serviceEndpointInterfaceName,
                          @ParamAttribute(name = "beanClassName") String beanClassName,
                          @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader classLoader,
+                         @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle,
                          @ParamAttribute(name = "securityEnabled") boolean securityEnabled,
                          @ParamAttribute(name = "defaultRole") String defaultRole,
                          @ParamAttribute(name = "runAsRole") String runAsRole,
@@ -116,14 +116,15 @@ public class EjbDeployment implements EJ
         this.serviceEndpointInterfaceName = serviceEndpointInterfaceName;
         this.beanClassName = beanClassName;
         this.classLoader = classLoader;
+        this.bundle = bundle;
         this.securityEnabled = securityEnabled;
         if (runAsSource == null) {
             runAsSource = RunAsSource.NULL;
         }
         this.defaultSubject = defaultRole == null ? runAsSource.getDefaultSubject() : runAsSource.getSubjectForRole(defaultRole);
         this.runAs = runAsSource.getSubjectForRole(runAsRole);
-        this.componentContext = EnterpriseNamingContext.livenReferences(compContext, transactionManager, kernel, classLoader, "comp/");
-        this.moduleContext = EnterpriseNamingContext.livenReferences(moduleJndi, transactionManager, kernel, classLoader, "module/");
+        this.componentContext = EnterpriseNamingContext.livenReferences(compContext, transactionManager, kernel, classLoader, bundle, "comp/");
+        this.moduleContext = EnterpriseNamingContext.livenReferences(moduleJndi, transactionManager, kernel, classLoader, bundle, "module/");
         this.applicationContext = applicationJndi.getApplicationContext();
         this.globalContext = applicationJndi.getGlobalContext();
         this.unshareableResources = unshareableResources;

Modified: geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml Tue May 25 03:26:52 2010
@@ -122,11 +122,6 @@
         <type>jar</type>
     </dependency>
     <dependency>
-        <groupId>org.apache.xbean</groupId>
-        <artifactId>xbean-bundleutils</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
         <groupId>org.apache.yoko</groupId>
         <artifactId>yoko-spec-corba</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=947901&r1=947900&r2=947901&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java Tue May 25 03:26:52 2010
@@ -90,7 +90,7 @@ public abstract class AbstractWebModuleT
                 transactionManager,
                 null,
                 cl,
- //               null,
+               null,
                 null);
         Map<String, Object> deploymentAttributes = new HashMap<String, Object>();
         deploymentAttributes.put(WebAttributeName.META_COMPLETE.name(), Boolean.TRUE);