geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1078791 - in /geronimo/server/trunk/plugins: axis2/ axis2/axis2/ axis2/axis2/src/main/plan/ axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/ axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/...
Date Mon, 07 Mar 2011 14:49:12 GMT
Author: xuhaihong
Date: Mon Mar  7 14:49:12 2011
New Revision: 1078791

URL: http://svn.apache.org/viewvc?rev=1078791&view=rev
Log:
Use BundleListener Axis2ModuleRegistry to configure available Axis2 Modules, while we searched
in the classpath in the past

Added:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/Axis2ModuleRegistry.java
  (with props)
Modified:
    geronimo/server/trunk/plugins/axis2/axis2/pom.xml
    geronimo/server/trunk/plugins/axis2/axis2/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceContainer.java
  (contents, props changed)
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceGBean.java
  (contents, props changed)
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/pom.xml
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoConfigurator.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainerFactoryGBean.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java
    geronimo/server/trunk/plugins/axis2/pom.xml
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-sun-tools/src/main/java/org/apache/geronimo/jaxws/sun/tools/WsdlGenerator.java
    geronimo/server/trunk/plugins/jaxws/pom.xml

Modified: geronimo/server/trunk/plugins/axis2/axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/axis2/pom.xml?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/axis2/pom.xml (original)
+++ geronimo/server/trunk/plugins/axis2/axis2/pom.xml Mon Mar  7 14:49:12 2011
@@ -98,12 +98,17 @@
 
         <dependency>
             <groupId>org.apache.geronimo.bundles</groupId>
+            <artifactId>axis2-saaj</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.bundles</groupId>
             <artifactId>httpcore</artifactId>
         </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.bundles</groupId>
-            <artifactId>axiom-api</artifactId>
+            <artifactId>axiom-api</artifactId>                
         </dependency>
 
         <dependency>
@@ -185,6 +190,11 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
         </dependency>
+        
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

Modified: geronimo/server/trunk/plugins/axis2/axis2/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/axis2/src/main/plan/plan.xml?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/axis2/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/axis2/axis2/src/main/plan/plan.xml Mon Mar  7 14:49:12 2011
@@ -19,5 +19,5 @@
 <!-- $Rev$ $Date$ -->
 
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
-
+    <gbean name="Axis2ModuleRegistry" class="org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry"/>
 </module>

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
Mon Mar  7 14:49:12 2011
@@ -26,9 +26,12 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.xml.bind.JAXBException;
+
+import org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry;
 import org.apache.geronimo.axis2.pojo.POJOWebServiceContainerFactoryGBean;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.Deployable;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -68,7 +71,7 @@ public class Axis2Builder extends JAXWSS
     private GBeanInfo defaultContainerFactoryGBeanInfo;
 
     public Axis2Builder(@ParamAttribute(name = "defaultEnvironment")Environment defaultEnviroment,
-                        @ParamReference(name="WsdlGenerator", namingType = GBeanInfoBuilder.DEFAULT_J2EE_TYPE)Collection<WsdlGenerator>
wsdlGenerators) {
+                                        @ParamReference(name="WsdlGenerator", namingType
= GBeanInfoBuilder.DEFAULT_J2EE_TYPE)Collection<WsdlGenerator> wsdlGenerators) {
         super(defaultEnviroment);
         this.wsdlGenerators = wsdlGenerators;
         this.webServiceFinder = new WARWebServiceFinder();
@@ -200,6 +203,7 @@ public class Axis2Builder extends JAXWSS
 
     @Override
     protected void initialize(GBeanData targetGBean, Class serviceClass, PortInfo portInfo,
Module module, Bundle bundle) throws DeploymentException {
+        targetGBean.setReferencePattern("axis2ModuleRegistry", new AbstractNameQuery(Axis2ModuleRegistry.class.getName()));
         String serviceName = (portInfo.getServiceName() == null ? serviceClass.getName()
: portInfo.getServiceName());
         if(portInfo.getWsdlFile() != null && !portInfo.getWsdlFile().trim().equals(""))
{
             if (log.isDebugEnabled()) {

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
Mon Mar  7 14:49:12 2011
@@ -22,12 +22,12 @@ import java.util.Map;
 
 import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
+
 import org.apache.geronimo.axis2.client.Axis2ConfigGBean;
 import org.apache.geronimo.axis2.client.Axis2ServiceReference;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
@@ -40,7 +40,6 @@ import org.apache.geronimo.jaxws.client.
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.naming.deployment.ServiceRefBuilder;
 import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
 import org.apache.openejb.jee.PortComponentRef;
 import org.apache.openejb.jee.ServiceRef;

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceContainer.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceContainer.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceContainer.java
Mon Mar  7 14:49:12 2011
@@ -27,6 +27,7 @@ import org.apache.axis2.jaxws.server.end
 import org.apache.geronimo.axis2.Axis2WebServiceContainer;
 import org.apache.geronimo.axis2.AxisServiceGenerator;
 import org.apache.geronimo.axis2.GeronimoFactoryRegistry;
+import org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry;
 import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
 import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.JNDIResolver;
@@ -45,8 +46,9 @@ public class EJBWebServiceContainer exte
                                   String endpointClassName,
                                   Bundle bundle,
                                   Context context,
+                                  Axis2ModuleRegistry axis2ModuleRegistry,
                                   BeanContext deploymnetInfo) {
-        super(portInfo, endpointClassName, bundle, context);
+        super(portInfo, endpointClassName, bundle, context, axis2ModuleRegistry);
         this.deploymnetInfo = deploymnetInfo;
     }
 

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceContainer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceContainer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceGBean.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceGBean.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceGBean.java
Mon Mar  7 14:49:12 2011
@@ -22,6 +22,7 @@ import java.util.Properties;
 
 import javax.naming.Context;
 
+import org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
@@ -49,6 +50,7 @@ public class EJBWebServiceGBean implemen
     private EJBWebServiceContainer container;
 
     public EJBWebServiceGBean(@ParamReference(name="EjbDeployment")EjbDeployment ejbDeploymentContext,
+                              @ParamReference(name="Axis2ModuleRegistry")Axis2ModuleRegistry
axis2ModuleRegistry,
                               @ParamAttribute(name="portInfo")PortInfo portInfo,
                               @ParamSpecial(type = SpecialAttributeType.kernel)Kernel kernel,
                               @ParamSpecial(type = SpecialAttributeType.bundle)Bundle bundle,
@@ -74,7 +76,7 @@ public class EJBWebServiceGBean implemen
         BeanContext deploymnetInfo = ejbDeploymentContext.getDeploymentInfo();
         Context context = deploymnetInfo.getJndiEnc();
 
-        this.container = new EJBWebServiceContainer(portInfo, beanClassName, bundle, context,
deploymnetInfo);
+        this.container = new EJBWebServiceContainer(portInfo, beanClassName, bundle, context,
axis2ModuleRegistry, deploymnetInfo);
         this.container.init();
 
         soapHandler.addWebService(this.location,

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBWebServiceGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/pom.xml?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/pom.xml (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/pom.xml Mon Mar  7 14:49:12 2011
@@ -71,7 +71,12 @@
 
         <dependency>
             <groupId>org.apache.geronimo.bundles</groupId>
-            <artifactId>axis2</artifactId>        
+            <artifactId>axis2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.bundles</groupId>
+            <artifactId>axis2-saaj</artifactId>
         </dependency>
 
         <dependency>

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
Mon Mar  7 14:49:12 2011
@@ -18,11 +18,14 @@
 package org.apache.geronimo.axis2;
 
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
 import java.io.PrintWriter;
 import java.net.HttpURLConnection;
 import java.net.URI;
 import java.net.URL;
+import java.util.Dictionary;
 import java.util.List;
+import java.util.Map;
 
 import javax.naming.Context;
 import javax.servlet.ServletContext;
@@ -42,10 +45,15 @@ import org.apache.axis2.context.Configur
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.deployment.DeploymentEngine;
+import org.apache.axis2.deployment.ModuleBuilder;
+import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.description.TransportOutDescription;
+import org.apache.axis2.description.Version;
+import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.engine.Handler.InvocationResponse;
 import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
@@ -61,6 +69,8 @@ import org.apache.axis2.jaxws.handler.li
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
 import org.apache.axis2.jaxws.server.JAXWSMessageReceiver;
 import org.apache.axis2.jaxws.server.endpoint.lifecycle.factory.EndpointLifecycleManagerFactory;
+import org.apache.axis2.modules.Module;
+import org.apache.axis2.osgi.deployment.Registry;
 import org.apache.axis2.transport.OutTransportInfo;
 import org.apache.axis2.transport.RequestResponseTransport;
 import org.apache.axis2.transport.http.HTTPConstants;
@@ -69,7 +79,9 @@ import org.apache.axis2.transport.http.H
 import org.apache.axis2.transport.http.TransportHeaders;
 import org.apache.axis2.transport.http.util.RESTUtil;
 import org.apache.axis2.util.MessageContextBuilder;
+import org.apache.axis2.util.Utils;
 import org.apache.geronimo.axis2.client.Axis2ConfigGBean;
+import org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry;
 import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
 import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.JNDIResolver;
@@ -107,16 +119,19 @@ public abstract class Axis2WebServiceCon
     protected Context context;
     protected String address;
     protected GeronimoFactoryRegistry factoryRegistry;
+    protected Axis2ModuleRegistry axis2ModuleRegistry;
 
     public Axis2WebServiceContainer(PortInfo portInfo,
                                     String endpointClassName,
                                     Bundle bundle,
-                                    Context context) {
+                                    Context context,
+                                    Axis2ModuleRegistry axis2ModuleRegistry) {
         this.endpointClassName = endpointClassName;
         this.portInfo = portInfo;
         this.bundle = bundle;
         this.context = context;
         this.jndiResolver = new ServerJNDIResolver(context);
+        this.axis2ModuleRegistry = axis2ModuleRegistry;
     }
 
     public void init() throws Exception {
@@ -127,6 +142,7 @@ public abstract class Axis2WebServiceCon
         GeronimoConfigurator configurator = new GeronimoConfigurator("META-INF/geronimo-axis2.xml");
         configurationContext = ConfigurationContextFactory.createConfigurationContext(configurator);
 
+        configureModules(configurationContext);
         // check to see if the wsdlLocation property is set in portInfo,
         // if not checking if wsdlLocation exists in annotation
         // if already set, annotation should not overwrite it.
@@ -506,6 +522,59 @@ public abstract class Axis2WebServiceCon
         DescriptionUtils.registerHandlerHeaders(desc.getAxisService(), this.binding.getHandlerChain());
     }
 
+    protected void configureModules(ConfigurationContext configurationContext) {
+        for (Map.Entry<Bundle, List<URL>> entry : axis2ModuleRegistry.getBundleModuleXmlURLsMap().entrySet())
{
+            Bundle bundle = entry.getKey();
+            for (URL url : entry.getValue()) {
+                try {
+                    AxisModule axismodule = new AxisModule();
+                    ClassLoader loader = new org.apache.axis2.osgi.deployment.BundleClassLoader(bundle,
Registry.class.getClassLoader());
+                    axismodule.setModuleClassLoader(loader);
+                    AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
+                    ModuleBuilder builder = new ModuleBuilder(url.openStream(), axismodule,
axisConfig);
+                    Dictionary headers = bundle.getHeaders();
+                    String bundleSymbolicName = (String) headers.get("Bundle-SymbolicName");
+                    if (bundleSymbolicName != null && bundleSymbolicName.length()
!= 0) {
+                        axismodule.setName(bundleSymbolicName);
+                    }
+                    String bundleVersion = (String) headers.get("Bundle-Version");
+                    if (bundleVersion != null && bundleVersion.length() != 0) {
+                        /*
+                            Bundle version is defined as
+                            version ::=
+                                major( '.' minor ( '.' micro ( '.' qualifier )? )? )?
+                                major ::= number
+                                minor ::= number
+                                micro ::= number
+                                qualifier ::= ( alphanum | ’_’ | '-' )+
+                         */
+                        String[] versionSplit = bundleVersion.split("\\.");
+                        int[] components = new int[Math.min(versionSplit.length, 3)];
+                        for (int i = 0; i < components.length; i++) {
+                            components[i] = Integer.parseInt(versionSplit[i]);
+                        }
+                        axismodule.setVersion(new Version(components, versionSplit.length
> 3 ? versionSplit[3] : null));
+                    }
+                    builder.populateModule();
+                    axismodule.setParent(axisConfig);
+                    AxisModule module = axisConfig.getModule(axismodule.getName());
+                    if (module == null) {
+                        DeploymentEngine.addNewModule(axismodule, axisConfig);
+                        //initialze the module if the module contains Module interface.
+                        Module moduleObj = axismodule.getModule();
+                        if (moduleObj != null) {
+                            moduleObj.init(configurationContext, axismodule);
+                        }
+                    }
+                    // set in default map if necessary
+                    Utils.calculateDefaultModuleVersion(axisConfig.getModules(), axisConfig);
+                } catch (IOException e) {
+                    LOG.error("Error while reading module.xml", e);
+                }
+            }
+        }
+    }
+
     private void logHandlers(HandlerChainsType handlerChains) {
         if (handlerChains == null || handlerChains.getHandlerChain() == null
             || handlerChains.getHandlerChain().isEmpty()) {

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoConfigurator.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoConfigurator.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoConfigurator.java
Mon Mar  7 14:49:12 2011
@@ -20,7 +20,6 @@
 package org.apache.geronimo.axis2;
 
 import java.io.InputStream;
-
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.engine.AxisConfiguration;
@@ -41,9 +40,9 @@ public class GeronimoConfigurator extend
             throw new AxisFault("Unable to find configuration: " + this.resourceName);
         }
         this.axisConfig = populateAxisConfiguration(configStream);
-      
+
         loadFromClassPath();
-        
+
         this.axisConfig.setConfigurator(this);
         return this.axisConfig;
     }

Added: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/Axis2ModuleRegistry.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/Axis2ModuleRegistry.java?rev=1078791&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/Axis2ModuleRegistry.java
(added)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/Axis2ModuleRegistry.java
Mon Mar  7 14:49:12 2011
@@ -0,0 +1,104 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.axis2.osgi;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.OsgiService;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@GBean
+@OsgiService
+public class Axis2ModuleRegistry implements BundleListener, GBeanLifecycle {
+
+    private BundleContext bundleContext;
+
+    private final Map<Bundle, List<URL>> bundleModuleXmlURLsMap = new HashMap<Bundle,
List<URL>>();
+
+    public Axis2ModuleRegistry(@ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext
bundleContext) {
+        this.bundleContext = bundleContext;
+    }
+
+    @Override
+    public void doFail() {
+        try {
+            doStop();
+        } catch (Exception e) {
+        }
+
+    }
+
+    @Override
+    public void bundleChanged(BundleEvent event) {
+        Bundle bundle = event.getBundle();
+        int bundleState = bundle.getState();
+        if (bundleState == Bundle.ACTIVE) {
+            addModuleXmlBundle(bundle);
+        } else if (bundleState == Bundle.STOPPING) {
+            bundleModuleXmlURLsMap.remove(bundle);
+        }
+    }
+
+    @Override
+    public void doStart() throws Exception {
+        for (Bundle bundle : bundleContext.getBundles()) {
+            if (bundle.getState() == Bundle.ACTIVE) {
+                addModuleXmlBundle(bundle);
+            }
+        }
+        bundleContext.addBundleListener(this);
+    }
+
+    @Override
+    public void doStop() throws Exception {
+        bundleContext.removeBundleListener(this);
+        bundleModuleXmlURLsMap.clear();
+    }
+
+    public Map<Bundle, List<URL>> getBundleModuleXmlURLsMap() {
+        return new HashMap<Bundle, List<URL>>(bundleModuleXmlURLsMap);
+    }
+
+    private void addModuleXmlBundle(Bundle bundle) {
+        Enumeration<URL> enumeration = bundle.findEntries("META-INF", "*module.xml",
false);
+        if (enumeration == null) {
+            return;
+        }
+        List<URL> moduleXmls = new ArrayList<URL>();
+        while (enumeration.hasMoreElements()) {
+            moduleXmls.add(enumeration.nextElement());
+        }
+        bundleModuleXmlURLsMap.put(bundle, moduleXmls);
+    }
+
+}

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/Axis2ModuleRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/Axis2ModuleRegistry.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/Axis2ModuleRegistry.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
Mon Mar  7 14:49:12 2011
@@ -38,6 +38,7 @@ import org.apache.axis2.transport.http.u
 import org.apache.geronimo.axis2.Axis2WebServiceContainer;
 import org.apache.geronimo.axis2.AxisServiceGenerator;
 import org.apache.geronimo.axis2.GeronimoFactoryRegistry;
+import org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry;
 import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
 import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.PortInfo;
@@ -61,9 +62,10 @@ public class POJOWebServiceContainer ext
                                    String endpointClassName,
                                    Bundle bundle,
                                    Context context,
+                                   Axis2ModuleRegistry axis2ModuleRegistry,
                                    AnnotationHolder holder,
                                    String contextRoot) {
-        super(portInfo, endpointClassName, bundle, context);
+        super(portInfo, endpointClassName, bundle, context, axis2ModuleRegistry);
         this.holder = holder;
         this.contextRoot = contextRoot;
     }

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainerFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainerFactoryGBean.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainerFactoryGBean.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainerFactoryGBean.java
Mon Mar  7 14:49:12 2011
@@ -23,6 +23,7 @@ import javax.naming.Context;
 import javax.naming.NamingException;
 import javax.transaction.TransactionManager;
 
+import org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.gbean.annotation.ParamReference;
@@ -55,6 +56,7 @@ public class POJOWebServiceContainerFact
     private AnnotationHolder holder;
     private String contextRoot;
     private Bundle bundle;
+    private Axis2ModuleRegistry axis2ModuleRegistry;
 
     public POJOWebServiceContainerFactoryGBean(
                         @ParamAttribute(name="portInfo") org.apache.geronimo.jaxws.PortInfo
portInfo,
@@ -63,6 +65,7 @@ public class POJOWebServiceContainerFact
                         @ParamReference(name="TransactionManager", namingType=NameFactory.JTA_RESOURCE)
TransactionManager transactionManager,
                         @ParamAttribute(name="holder") AnnotationHolder holder,
                         @ParamAttribute(name="contextRoot") String contextRoot,
+                        @ParamReference(name="axis2ModuleRegistry") Axis2ModuleRegistry axis2ModuleRegistry,
                         @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel,
                         @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle,
                         @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader
classLoader)
@@ -87,10 +90,11 @@ public class POJOWebServiceContainerFact
         this.endpointClassName = endpointClassName;
         this.holder = holder;
         this.contextRoot = contextRoot;
+        this.axis2ModuleRegistry = axis2ModuleRegistry;
     }
 
     public WebServiceContainer getWebServiceContainer() {
-        POJOWebServiceContainer container = new POJOWebServiceContainer(portInfo, endpointClassName,
bundle, context, holder, contextRoot);
+        POJOWebServiceContainer container = new POJOWebServiceContainer(portInfo, endpointClassName,
bundle, context, axis2ModuleRegistry, holder, contextRoot);
         try {
             container.init();
         } catch (Exception e) {

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java
Mon Mar  7 14:49:12 2011
@@ -26,12 +26,14 @@ import java.util.HashMap;
 
 import javax.xml.parsers.DocumentBuilder;
 
+import org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry;
 import org.apache.geronimo.axis2.pojo.POJOWebServiceContainer;
 import org.apache.geronimo.jaxws.PortInfo;
 import org.apache.geronimo.jaxws.annotations.AnnotationHolder;
 import org.apache.geronimo.kernel.osgi.MockBundle;
 import org.apache.geronimo.kernel.util.XmlUtil;
 import org.apache.geronimo.webservices.WebServiceContainer.Request;
+import org.osgi.framework.Bundle;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
@@ -74,7 +76,8 @@ public class Axis2WebServiceContainerTes
         Axis2Response res = new Axis2Response("text/xml; charset=utf-8", "127.0.0.1", null,
null, 8080, out);
 
         String endpointClassName = "org.apache.geronimo.axis2.testdata.simple.HelloWorld";
-        POJOWebServiceContainer container = new POJOWebServiceContainer(portInfo, endpointClassName,
new MockBundle(cl, null,11L), null, AnnotationHolder.EMPTY, "/axis2");
+        Bundle mockBundle = new MockBundle(cl, null, 11L);
+        POJOWebServiceContainer container = new POJOWebServiceContainer(portInfo, endpointClassName,
mockBundle, null, new Axis2ModuleRegistry(mockBundle.getBundleContext()), AnnotationHolder.EMPTY,
"/axis2");
         container.init();
         container.invoke(req, res);
         out.flush();
@@ -147,8 +150,9 @@ public class Axis2WebServiceContainerTes
 
                 ByteArrayOutputStream out = new ByteArrayOutputStream();
                 Axis2Response res = new Axis2Response("text/xml; charset=utf-8", "127.0.0.1",
null, null, 8080, out);
-
-                POJOWebServiceContainer container = new POJOWebServiceContainer(portInfo,
endPointClassName, new MockBundle(cl, null, 11L), null, AnnotationHolder.EMPTY, "/axis2");
+                Bundle mockBundle = new MockBundle(cl, null, 11L);
+                POJOWebServiceContainer container = new POJOWebServiceContainer(portInfo,
endPointClassName, mockBundle, null, new Axis2ModuleRegistry(mockBundle.getBundleContext()),
+                        AnnotationHolder.EMPTY, "/axis2");
                 container.init();
                 container.invoke(req, res);
                 System.out.println("Response "+out);

Modified: geronimo/server/trunk/plugins/axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/pom.xml?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/pom.xml (original)
+++ geronimo/server/trunk/plugins/axis2/pom.xml Mon Mar  7 14:49:12 2011
@@ -36,6 +36,10 @@
         AXIS2 plugin
     </description>
     
+    <properties>
+        <axis2Version>1.5.4</axis2Version>
+    </properties>
+    
     <modules>
         <module>axis2</module>
         <module>axis2-deployer</module>
@@ -52,7 +56,13 @@
             <dependency>
                 <groupId>org.apache.geronimo.bundles</groupId>
                 <artifactId>axis2</artifactId>
-                <version>${axis2Version}_1</version>
+                <version>${axis2Version}_1-SNAPSHOT</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.bundles</groupId>
+                <artifactId>axis2-saaj</artifactId>
+                <version>${axis2Version}_1-SNAPSHOT</version>
             </dependency>
 
             <dependency>

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-sun-tools/src/main/java/org/apache/geronimo/jaxws/sun/tools/WsdlGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-sun-tools/src/main/java/org/apache/geronimo/jaxws/sun/tools/WsdlGenerator.java?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-sun-tools/src/main/java/org/apache/geronimo/jaxws/sun/tools/WsdlGenerator.java
(original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-sun-tools/src/main/java/org/apache/geronimo/jaxws/sun/tools/WsdlGenerator.java
Mon Mar  7 14:49:12 2011
@@ -117,7 +117,8 @@ public class WsdlGenerator {
         File baseDir;
 
         try {
-            baseDir = WsdlGeneratorUtils.createTempDirectory(moduleBaseDir);
+            //Create the WSDL file in the directory of the target web application, not in
the root directory if it is in a EAR package
+            baseDir = WsdlGeneratorUtils.createTempDirectory(new File(moduleBaseDir.toURI().resolve(module.getTargetPathURI())));
         } catch (IOException e) {
             throw new DeploymentException(e);
         }
@@ -164,7 +165,11 @@ public class WsdlGenerator {
                     throw new DeploymentException("Unable to find the service wsdl file");
                 }
                 if (this.options.getAddToClassPath()) {
-                    context.addToClassPath(baseDir.getName());
+                    String wsdlPath = WsdlGeneratorUtils.getRelativeNameOrURL(moduleBase,
wsdlFile.getParentFile());
+                    if(wsdlPath.endsWith("/")) {
+                        wsdlPath = wsdlPath.substring(0, wsdlPath.length() - 1);
+                    }
+                    context.addToClassPath(wsdlPath);
                 }
                 return WsdlGeneratorUtils.getRelativeNameOrURL(moduleBase, wsdlFile);
             } else {

Modified: geronimo/server/trunk/plugins/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/pom.xml?rev=1078791&r1=1078790&r2=1078791&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/pom.xml (original)
+++ geronimo/server/trunk/plugins/jaxws/pom.xml Mon Mar  7 14:49:12 2011
@@ -58,6 +58,10 @@
                         <groupId>com.sun.xml.bind</groupId>
                         <artifactId>jaxb-impl</artifactId>
                     </exclusion>
+                    <exclusion>
+                        <groupId>com.sun.xml.ws</groupId>
+                        <artifactId>jaxws-rt</artifactId>
+                    </exclusion>
                 </exclusions>
             </dependency>
 
@@ -103,9 +107,9 @@
                         <artifactId>ha-api</artifactId>
                     </exclusion>
                     <exclusion>
-                        <groupId>com.sun.xml.stream</groupId>
-                        <artifactId>sjsxp</artifactId>
-                    </exclusion>
+                        <groupId>com.sun.xml.ws</groupId>
+                        <artifactId>policy</artifactId>
+                    </exclusion>    
                 </exclusions>
             </dependency>
             



Mime
View raw message