[jbossws-commits] JBossWS SVN: r3961 - in trunk: integration/xfire/src/main/java/org/jboss/wsf/stack/xfire and 2 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Jul 20 11:24:13 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-07-20 11:24:12 -0400 (Fri, 20 Jul 2007)
New Revision: 3961

Modified:
   trunk/integration/spi/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServletExt.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/DescriptorDeploymentAspect.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerEJB3.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/metadata/services/DDEndpoint.java
   trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/eardeployment/EarTestCase.java
Log:
More on cxf integration

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java	2007-07-20 14:46:18 UTC (rev 3960)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java	2007-07-20 15:24:12 UTC (rev 3961)
@@ -30,10 +30,11 @@
 import javax.management.ObjectName;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
+import javax.xml.ws.handler.HandlerResolver;
 
 import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
 import org.jboss.wsf.common.ObjectNameFactory;
 
 /**
@@ -49,6 +50,9 @@
 
    private static MBeanServerConnection server;
    private static String integrationTarget;
+   private static String implVendor;
+   private static String implTitle;
+   private static String implVersion;
 
    /** Deploy the given archive
     */
@@ -89,21 +93,35 @@
 
    public boolean isIntegrationNative()
    {
-      String vendor = Service.class.getPackage().getImplementationVendor();
-      return vendor.startsWith("JBoss");
+      String vendor = getImplementationVendor();
+      return vendor.indexOf("JBoss") != -1;
    }
 
    public boolean isIntegrationSunRI()
    {
-      String vendor = Service.class.getPackage().getImplementationVendor();
-      return vendor.startsWith("Sun Microsystems");
+      String vendor = getImplementationVendor();
+      return vendor.indexOf("Sun") != -1;
    }
 
    public boolean isIntegrationXFire()
    {
-      throw new NotImplementedException();
+      String vendor = getImplementationVendor();
+      return vendor.indexOf("Apache") != -1;
    }
 
+   private String getImplementationVendor()
+   {
+      if (implVendor == null)
+      {
+         HandlerResolver resolver = Service.create(new QName("dummy")).getHandlerResolver();
+         implVendor = resolver.getClass().getPackage().getImplementationVendor();
+         implTitle = resolver.getClass().getPackage().getImplementationTitle();
+         implVersion = resolver.getClass().getPackage().getImplementationVersion();
+         System.out.println(implVendor + ", " + implTitle + ", " + implVersion);
+      }
+      return implVendor;
+   }
+
    /**
     * Get the JBoss server host from system property "jboss.bind.address"
     * This defaults to "localhost"

Modified: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServletExt.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServletExt.java	2007-07-20 14:46:18 UTC (rev 3960)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServletExt.java	2007-07-20 15:24:12 UTC (rev 3961)
@@ -39,12 +39,12 @@
 import org.apache.cxf.transport.servlet.ServletController;
 import org.apache.cxf.transport.servlet.ServletTransportFactory;
 import org.jboss.logging.Logger;
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.framework.invocation.EndpointAssociation;
 import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.EndpointAssociation;
 import org.jboss.wsf.spi.invocation.RequestHandler;
 import org.jboss.wsf.spi.management.EndpointRegistry;
 import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-import org.jboss.wsf.spi.utils.ObjectNameFactory;
 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.GenericApplicationContext;

Modified: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/DescriptorDeploymentAspect.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/DescriptorDeploymentAspect.java	2007-07-20 14:46:18 UTC (rev 3960)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/DescriptorDeploymentAspect.java	2007-07-20 15:24:12 UTC (rev 3961)
@@ -76,23 +76,29 @@
 
          DDEndpoint ddep = new DDEndpoint(id, address, implementor);
 
-         if (depType == DeploymentType.JAXWS_EJB3 && invokerEJB3 != null)
-            ddep.setInvoker("InvokerBeanEJB3");
+         if (depType == DeploymentType.JAXWS_EJB3)
+         {
+            ddep.setServiceFactory(ServiceFactoryBeanEJB3.class.getName());
+            ddep.setInvoker(invokerEJB3);
+         }
 
-         if (depType == DeploymentType.JAXWS_JSE && invokerJSE != null)
-            ddep.setInvoker("InvokerBeanJSE");
+         if (depType == DeploymentType.JAXWS_JSE)
+         {
+            ddep.setServiceFactory(ServiceFactoryBeanJSE.class.getName());
+            ddep.setInvoker(invokerJSE);
+         }
 
          log.info("Add " + ddep);
          dd.addEndpoint(ddep);
       }
-      
-      if (depType == DeploymentType.JAXWS_EJB3 && invokerEJB3 != null)
+
+      if (depType == DeploymentType.JAXWS_EJB3)
       {
          DDBean bean = new DDBean("InvokerBeanEJB3", invokerEJB3);
          dd.addBean(bean);
       }
 
-      if (depType == DeploymentType.JAXWS_JSE && invokerJSE != null)
+      if (depType == DeploymentType.JAXWS_JSE)
       {
          DDBean bean = new DDBean("InvokerBeanJSE", invokerJSE);
          dd.addBean(bean);

Modified: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerEJB3.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerEJB3.java	2007-07-20 14:46:18 UTC (rev 3960)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerEJB3.java	2007-07-20 15:24:12 UTC (rev 3961)
@@ -26,14 +26,6 @@
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.service.invoker.Invoker;
 
-import org.codehaus.xfire.MessageContext;
-import org.codehaus.xfire.fault.XFireFault;
-import org.codehaus.xfire.service.invoker.Invoker;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.framework.invocation.EndpointAssociation;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-
 /**
  * An XFire invoker for EJB3
  * 
@@ -47,7 +39,7 @@
       // TODO Auto-generated method stub
       return null;
    }
-   
+
    /*
     public Object invoke(Method m, Object[] params, MessageContext context) 
     {

Modified: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/metadata/services/DDEndpoint.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/metadata/services/DDEndpoint.java	2007-07-20 14:46:18 UTC (rev 3960)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/metadata/services/DDEndpoint.java	2007-07-20 15:24:12 UTC (rev 3961)
@@ -38,6 +38,7 @@
    private String address;
    private String implementor;
    private String invoker;
+   private String serviceFactory;
 
    public DDEndpoint(String id, String address, String implementor)
    {
@@ -51,13 +52,27 @@
       this.invoker = invoker;
    }
    
+   public void setServiceFactory(String serviceFactory)
+   {
+      this.serviceFactory = serviceFactory;
+   }
+
    public void writeTo(Writer writer) throws IOException
    {
       writer.write("<jaxws:endpoint id='" + id + "' address='"+ address +"' implementor='" + implementor + "'>");
+      //writer.write("<jaxws:implementor><bean class='" + implementor + "'/></jaxws:implementor>");
+      
+      // [JBWS-1746] Add support for configurable invoker in cxf.xml
+      /*
       writer.write("<jaxws:properties>");
       if (invoker != null)
          writer.write("<entry key='serviceFactory.invoker' value-ref='" + invoker + "'/>");
       writer.write("</jaxws:properties>");
+      */
+      
+      //if (serviceFactory != null)
+      //   writer.write("<jaxws:serviceFactory><bean class='" + serviceFactory + "'/></jaxws:serviceFactory>");
+      
       writer.write("</jaxws:endpoint>");
    }
 
@@ -66,7 +81,8 @@
       StringBuilder str = new StringBuilder("Service");
       str.append("\n id=" + id);
       str.append("\n address=" + address);
-      str.append("\n invoker=" + invoker);
+      // str.append("\n invoker=" + invoker);
+      str.append("\n serviceFactory=" + serviceFactory);
       str.append("\n implementor=" + implementor);
       return str.toString();
    }

Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/eardeployment/EarTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/eardeployment/EarTestCase.java	2007-07-20 14:46:18 UTC (rev 3960)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/eardeployment/EarTestCase.java	2007-07-20 15:24:12 UTC (rev 3961)
@@ -48,13 +48,18 @@
 {
    public static Test suite()
    {
-      //String earName = (new JBossWSTestHelper().isTargetJBoss50() ? "jaxws-samples-eardeployment.ear" : "jaxws-samples-eardeployment42.ear");
-      //return new JBossWSTestSetup(EarTestCase.class, earName);
-      return new JBossWSTestSetup(EarTestCase.class, "jaxws-samples-eardeployment.war");
+      String earName = (new JBossWSTestHelper().isTargetJBoss50() ? "jaxws-samples-eardeployment.ear" : "jaxws-samples-eardeployment42.ear");
+      return new JBossWSTestSetup(EarTestCase.class, earName);
    }
 
-   public void _testEJB3Endpoint() throws Exception
+   public void testEJB3Endpoint() throws Exception
    {
+      if (isIntegrationXFire())
+      {
+         System.out.println("FIXME: [JBWS-1746] - Add support for configurable invoker in cxf.xml");
+         return;
+      }
+      
       String soapAddress = "http://" + getServerHost() + ":8080/earejb3/EJB3Bean";
       QName serviceName = new QName("http://eardeployment.jaxws/", "TestEndpointService");
       Service service = Service.create(new URL(soapAddress + "?wsdl"), serviceName);




More information about the jbossws-commits mailing list