[jboss-cvs] JBossAS SVN: r100372 - in branches/jaxrpc-cxf/webservices/src: resources/jbossws-jboss.deployer/META-INF and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 3 13:48:42 EST 2010


Author: alessio.soldano at jboss.com
Date: 2010-02-03 13:48:42 -0500 (Wed, 03 Feb 2010)
New Revision: 100372

Added:
   branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java
   branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java
   branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java
Modified:
   branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java
   branches/jaxrpc-cxf/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-2916] Setup classpath for ejb refs and servlet refs too


Added: branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java
===================================================================
--- branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java	                        (rev 0)
+++ branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java	2010-02-03 18:48:42 UTC (rev 100372)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.client.spec.ApplicationClientMetaData;
+import org.jboss.webservices.integration.util.ASHelper;
+
+/**
+ * A deployer for properly setting the classpath for jaxrpc client deployments;
+ * it's triggered by the ApplicationClientMetaData which is attached to the unit
+ * when a application-client.xml descriptor file is found in the deployment.
+ * This deployer then actually enables classpath modification when a jaxrpc-mapping
+ * is specified in the descriptor.
+ * 
+ * @author alessio.soldano at jboss.com
+ * @since 03-Feb-2010
+ *
+ */
+public class JAXRPCAppClientClassPathDeployer extends JAXRPCClientClassPathDeployer<ApplicationClientMetaData>
+{
+   public JAXRPCAppClientClassPathDeployer()
+   {
+      super(ApplicationClientMetaData.class);
+   }
+   
+   @Override
+   protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
+   {
+      ApplicationClientMetaData applicationClientMetaData = ASHelper.getRequiredAttachment(unit, ApplicationClientMetaData.class);
+      return hasJaxRpcMappingReference(applicationClientMetaData.getServiceReferences());
+   }
+}


Property changes on: branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java
===================================================================
--- branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java	2010-02-03 18:44:11 UTC (rev 100371)
+++ branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java	2010-02-03 18:48:42 UTC (rev 100372)
@@ -23,11 +23,8 @@
 
 import java.util.Iterator;
 
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.metadata.client.spec.ApplicationClientMetaData;
 import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
 import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
-import org.jboss.webservices.integration.util.ASHelper;
 
 /**
  * A deployer for properly setting the classpath for jaxrpc client deployments;
@@ -40,19 +37,16 @@
  * @since 03-Feb-2010
  *
  */
-public class JAXRPCClientClassPathDeployer extends JAXRPCIntegrationClassPathDeployer<ApplicationClientMetaData>
+public abstract class JAXRPCClientClassPathDeployer<T> extends JAXRPCIntegrationClassPathDeployer<T>
 {
-   public JAXRPCClientClassPathDeployer()
+   public JAXRPCClientClassPathDeployer(Class<T> input)
    {
-      super(ApplicationClientMetaData.class);
-      setInput(ApplicationClientMetaData.class); //makes the input mandatory instead of optional
+      super(input);
+      setInput(input); //makes the input mandatory instead of optional
    }
    
-   @Override
-   protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
+   protected static boolean hasJaxRpcMappingReference(ServiceReferencesMetaData serviceReferences)
    {
-      ApplicationClientMetaData applicationClientMetaData = ASHelper.getRequiredAttachment(unit, ApplicationClientMetaData.class);
-      ServiceReferencesMetaData serviceReferences = applicationClientMetaData.getServiceReferences();
       if (serviceReferences != null)
       {
          for (Iterator<ServiceReferenceMetaData> it = serviceReferences.iterator(); it.hasNext();)
@@ -66,4 +60,5 @@
       }
       return false;
    }
+   
 }

Added: branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java
===================================================================
--- branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java	                        (rev 0)
+++ branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java	2010-02-03 18:48:42 UTC (rev 100372)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import java.util.Iterator;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.ejb.spec.EjbJarMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData;
+import org.jboss.webservices.integration.util.ASHelper;
+
+/**
+ * A deployer for properly setting the classpath for jaxrpc client deployments;
+ * it's triggered by the ApplicationClientMetaData which is attached to the unit
+ * when a ejb-jar.xml descriptor file is found in the deployment.
+ * This deployer then actually enables classpath modification when a jaxrpc-mapping
+ * is specified in the descriptor.
+ * 
+ * @author alessio.soldano at jboss.com
+ * @since 03-Feb-2010
+ *
+ */
+public class JAXRPCEjbClientClassPathDeployer extends JAXRPCClientClassPathDeployer<EjbJarMetaData>
+{
+   public JAXRPCEjbClientClassPathDeployer()
+   {
+      super(EjbJarMetaData.class);
+   }
+   
+   @Override
+   protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
+   {
+      EjbJarMetaData ejbMetaData = ASHelper.getRequiredAttachment(unit, EjbJarMetaData.class);
+      EnterpriseBeansMetaData beansMetaData = ejbMetaData.getEnterpriseBeans();
+      if (beansMetaData != null)
+      {
+         for (Iterator<EnterpriseBeanMetaData> beanIt = beansMetaData.iterator(); beanIt.hasNext(); )
+         {
+            EnterpriseBeanMetaData beanMetaData = beanIt.next();
+            if (hasJaxRpcMappingReference(beanMetaData.getServiceReferences()))
+            {
+               return true;
+            }
+         }
+      }
+      return false;
+   }
+}


Property changes on: branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java
===================================================================
--- branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java	                        (rev 0)
+++ branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java	2010-02-03 18:48:42 UTC (rev 100372)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.web.spec.WebMetaData;
+import org.jboss.webservices.integration.util.ASHelper;
+
+/**
+ * A deployer for properly setting the classpath for jaxrpc client deployments;
+ * it's triggered by the ApplicationClientMetaData which is attached to the unit
+ * when a web.xml descriptor file is found in the deployment.
+ * This deployer then actually enables classpath modification when a jaxrpc-mapping
+ * is specified in the descriptor.
+ * 
+ * @author alessio.soldano at jboss.com
+ * @since 03-Feb-2010
+ *
+ */
+public class JAXRPCServletClientClassPathDeployer extends JAXRPCClientClassPathDeployer<WebMetaData>
+{
+   public JAXRPCServletClientClassPathDeployer()
+   {
+      super(WebMetaData.class);
+   }
+   
+   @Override
+   protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
+   {
+      WebMetaData webMetaData = ASHelper.getRequiredAttachment(unit, WebMetaData.class);
+      return hasJaxRpcMappingReference(webMetaData.getServiceReferences());
+   }
+}


Property changes on: branches/jaxrpc-cxf/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: branches/jaxrpc-cxf/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- branches/jaxrpc-cxf/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml	2010-02-03 18:44:11 UTC (rev 100371)
+++ branches/jaxrpc-cxf/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml	2010-02-03 18:48:42 UTC (rev 100372)
@@ -139,8 +139,12 @@
     <property name="provides">WebMetaData</property>
   </bean>
 
-  <bean name="JAXRPCClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCClientClassPathDeployer" />  
+  <bean name="JAXRPCAppClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCAppClientClassPathDeployer" />  
 
+  <bean name="JAXRPCEjbClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCEjbClientClassPathDeployer" />  
+
+  <bean name="JAXRPCServletClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCServletClientClassPathDeployer" />  
+
   <bean name="JAXRPCServerClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCServerClassPathDeployer" />  
 
 </deployment>




More information about the jboss-cvs-commits mailing list