geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r509765 [1/2] - in /geronimo/server/trunk: assemblies/geronimo-jetty6-jee5/src/main/var/config/ assemblies/geronimo-tomcat6-jee5/src/main/var/config/ configs/cxf-deployer/src/plan/ configs/cxf/ configs/jaxws-deployer/ configs/openejb-deploy...
Date Tue, 20 Feb 2007 21:42:09 GMT
Author: dims
Date: Tue Feb 20 13:42:07 2007
New Revision: 509765

URL: http://svn.apache.org/viewvc?view=rev&rev=509765
Log:
GERONIMO-2849 - service-ref app client test
GERONIMO-2850 - CXF: initial web service support for EJBs


Added:
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBEndpoint.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBMethodInvoker.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOEndpoint.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContext.java
    geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/pom.xml
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/org/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/org/apache/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/org/apache/geronimo/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/org/apache/geronimo/test/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/org/apache/geronimo/test/JAXWSClient.java
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/org/apache/greeter_control/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/org/apache/greeter_control/Greeter.java
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/java/org/apache/greeter_control/PingMeFault.java
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/resources/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/resources/META-INF/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/resources/META-INF/application-client.xml
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/resources/META-INF/geronimo-application-client.xml
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/resources/META-INF/wsdl/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/main/resources/META-INF/wsdl/greeter_control.wsdl
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/test/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/test/java/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/test/java/org/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/test/java/org/apache/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/test/java/org/apache/geronimo/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/test/java/org/apache/geronimo/testsuite/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/test/java/org/apache/geronimo/testsuite/testset/
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-client/src/test/java/org/apache/geronimo/testsuite/testset/ClientJAXWSTest.java
Removed:
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainerFactoryGBean.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContext.java
Modified:
    geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml
    geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml
    geronimo/server/trunk/configs/cxf-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/cxf/pom.xml
    geronimo/server/trunk/configs/jaxws-deployer/pom.xml
    geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
    geronimo/server/trunk/modules/geronimo-cxf/pom.xml
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-jaxws-builder/pom.xml
    geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
    geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-war/src/test/java/org/apache/geronimo/testsuite/testset/JaxWSTest.java

Modified: geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml Tue Feb 20 13:42:07 2007
@@ -155,18 +155,22 @@
     <module name="org.apache.geronimo.configs/client-deployer/${version}/car">
     </module>
 
-	<module name="org.apache.geronimo.configs/axis2-deployer/${version}/car">
+    <module name="org.apache.geronimo.configs/axis2-deployer/${version}/car" load="false">
         <!-- this gbean is not yet written -->
 		<!--<gbean name="Axis2ServiceRefBuilder">
             <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
         </gbean>-->
     </module>
-	<module name="org.apache.geronimo.configs/cxf-deployer/${version}/car">
-        <!-- this gbean is not yet written -->
-		<!--<gbean name="CXFServiceRefBuilder">
-            <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
-        </gbean>-->
+
+    <module name="org.apache.geronimo.configs/cxf-deployer/${version}/car">
+
+        <gbean name="CXFModuleBuilderExtension">
+            <attribute name="listener">?name=JettyWebContainer</attribute>
+            <attribute name="listenerModuleName">org.apache.geronimo.configs/jetty6/${version}/car</attribute>
+        </gbean>
+
     </module>
+
     <module name="org.apache.geronimo.configs/axis-deployer/${version}/car">
         <gbean name="AxisServiceRefBuilder">
             <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>

Modified: geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml Tue Feb 20 13:42:07 2007
@@ -162,17 +162,22 @@
     <module name="org.apache.geronimo.configs/client-deployer/${version}/car">
     </module>
 
-    <module name="org.apache.geronimo.configs/axis2-deployer/${version}/car">
+    <module name="org.apache.geronimo.configs/axis2-deployer/${version}/car" load="false">
         <!-- this gbean is not yet written -->
         <!--<gbean name="Axis2ServiceRefBuilder">
             <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
         </gbean>-->
     </module>
-	<module name="org.apache.geronimo.configs/cxf-deployer/${version}/car">
-		<!--<gbean name="CXFServiceRefBuilder">
-            <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
-        </gbean>-->
-	</module>
+
+    <module name="org.apache.geronimo.configs/cxf-deployer/${version}/car">
+
+        <gbean name="CXFModuleBuilderExtension">
+            <attribute name="listener">?name=TomcatWebContainer</attribute>
+            <attribute name="listenerModuleName">org.apache.geronimo.configs/tomcat6/${version}/car</attribute>
+        </gbean>
+
+    </module>
+
     <module name="org.apache.geronimo.configs/axis-deployer/${version}/car">
         <gbean name="AxisServiceRefBuilder">
             <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>

Modified: geronimo/server/trunk/configs/cxf-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/cxf-deployer/src/plan/plan.xml?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/configs/cxf-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/cxf-deployer/src/plan/plan.xml Tue Feb 20 13:42:07 2007
@@ -142,6 +142,11 @@
                         <artifactId>spring-context</artifactId>
                         <type>jar</type>
                     </dependency>
+                   <dependency>
+                        <groupId>wsdl4j</groupId>
+                        <artifactId>wsdl4j</artifactId>
+                        <type>jar</type>
+                    </dependency>
                     <dependency>
                         <groupId>org.apache.geronimo.configs</groupId>
                         <artifactId>client-security</artifactId>
@@ -154,5 +159,20 @@
             <name>CXFBuilder</name>
         </reference>
     </gbean>
+
+    <gbean name="CXFModuleBuilderExtension" class="org.apache.geronimo.jaxws.builder.JAXWSEJBModuleBuilderExtension">
+        <!-- These two attributes must be updated appropriately in the config.xml file -->
+        <attribute name="listener">?name=WebContainer</attribute>
+        <attribute name="listenerModuleName">WebContainer</attribute>
+
+        <reference name="WebServiceBuilder">
+            <name>CXFBuilder</name>
+        </reference>
+        <reference name="WebServiceLinkTemplate">
+            <name>CXFWebServiceEJBLinkTemplate</name>
+        </reference>
+    </gbean>
+
+    <gbean name="CXFWebServiceEJBLinkTemplate" class="org.apache.geronimo.cxf.ejb.EJBWebServiceGBean"/>
 
 </module>

Modified: geronimo/server/trunk/configs/cxf/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/cxf/pom.xml?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/configs/cxf/pom.xml (original)
+++ geronimo/server/trunk/configs/cxf/pom.xml Tue Feb 20 13:42:07 2007
@@ -58,6 +58,13 @@
 
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>openejb</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>transaction-jta11</artifactId>
             <version>${version}</version>
             <type>car</type>

Modified: geronimo/server/trunk/configs/jaxws-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/jaxws-deployer/pom.xml?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/configs/jaxws-deployer/pom.xml (original)
+++ geronimo/server/trunk/configs/jaxws-deployer/pom.xml Tue Feb 20 13:42:07 2007
@@ -50,6 +50,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>openejb-deployer</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-jaxws-builder</artifactId>
             <version>${version}</version>

Modified: geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml Tue Feb 20 13:42:07 2007
@@ -24,9 +24,11 @@
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
-        <reference name="ModuleBuilderExtensions">
-            <name>ModuleBuilderExtension</name>
-        </reference>
+        <references name="ModuleBuilderExtensions">
+          <pattern>
+            <name>CXFModuleBuilderExtension</name>
+          </pattern>
+        </references>
         <reference name="SecurityBuilders">
             <name>SecurityBuilder</name>
         </reference>

Modified: geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java Tue Feb 20 13:42:07 2007
@@ -42,8 +42,8 @@
 import org.apache.cxf.jaxws.javaee.WebserviceDescriptionType;
 import org.apache.cxf.jaxws.javaee.WebservicesType;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.cxf.CXFWebServiceContainerFactoryGBean;
 import org.apache.geronimo.cxf.client.CXFServiceReference;
+import org.apache.geronimo.cxf.pojo.POJOWebServiceContainerFactoryGBean;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
@@ -69,7 +69,7 @@
     }
 
     protected GBeanInfo getContainerFactoryGBeanInfo() {
-        return CXFWebServiceContainerFactoryGBean.GBEAN_INFO;
+        return POJOWebServiceContainerFactoryGBean.GBEAN_INFO;
     }
 
     protected Map<String, PortInfo> parseWebServiceDescriptor(InputStream in,

Modified: geronimo/server/trunk/modules/geronimo-cxf/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/pom.xml?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-cxf/pom.xml Tue Feb 20 13:42:07 2007
@@ -59,6 +59,12 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-openejb</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxws</artifactId>
         </dependency>

Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java (original)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java Tue Feb 20 13:42:07 2007
@@ -26,104 +26,40 @@
 
 import javax.xml.transform.Source;
 import javax.xml.ws.Binding;
-import javax.xml.ws.Provider;
 import javax.xml.ws.Endpoint;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.http.HTTPBinding;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.binding.xml.XMLBindingInfoFactoryBean;
-import org.apache.cxf.binding.xml.XMLConstants;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.endpoint.ServerImpl;
-import org.apache.cxf.jaxws.JAXWSMethodInvoker;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
-import org.apache.cxf.jaxws.binding.soap.JaxWsSoapBindingInfoFactoryBean;
-import org.apache.cxf.jaxws.handler.PortInfoImpl;
-import org.apache.cxf.jaxws.javaee.HandlerChainsType;
 import org.apache.cxf.jaxws.support.AbstractJaxWsServiceFactoryBean;
 import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
 import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
-import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.AbstractBindingInfoFactoryBean;
-import org.apache.geronimo.jaxws.annotations.AnnotationException;
-import org.apache.geronimo.jaxws.annotations.AnnotationProcessor;
-import org.apache.geronimo.jaxws.JAXWSUtils;
-import org.apache.geronimo.jaxws.JNDIResolver;
-import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
-import org.apache.geronimo.jaxws.PortInfo;
 
-/*
- * This class somewhat replicates CXF Endpoint functionality but it is necessary
- * to do custom annotation handling for the service and handlers.
- */
-public class CXFEndpoint extends Endpoint {
+public abstract class CXFEndpoint extends Endpoint {
 
-    private Bus bus;
+    protected Bus bus;
 
-    private Object implementor;
+    protected Object implementor;
 
-    private Server server;
+    protected Server server;
 
-    private Service service;
+    protected Service service;
 
-    private JaxWsImplementorInfo implInfo;
+    protected JaxWsImplementorInfo implInfo;
 
-    private AbstractJaxWsServiceFactoryBean serviceFactory;
+    protected AbstractJaxWsServiceFactoryBean serviceFactory;
 
-    private String bindingURI;
+    protected String bindingURI;
 
-    private PortInfo portInfo;
-
-    private AnnotationProcessor annotationProcessor;
-
-    public CXFEndpoint(Bus bus,
-                       URL configurationBaseUrl,
-                       Object instance) {
+    public CXFEndpoint(Bus bus, Object implementor) {
         this.bus = bus;
-        this.implementor = instance;
-
-        this.portInfo = (PortInfo) bus.getExtension(PortInfo.class);
-        this.bindingURI = JAXWSUtils.getBindingURI(this.portInfo.getProtocolBinding());
-        
-        implInfo = new JaxWsImplementorInfo(implementor.getClass());
-
-        if (implInfo.isWebServiceProvider()) {
-            //serviceFactory = new ProviderServiceFactoryBean(implInfo);
-        } else {
-            serviceFactory = new JaxWsServiceFactoryBean(implInfo);
-        }
-        serviceFactory.setBus(bus);
-
-        /*
-         * TODO: The WSDL processing needs to be improved
-         */
-        URL wsdlURL = getWsdlURL(configurationBaseUrl, this.portInfo.getWsdlFile());
-
-        // install as first to overwrite annotations (wsdl-file, wsdl-port, wsdl-service)
-        CXFServiceConfiguration configuration = new CXFServiceConfiguration(
-                this.portInfo, wsdlURL);
-        serviceFactory.getConfigurations().add(0, configuration);
-
-        service = serviceFactory.create();
-
-        service.put(Message.SCHEMA_VALIDATION_ENABLED, service
-                .getEnableSchemaValidationForAllPort());
-
-        if (implInfo.isWebServiceProvider()) {
-            //service.setInvoker(new ProviderInvoker((Provider<?>) instance));
-        } else {
-            service.setInvoker(new JAXWSMethodInvoker(instance));
-        }
-
-        JNDIResolver jndiResolver = (JNDIResolver) bus.getExtension(JNDIResolver.class);
-        this.annotationProcessor = new JAXWSAnnotationProcessor(jndiResolver, new CXFWebServiceContext());
+        this.implementor = implementor;
     }
-
-    private URL getWsdlURL(URL configurationBaseUrl, String wsdlFile) {
+  
+    protected URL getWsdlURL(URL configurationBaseUrl, String wsdlFile) {
         URL wsdlURL = null;
         if (wsdlFile != null) {
 
@@ -148,7 +84,7 @@
         }
         return wsdlURL;
     }
-
+    
     org.apache.cxf.endpoint.Endpoint getEndpoint() {
         return ((ServerImpl) getServer()).getEndpoint();
     }
@@ -216,93 +152,25 @@
         svrFactory.setAddress(address);
         svrFactory.setServiceFactory(serviceFactory);
         svrFactory.setStart(false);
-
-        // FIXME: setServiceClass() or setSerivceBean() ?
-        svrFactory.setServiceClass(implementor.getClass());
-        // svrFactory.setServiceBean(implementor);
-        
-        AbstractBindingInfoFactoryBean bindingFactory = null;
-        if (XMLConstants.NS_XML_FORMAT.equals(bindingURI)
-            || HTTPBinding.HTTP_BINDING.equals(bindingURI)) {
-            bindingFactory = new XMLBindingInfoFactoryBean();
-        } else {
-            // Just assume soap otherwise...
-            bindingFactory = new JaxWsSoapBindingInfoFactoryBean();
-        }
-
-        svrFactory.setBindingFactory(bindingFactory);
-      
+        svrFactory.setServiceBean(implementor);
+              
         server = svrFactory.create();
         
         init();
 
-        /*
-        if (implInfo.isWebServiceProvider()) {
-            getServer().setMessageObserver(
-                    new ProviderChainObserver(getEndpoint(), bus, implInfo));
-        }
-        */
-
         org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
 
         if (endpoint.getEnableSchemaValidation()) {
-            endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, endpoint
-                    .getEnableSchemaValidation());
+            endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, 
+                         endpoint.getEnableSchemaValidation());
         }
         server.start();
     }
 
-    protected void init() {        
-        // configure and inject handlers
-        try {
-            configureHandlers();
-        } catch (Exception e) {
-            throw new WebServiceException("Error configuring handlers", e);
-        }
-
-        // inject resources into service
-        try {
-            injectResources(this.implementor);
-        } catch (AnnotationException e) {
-            throw new WebServiceException("Service resource injection failed", e);
-        }
-    }
-
-    private void injectResources(Object instance) throws AnnotationException {
-        this.annotationProcessor.processAnnotations(instance);
-        this.annotationProcessor.invokePostConstruct(instance);
-    }
-
-    /*
-     * Gets the right handlers for the port/service/bindings and 
-     * performs injection.
-     */
-    protected void configureHandlers() throws Exception {        
-        HandlerChainsType handlerChains = this.portInfo.getHandlers(HandlerChainsType.class);
-        CXFHandlerResolver handlerResolver =
-            new CXFHandlerResolver(this.implementor.getClass().getClassLoader(), 
-                                   this.implementor.getClass(),
-                                   handlerChains, 
-                                   this.annotationProcessor);
-                
-        PortInfoImpl portInfo = 
-            new PortInfoImpl(this.bindingURI, serviceFactory.getEndpointName(), service.getName());
-        
-        List<Handler> chain = handlerResolver.getHandlerChain(portInfo);
-
-        getBinding().setHandlerChain(chain);
+    protected void init() { 
     }
-
+          
     public void stop() {
-        // call handlers preDestroy
-        List<Handler> handlers = getBinding().getHandlerChain();
-        for (Handler handler : handlers) {
-            this.annotationProcessor.invokePreDestroy(handler);
-        }
-
-        // call service preDestroy
-        this.annotationProcessor.invokePreDestroy(this.implementor);
-
         // shutdown server
         if (this.server != null) {
             this.server.stop();

Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java Tue Feb 20 13:42:07 2007
@@ -16,64 +16,52 @@
  */
 package org.apache.geronimo.cxf;
 
-import javax.naming.Context;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLWriter;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.xml.XMLConstants;
+import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
 import org.apache.cxf.tools.util.SOAPBindingUtil;
 import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
-
 import org.apache.geronimo.webservices.WebServiceContainer;
-import org.apache.geronimo.jaxws.JNDIResolver;
-import org.apache.geronimo.jaxws.PortInfo;
-import org.apache.geronimo.jaxws.ServerJNDIResolver;
 import org.xmlsoap.schemas.wsdl.http.AddressType;
 
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
-
-import java.io.PrintWriter;
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-import java.util.ArrayList;
-
-// TODO consider putting most of this in the CXFWebServiceContaInerFactoryGBean
-public class CXFWebServiceContainer implements WebServiceContainer {
+public abstract class CXFWebServiceContainer implements WebServiceContainer {
 
     private static final Log LOG = LogFactory.getLog(CXFWebServiceContainer.class);
     
-    private final GeronimoDestination destination;
+    protected final GeronimoDestination destination;
 
-    private final Bus bus;
+    protected final Bus bus;
 
-    private final CXFEndpoint endpoint;
+    protected final CXFEndpoint endpoint;
 
-    private URL configurationBaseUrl;
+    protected URL configurationBaseUrl;
 
-    public CXFWebServiceContainer(PortInfo portInfo,
-                                  Object target,
-                                  Bus bus,
-                                  Context context,
-                                  URL configurationBaseUrl) {
+    public CXFWebServiceContainer(Bus bus,
+                                  URL configurationBaseUrl,
+                                  Object target) {
         this.bus = bus;
         this.configurationBaseUrl = configurationBaseUrl;
 
         List ids = new ArrayList();
         ids.add("http://schemas.xmlsoap.org/wsdl/soap/http");
 
-        bus.setExtension(new ServerJNDIResolver(context), JNDIResolver.class);
-        bus.setExtension(portInfo, PortInfo.class);
-
         DestinationFactoryManager destinationFactoryManager = bus
                 .getExtension(DestinationFactoryManager.class);
         GeronimoDestinationFactory factory = new GeronimoDestinationFactory(bus);
@@ -92,8 +80,7 @@
                 XMLConstants.NS_XML_FORMAT, factory);
 
         endpoint = publishEndpoint(target);
-        destination = (GeronimoDestination) endpoint.getServer()
-                .getDestination();
+        destination = (GeronimoDestination) endpoint.getServer().getDestination();
     }
 
     public void invoke(Request request, Response response) throws Exception {
@@ -149,12 +136,6 @@
         }
     }
 
-    private CXFEndpoint publishEndpoint(Object target) {
-        assert target != null : "null target received";
-
-        CXFEndpoint ep = new CXFEndpoint(bus, configurationBaseUrl, target);
-        ep.publish("http://nopath");
-        return ep;
-    }
+    abstract protected CXFEndpoint publishEndpoint(Object target);
 
 }

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBEndpoint.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBEndpoint.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBEndpoint.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBEndpoint.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,71 @@
+/**
+ * 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.cxf.ejb;
+
+import java.net.URL;
+
+import javax.xml.ws.WebServiceException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.message.Message;
+import org.apache.geronimo.cxf.CXFEndpoint;
+import org.apache.geronimo.cxf.CXFServiceConfiguration;
+import org.apache.geronimo.jaxws.JAXWSUtils;
+import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.openejb.DeploymentInfo;
+
+public class EJBEndpoint extends CXFEndpoint {
+
+    private PortInfo portInfo;
+
+    public EJBEndpoint(Bus bus,
+                       URL configurationBaseUrl,
+                       Class instance) {
+        super(bus, instance);
+
+        this.portInfo = (PortInfo) bus.getExtension(PortInfo.class);
+        this.bindingURI = JAXWSUtils.getBindingURI(this.portInfo.getProtocolBinding());
+        
+        implInfo = new JaxWsImplementorInfo( (Class)implementor );
+
+        serviceFactory = new JaxWsServiceFactoryBean(implInfo);       
+        serviceFactory.setBus(bus);
+
+        /*
+         * TODO: The WSDL processing needs to be improved
+         */
+        URL wsdlURL = getWsdlURL(configurationBaseUrl, this.portInfo.getWsdlFile());
+
+        // install as first to overwrite annotations (wsdl-file, wsdl-port, wsdl-service)
+        CXFServiceConfiguration configuration = 
+            new CXFServiceConfiguration(this.portInfo, wsdlURL);
+        serviceFactory.getConfigurations().add(0, configuration);
+
+        service = serviceFactory.create();
+
+        service.put(Message.SCHEMA_VALIDATION_ENABLED, 
+                    service.getEnableSchemaValidationForAllPort());
+
+        DeploymentInfo deploymentInfo = (DeploymentInfo)bus.getExtension(DeploymentInfo.class);
+        service.setInvoker(new EJBMethodInvoker(deploymentInfo));       
+    }
+    
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBMethodInvoker.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBMethodInvoker.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBMethodInvoker.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBMethodInvoker.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,86 @@
+/**
+ * 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.cxf.ejb;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.ws.handler.MessageContext;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.jaxws.JAXWSMethodInvoker;
+import org.apache.cxf.jaxws.context.WebServiceContextImpl;
+import org.apache.cxf.jaxws.support.ContextPropertiesMapping;
+import org.apache.cxf.message.Exchange;
+import org.apache.openejb.DeploymentInfo;
+import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.RpcContainer;
+
+public class EJBMethodInvoker extends JAXWSMethodInvoker {
+
+    private DeploymentInfo deploymentInfo;
+
+    public EJBMethodInvoker(DeploymentInfo deploymentInfo) {
+        super(null, null);
+        this.deploymentInfo = deploymentInfo;
+    }
+
+    public Object getServiceObject(Exchange context) {
+        return null;
+    }
+
+    protected Object invoke(Exchange exchange,
+                            Object serviceObject,
+                            Method m,
+                            List<Object> params) {
+
+        MessageContext ctx = ContextPropertiesMapping.createWebServiceContext(exchange);
+        WebServiceContextImpl.setMessageContext(ctx);
+
+        Object[] paramArray = new Object[] {};
+        if (params != null) {
+            paramArray = params.toArray();
+        }
+
+        insertExchange(m, paramArray, exchange);
+        
+        RpcContainer container = (RpcContainer) this.deploymentInfo.getContainer();
+        Object result = null;
+        try {
+            result = container.invoke(this.deploymentInfo.getDeploymentID(), m, paramArray, null, null);
+        } catch (OpenEJBException e) {
+            throw new Fault(e);
+        }
+        
+        if (exchange.isOneWay()) {
+            return null;
+        }
+
+        List<Object> retList = new ArrayList<Object>(1);
+        if (!((Class) m.getReturnType()).getName().equals("void")) {
+            retList.add(result);
+        }
+
+        ContextPropertiesMapping.updateWebServiceContext(exchange, ctx);
+
+        return retList;
+    }
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceContainer.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceContainer.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceContainer.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,40 @@
+/**
+ *  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.cxf.ejb;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.geronimo.cxf.CXFWebServiceContainer;
+
+public class EJBWebServiceContainer extends CXFWebServiceContainer {
+    
+    public EJBWebServiceContainer(Bus bus,    
+                                  URL configurationBaseUrl,
+                                  Class target) {
+        super(bus, configurationBaseUrl, target);
+    }
+                                    
+    protected EJBEndpoint publishEndpoint(Object target) {
+        assert target != null : "null target received";
+
+        EJBEndpoint ep = new EJBEndpoint(bus, configurationBaseUrl, (Class)target);
+        ep.publish("http://nopath");
+        return ep;
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,134 @@
+/**
+ * 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.cxf.ejb;
+
+import java.net.URL;
+
+import javax.naming.Context;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.jaxws.JNDIResolver;
+import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.geronimo.jaxws.ServerJNDIResolver;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.openejb.EjbDeployment;
+import org.apache.geronimo.webservices.SoapHandler;
+import org.apache.openejb.DeploymentInfo;
+
+public class EJBWebServiceGBean implements GBeanLifecycle {
+
+    private SoapHandler soapHandler;
+    private String location;
+
+    public EJBWebServiceGBean(EjbDeployment ejbDeploymentContext,
+                              PortInfo portInfo,                              
+                              Kernel kernel,
+                              URL configurationBaseUrl,                              
+                              SoapHandler soapHandler,
+                              String securityRealmName,
+                              String realmName,
+                              String transportGuarantee,
+                              String authMethod,
+                              String[] virtualHosts) throws Exception {        
+        if (ejbDeploymentContext == null || soapHandler == null || portInfo == null) {
+            return;
+        }
+                
+        this.location = portInfo.getLocation();
+        
+        assert this.location != null : "null location received";
+                
+        Class beanClass = ejbDeploymentContext.getBeanClass();    
+        Context context = ejbDeploymentContext.getComponentContext();
+        
+        Bus bus = (new CXFBusFactory()).createBus();
+        bus.setExtension(new ServerJNDIResolver(context), JNDIResolver.class);
+        bus.setExtension(portInfo, PortInfo.class);  
+        bus.setExtension(ejbDeploymentContext.getDeploymentInfo(), DeploymentInfo.class);
+        
+        EJBWebServiceContainer container = 
+            new EJBWebServiceContainer(bus, configurationBaseUrl, beanClass);
+        
+        ClassLoader classLoader = ejbDeploymentContext.getClassLoader();
+        if (soapHandler != null) {
+            soapHandler.addWebService(this.location, 
+                                      virtualHosts, 
+                                      container, 
+                                      securityRealmName, 
+                                      realmName, 
+                                      transportGuarantee, 
+                                      authMethod, 
+                                      classLoader);
+        }
+        
+    }
+
+    public void doStart() throws Exception {
+    }
+
+    public void doStop() throws Exception {        
+        if (this.soapHandler != null) {
+            this.soapHandler.removeWebService(this.location);
+        }        
+    }
+
+    public void doFail() {
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(EJBWebServiceGBean.class, EJBWebServiceGBean.class, NameFactory.WEB_SERVICE_LINK);
+        
+        infoFactory.addReference("EjbDeployment", EjbDeployment.class);
+        infoFactory.addAttribute("portInfo", PortInfo.class, true);       
+        infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.addAttribute("configurationBaseUrl", URL.class, true);
+        infoFactory.addAttribute("securityRealmName", String.class, true);
+        infoFactory.addAttribute("realmName", String.class, true);
+        infoFactory.addAttribute("transportGuarantee", String.class, true);
+        infoFactory.addAttribute("authMethod", String.class, true);
+        infoFactory.addAttribute("virtualHosts", String[].class, true);
+        infoFactory.addReference("WebServiceContainer", SoapHandler.class);
+        
+        infoFactory.setConstructor(new String[]{
+                "EjbDeployment",
+                "portInfo",
+                "kernel",
+                "configurationBaseUrl",
+                "WebServiceContainer",
+                "securityRealmName",
+                "realmName",
+                "transportGuarantee",
+                "authMethod",
+                "virtualHosts"
+        });
+
+        
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOEndpoint.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOEndpoint.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOEndpoint.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOEndpoint.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,136 @@
+/**
+ * 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.cxf.pojo;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.Handler;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.jaxws.JAXWSMethodInvoker;
+import org.apache.cxf.jaxws.handler.PortInfoImpl;
+import org.apache.cxf.jaxws.javaee.HandlerChainsType;
+import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.message.Message;
+import org.apache.geronimo.cxf.CXFEndpoint;
+import org.apache.geronimo.cxf.CXFHandlerResolver;
+import org.apache.geronimo.cxf.CXFServiceConfiguration;
+import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
+import org.apache.geronimo.jaxws.JAXWSUtils;
+import org.apache.geronimo.jaxws.JNDIResolver;
+import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.geronimo.jaxws.annotations.AnnotationException;
+import org.apache.geronimo.jaxws.annotations.AnnotationProcessor;
+
+public class POJOEndpoint extends CXFEndpoint {
+
+    private PortInfo portInfo;
+
+    private AnnotationProcessor annotationProcessor;
+
+    public POJOEndpoint(Bus bus, URL configurationBaseUrl, Object instance) {
+        super(bus, instance);
+
+        this.portInfo = (PortInfo) bus.getExtension(PortInfo.class);
+        this.bindingURI = JAXWSUtils.getBindingURI(this.portInfo.getProtocolBinding());
+        
+        implInfo = new JaxWsImplementorInfo(implementor.getClass());
+
+        serviceFactory = new JaxWsServiceFactoryBean(implInfo);        
+        serviceFactory.setBus(bus);
+
+        /*
+         * TODO: The WSDL processing needs to be improved
+         */
+        URL wsdlURL = getWsdlURL(configurationBaseUrl, this.portInfo.getWsdlFile());
+
+        // install as first to overwrite annotations (wsdl-file, wsdl-port, wsdl-service)
+        CXFServiceConfiguration configuration = 
+            new CXFServiceConfiguration(this.portInfo, wsdlURL);
+        serviceFactory.getConfigurations().add(0, configuration);
+
+        service = serviceFactory.create();
+
+        service.put(Message.SCHEMA_VALIDATION_ENABLED, 
+                    service.getEnableSchemaValidationForAllPort());
+
+        service.setInvoker(new JAXWSMethodInvoker(instance));       
+
+        JNDIResolver jndiResolver = (JNDIResolver) bus.getExtension(JNDIResolver.class);
+        this.annotationProcessor = new JAXWSAnnotationProcessor(jndiResolver, new POJOWebServiceContext());
+    }
+    
+    protected void init() {        
+        // configure and inject handlers
+        try {
+            configureHandlers();
+        } catch (Exception e) {
+            throw new WebServiceException("Error configuring handlers", e);
+        }
+
+        // inject resources into service
+        try {
+            injectResources(this.implementor);
+        } catch (AnnotationException e) {
+            throw new WebServiceException("Service resource injection failed", e);
+        }
+    }
+
+    private void injectResources(Object instance) throws AnnotationException {
+        this.annotationProcessor.processAnnotations(instance);
+        this.annotationProcessor.invokePostConstruct(instance);
+    }
+
+    /*
+     * Gets the right handlers for the port/service/bindings and 
+     * performs injection.
+     */
+    protected void configureHandlers() throws Exception {        
+        HandlerChainsType handlerChains = this.portInfo.getHandlers(HandlerChainsType.class);
+        CXFHandlerResolver handlerResolver =
+            new CXFHandlerResolver(this.implementor.getClass().getClassLoader(), 
+                                   this.implementor.getClass(),
+                                   handlerChains, 
+                                   this.annotationProcessor);
+                
+        PortInfoImpl portInfo = 
+            new PortInfoImpl(this.bindingURI, serviceFactory.getEndpointName(), service.getName());
+        
+        List<Handler> chain = handlerResolver.getHandlerChain(portInfo);
+
+        getBinding().setHandlerChain(chain);
+    }
+
+    public void stop() {
+        // call handlers preDestroy
+        List<Handler> handlers = getBinding().getHandlerChain();
+        for (Handler handler : handlers) {
+            this.annotationProcessor.invokePreDestroy(handler);
+        }
+
+        // call service preDestroy
+        this.annotationProcessor.invokePreDestroy(this.implementor);
+
+        // shutdown server
+        super.stop();
+    }
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainer.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainer.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainer.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,41 @@
+/**
+ *  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.cxf.pojo;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.geronimo.cxf.CXFEndpoint;
+import org.apache.geronimo.cxf.CXFWebServiceContainer;
+
+public class POJOWebServiceContainer extends CXFWebServiceContainer {
+    
+    public POJOWebServiceContainer(Bus bus,
+                                   URL configurationBaseUrl,                                  
+                                   Object target) {
+        super(bus, configurationBaseUrl, target);
+    }
+
+    protected CXFEndpoint publishEndpoint(Object target) {
+        assert target != null : "null target received";
+
+        POJOEndpoint ep = new POJOEndpoint(bus, configurationBaseUrl, target);
+        ep.publish("http://nopath");
+        return ep;
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,121 @@
+/**
+ *  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.cxf.pojo;
+
+import java.net.URL;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.transaction.TransactionManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.jaxws.JNDIResolver;
+import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.geronimo.jaxws.ServerJNDIResolver;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.naming.enc.EnterpriseNamingContext;
+import org.apache.geronimo.transaction.GeronimoUserTransaction;
+import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.webservices.WebServiceContainerFactory;
+
+/**
+ * @version $Rev: 508298 $ $Date: 2007-02-15 22:25:05 -0500 (Thu, 15 Feb 2007) $
+ */
+public class POJOWebServiceContainerFactoryGBean implements WebServiceContainerFactory {
+
+    private static final Log LOG = LogFactory.getLog(POJOWebServiceContainerFactoryGBean.class);
+
+    private final Bus bus;
+    private final Object endpointInstance;
+    private final URL configurationBaseUrl;
+
+    public POJOWebServiceContainerFactoryGBean(PortInfo portInfo,
+                                              String endpointClassName,
+                                              ClassLoader classLoader,
+                                              Map componentContext,
+                                              Kernel kernel,
+                                              TransactionManager transactionManager,
+                                              URL configurationBaseUrl)
+            throws ClassNotFoundException, 
+                   IllegalAccessException,
+                   InstantiationException {
+        
+        Context context = null;
+        
+        if (componentContext != null) {
+            GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
+            try {
+                context = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext,
+                                                                                userTransaction,
+                                                                                kernel,
+                                                                                classLoader);
+            } catch (NamingException e) {
+                LOG.warn("Failed to create naming context", e);
+            }
+        }
+
+        this.bus = (new CXFBusFactory()).createBus();
+        this.configurationBaseUrl = configurationBaseUrl;
+        
+        Class endpointClass = classLoader.loadClass(endpointClassName);
+        this.endpointInstance = endpointClass.newInstance();
+        
+        this.bus.setExtension(new ServerJNDIResolver(context), JNDIResolver.class);
+        this.bus.setExtension(portInfo, PortInfo.class);        
+    }
+
+    public WebServiceContainer getWebServiceContainer() {
+        return new POJOWebServiceContainer(bus, configurationBaseUrl, endpointInstance);
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(POJOWebServiceContainerFactoryGBean.class, NameFactory.GERONIMO_SERVICE);
+        infoBuilder.addAttribute("portInfo", PortInfo.class, true, true);
+        infoBuilder.addAttribute("endpointClassName", String.class, true, true);
+        infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
+        infoBuilder.addAttribute("componentContext", Map.class, true, true);
+        infoBuilder.addAttribute("kernel", Kernel.class, false);
+        infoBuilder.addReference("TransactionManager", TransactionManager.class, NameFactory.TRANSACTION_MANAGER);
+        infoBuilder.addAttribute("configurationBaseUrl", URL.class, true);
+
+        infoBuilder.setConstructor(new String[]{
+                "portInfo", 
+                "endpointClassName", 
+                "classLoader",
+                "componentContext", 
+                "kernel", 
+                "TransactionManager", 
+                "configurationBaseUrl"
+        });
+        
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContext.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContext.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContext.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,58 @@
+/**
+ * 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.cxf.pojo;
+
+import java.security.Principal;
+
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.cxf.jaxws.context.WebServiceContextImpl;
+
+/**
+ * Implementation of WebServiceContext for POJO WS to ensure that getUserPrincipal()
+ * and isUserInRole() are properly handled.
+ */
+public class POJOWebServiceContext implements WebServiceContext {
+
+    private WebServiceContextImpl ctx = new WebServiceContextImpl();
+
+    public final MessageContext getMessageContext() {
+        // TODO: if null consider throwing IllegalStateException?
+        return ctx.getMessageContext();
+    }
+    
+    private HttpServletRequest getHttpServletRequest() {
+        MessageContext ctx = getMessageContext();
+        return (ctx != null) ? (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST) : null;
+    }
+    
+    public final Principal getUserPrincipal() {
+        HttpServletRequest request = getHttpServletRequest();
+        return (request != null) ? request.getUserPrincipal() : null;
+    }
+    
+    public final boolean isUserInRole(String user) {
+        HttpServletRequest request = getHttpServletRequest();
+        return (request != null) ? request.isUserInRole(user) : false;
+    }
+    
+}

Modified: geronimo/server/trunk/modules/geronimo-jaxws-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws-builder/pom.xml?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws-builder/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-jaxws-builder/pom.xml Tue Feb 20 13:42:07 2007
@@ -43,6 +43,11 @@
             <artifactId>geronimo-naming-builder</artifactId>
             <version>${version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-openejb-builder</artifactId>
+            <version>${version}</version>
+        </dependency>
     </dependencies>
 
 </project>

Added: geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java?view=auto&rev=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java (added)
+++ geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java Tue Feb 20 13:42:07 2007
@@ -0,0 +1,182 @@
+/**
+ * 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.jaxws.builder;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.jar.JarFile;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
+import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.ImportType;
+import org.apache.geronimo.openejb.deployment.EjbModule;
+import org.apache.openejb.assembler.classic.EnterpriseBeanInfo;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class JAXWSEJBModuleBuilderExtension implements ModuleBuilderExtension {
+
+    protected WebServiceBuilder jaxwsBuilder;
+    protected AbstractNameQuery listener;
+    protected String listenerModuleName;
+    protected GBeanInfo wsGBeanInfo;
+
+    public JAXWSEJBModuleBuilderExtension() throws Exception {
+        this(null, null, null, null, null, null);
+    }
+
+    public JAXWSEJBModuleBuilderExtension(WebServiceBuilder wsBuilder,
+                                          Environment defaultEnvironment,
+                                          AbstractNameQuery listener,
+                                          String listenerModuleName,
+                                          Object dataLink,
+                                          Kernel kernel) throws Exception {
+        this.jaxwsBuilder = wsBuilder;
+        this.listener = listener;                
+        this.listenerModuleName = listenerModuleName;
+        this.wsGBeanInfo = getGBeanInfo(kernel, dataLink);
+    }
+    
+    private static GBeanInfo getGBeanInfo(Kernel kernel, Object webServiceLinkTemplate) throws Exception {
+        AbstractName webServiceLinkTemplateName = kernel.getAbstractNameFor(webServiceLinkTemplate);
+        return kernel.getGBeanInfo(webServiceLinkTemplateName);
+    }
+
+    public void createModule(Module module, File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    }
+
+    public void createModule(Module module, Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+        if (module.getType() != ConfigurationModuleType.EJB) {
+            return;
+        }
+       
+        EjbModule ejbModule = (EjbModule) module;
+        
+        //overridden web service locations
+        Map correctedPortLocations = new HashMap();
+               
+        jaxwsBuilder.findWebServices(moduleFile, true, correctedPortLocations, environment, ejbModule.getSharedContext());
+        
+        if (this.listenerModuleName != null) {
+            Artifact id = Artifact.create(this.listenerModuleName);        
+            Dependency dep = new Dependency(id, ImportType.ALL);
+            environment.addDependency(dep);
+        }
+        
+    }
+
+    public void installModule(JarFile earFile, EARContext earContext, Module module, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws DeploymentException {
+    }
+
+    public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
+    }
+
+    public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection repository) throws DeploymentException {
+        if (module.getType() != ConfigurationModuleType.EJB) {
+            return;
+        }
+
+        EjbModule ejbModule = (EjbModule) module;
+
+        for (EnterpriseBeanInfo bean : ejbModule.getEjbJarInfo().enterpriseBeans) {
+            if (bean.type != EnterpriseBeanInfo.STATELESS) continue;
+            String ejbName = bean.ejbName;
+
+            AbstractName sessionName = earContext.getNaming().createChildName(module.getModuleName(), ejbName, NameFactory.STATELESS_SESSION_BEAN);
+
+            assert sessionName != null: "StatelesSessionBean object name is null";
+
+            AbstractName ejbWebServiceName = earContext.getNaming().createChildName(sessionName, ejbName, NameFactory.WEB_SERVICE_LINK);
+            
+            GBeanData ejbWebServiceGBean = new GBeanData(ejbWebServiceName, this.wsGBeanInfo);
+
+            ejbWebServiceGBean.setAttribute("ejbName", ejbName);
+            
+            if (jaxwsBuilder.configureEJB(ejbWebServiceGBean, bean.ejbClass, ejbModule.getModuleFile(), 
+                                          ejbModule.getSharedContext(), cl)) {
+
+                try {
+                    earContext.addGBean(ejbWebServiceGBean);
+                } catch (GBeanAlreadyExistsException e) {
+                    throw new DeploymentException(
+                            "Could not add axis ejb web service gbean to context",
+                            e);
+                }
+                
+                if (this.listener != null) {
+                    ejbWebServiceGBean.setReferencePattern("WebServiceContainer", this.listener);
+                }
+                
+                ejbWebServiceGBean.setReferencePattern("EjbDeployment", sessionName);
+            }
+            
+            ejbWebServiceGBean.clearAttribute("ejbName");
+            
+        }
+    }
+    
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(JAXWSEJBModuleBuilderExtension.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addInterface(ModuleBuilderExtension.class);
+        infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+        infoBuilder.addAttribute("listener", AbstractNameQuery.class, true);
+        infoBuilder.addAttribute("listenerModuleName", String.class, true);
+        infoBuilder.addReference("WebServiceLinkTemplate", Object.class, NameFactory.WEB_SERVICE_LINK);
+        infoBuilder.addAttribute("kernel", Kernel.class, false);
+
+        infoBuilder.setConstructor(new String[]{
+                "WebServiceBuilder",
+                "defaultEnvironment", 
+                "listener", 
+                "listenerModuleName",
+                "WebServiceLinkTemplate",
+                "kernel"
+        });
+
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }    
+    
+}

Modified: geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java?view=diff&rev=509765&r1=509764&r2=509765
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java Tue Feb 20 13:42:07 2007
@@ -236,7 +236,7 @@
             LOG.warn("ModuleGBean not found. JNDI resource injection will not work.");
         }
 
-        LOG.info("configuring POJO webservice: " + servletName + " sei: " + seiClassName);
+        LOG.info("Configuring POJO Web Service: " + servletName + " sei: " + seiClassName);
 
         // verify that the class is loadable
         ClassLoader classLoader = context.getClassLoader();
@@ -274,8 +274,47 @@
                                 JarFile moduleFile,
                                 Map sharedContext,
                                 ClassLoader classLoader)
-            throws DeploymentException {
-        throw new DeploymentException("configureEJB NYI");
+            throws DeploymentException {        
+        Map portInfoMap = (Map) sharedContext.get(getKey());
+        if (portInfoMap == null) {
+            // not ours
+            return false;
+        }
+        PortInfo portInfo = (PortInfo) portInfoMap.get(ejbName);
+        if (portInfo == null) {
+            // not ours
+            return false;
+        }
+        
+        String shortEjbName = (String)targetGBean.getAttribute("ejbName");
+                
+        // FIXME: kind of a hack now, need better solution
+        String location = portInfo.getLocation();
+        if (location == null) {            
+            location = "/" + trimPath(new File(moduleFile.getName()).getName()) + "/" + shortEjbName;
+            portInfo.setLocation(location);
+        }
+
+        LOG.info("Configuring EJB Web Service: " + ejbName + " at " + location);
+        
+        targetGBean.setAttribute("portInfo", portInfo);
+        
+        return true;
+    }
+    
+    private String trimPath(String path) {
+        if (path == null) {
+            return null;
+        }
+
+        if (path.endsWith(".war") || path.endsWith(".jar")) {
+            path = path.substring(0, path.length() - 4);
+        }
+        if (path.endsWith("/")) {
+            path = path.substring(0, path.length() - 1);
+        }
+
+        return path;
     }
 
     Class<?> loadSEI(String className, ClassLoader loader) throws DeploymentException {



Mime
View raw message