Author: thomas.diesler(a)jboss.com
Date: 2006-10-30 09:13:14 -0500 (Mon, 30 Oct 2006)
New Revision: 1330
Added:
trunk/src/main/java/org/jboss/ws/integration/jboss40/
trunk/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21MBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3MBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSEMBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSEMBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeploymentInfoAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossHttpServer.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossServiceEndpointPublisher.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossServiceEndpointServlet.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/PortComponentLinkServlet.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB21.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInterceptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerEJB21.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerMDB.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceRefMetaDataAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebMetaDataAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployerMBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/
trunk/src/main/java/org/jboss/ws/integration/jboss50/
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jbossall/
trunk/src/main/java/org/jboss/ws/integration/jbossall/ServerConfigImpl.java
trunk/src/main/resources/jbossws.deployer/
trunk/src/main/resources/jbossws.deployer/META-INF/
trunk/src/main/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml
Removed:
trunk/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossHttpServer.java
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java
trunk/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss/jms/
Modified:
trunk/.classpath
trunk/build.xml
trunk/src/ant/build-thirdparty.xml
trunk/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/JMSMessageDispatcher.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/JMSTransportSupport.java
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/MessageDispatcher.java
trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
trunk/src/main/resources/jbossws.sar/META-INF/jboss-service.xml
trunk/src/main/resources/jbossws14.sar/META-INF/jboss-service.xml
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java
Log:
Fix JBoss50 startup
Add VFS deployer template.
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2006-10-30 11:56:59 UTC (rev 1329)
+++ trunk/.classpath 2006-10-30 14:13:14 UTC (rev 1330)
@@ -29,5 +29,6 @@
<classpathentry kind="lib" path="thirdparty/jaxb-xjc.jar"/>
<classpathentry kind="lib" path="thirdparty/jaxb-impl.jar"/>
<classpathentry
sourcepath="/home/tdiesler/svn/jboss/common/common-core/trunk/src/main/java"
kind="lib" path="thirdparty/jboss-common.jar"/>
+ <classpathentry
sourcepath="/home/tdiesler/svn/jboss/jbossmc/trunk/deployers/src/main"
kind="lib" path="thirdparty/jboss-deployers.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2006-10-30 11:56:59 UTC (rev 1329)
+++ trunk/build.xml 2006-10-30 14:13:14 UTC (rev 1330)
@@ -53,6 +53,7 @@
<property name="jboss.server"
value="${jboss.home}/server/${jboss.server.instance}"/>
<property name="jboss.server.lib"
value="${jboss.server}/lib"/>
<property name="jboss.server.deploy"
value="${jboss.server}/deploy"/>
+ <property name="jboss.server.deployers"
value="${jboss.server}/deployers"/>
<property name="jboss.thirdparty"
value="${jboss.home}/../../../thirdparty"/>
<property name="tomcat.webapps.dir"
value="${tomcat.home}/webapps"/>
@@ -157,6 +158,8 @@
<javac srcdir="${src.java.dir}" sourcepath=""
destdir="${build.classes.dir}" debug="${javac.debug}"
verbose="${javac.verbose}"
deprecation="${javac.deprecation}"
failonerror="${javac.fail.onerror}">
<include name="org/jboss/ws/integration/**"/>
+ <!-- Exclude JBoss40 deployer interceptors -->
+ <exclude name="org/jboss/ws/integration/jboss40/**"/>
<classpath path="${build.classes14.dir}"/>
<classpath refid="integration.classpath"/>
</javac>
@@ -243,7 +246,8 @@
<jar jarfile="${build.lib.dir}/jbossws-jboss-integration.jar"
manifest="${build.etc.dir}/default.mf">
<fileset dir="${build.classes.dir}">
<include name="org/jboss/ws/integration/*.class"/>
- <include name="org/jboss/ws/integration/jboss/**"/>
+ <include name="org/jboss/ws/integration/jbossall/**"/>
+ <include name="org/jboss/ws/integration/jboss50/**"/>
</fileset>
</jar>
@@ -258,6 +262,11 @@
<mkdir dir="${build.lib.dir}/jbossws.beans/META-INF"/>
<copy todir="${build.lib.dir}/jbossws.beans/META-INF"
file="${build.resources.dir}/jbossws.beans/META-INF/jboss-beans.xml"/>
+ <!-- Build jbossws.beans -->
+ <mkdir dir="${build.lib.dir}/jbossws.deployer/META-INF"/>
+ <copy todir="${build.lib.dir}/jbossws.deployer/META-INF"
file="${build.resources.dir}/jbossws.deployer/META-INF/jbossws-deployer-beans.xml"/>
+ <copy todir="${build.lib.dir}/jbossws.deployer"
file="${build.lib.dir}/jbossws-jboss-integration.jar"/>
+
<!-- Build jbossws-client.jar -->
<jar jarfile="${build.lib.dir}/jbossws-client.jar"
manifest="${build.etc.dir}/default.mf">
<fileset dir="${build.classes.dir}">
@@ -516,6 +525,9 @@
<copy todir="${jboss.deploy.home}/client"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
<copy todir="${jboss.deploy.home}/lib"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
<copy todir="${jboss.deploy.home}/client"
file="${build.lib.dir}/${jbossws}-client.jar" overwrite="true"/>
+ <copy
todir="${jboss.deploy.home}/server/${jboss.server.instance}/deployers"
overwrite="true">
+ <fileset dir="${build.lib.dir}"
includes="jbossws.deployer/**"/>
+ </copy>
<delete
dir="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"/>
<mkdir
dir="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"/>
<unjar
dest="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"
src="${build.lib.dir}/${jbossws}.sar"/>
Modified: trunk/src/ant/build-thirdparty.xml
===================================================================
--- trunk/src/ant/build-thirdparty.xml 2006-10-30 11:56:59 UTC (rev 1329)
+++ trunk/src/ant/build-thirdparty.xml 2006-10-30 14:13:14 UTC (rev 1330)
@@ -38,6 +38,7 @@
<get
src="${jboss.repository}/jboss/common/${jboss-common}/lib/jboss-common.jar"
dest="${thirdparty.dir}/jboss-common.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-container.jar"
dest="${thirdparty.dir}/jboss-container.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-dependency.jar"
dest="${thirdparty.dir}/jboss-dependency.jar" usetimestamp="true"
verbose="true"/>
+ <get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-deployers.jar"
dest="${thirdparty.dir}/jboss-deployers.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-microcontainer.jar"
dest="${thirdparty.dir}/jboss-microcontainer.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/remoting/${jboss-remoting}/lib/jboss-remoting.jar"
dest="${thirdparty.dir}/jboss-remoting.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/jbossretro/${jboss-jbossretro}/lib/jbossretro.jar"
dest="${thirdparty.dir}/jbossretro.jar" usetimestamp="true"
verbose="true"/>
@@ -73,6 +74,7 @@
<pathelement location="${thirdparty.dir}/jboss-common.jar"/>
<pathelement location="${thirdparty.dir}/jboss-container.jar"/>
<pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-deployers.jar"/>
<pathelement
location="${thirdparty.dir}/jboss-microcontainer.jar"/>
<pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
<pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
@@ -94,8 +96,9 @@
<!-- The classpath for the jbossws core -->
<path id="jboss.core.classpath">
<pathelement location="${jboss.server.lib}/jboss-j2ee.jar"/>
- <pathelement
location="${jboss.server.deploy}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
- <pathelement
location="${jboss.server.deploy}/ejb3.deployer/jboss-ejb3x.jar"/>
+ <pathelement
location="${jboss.server.deployers}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
+ <pathelement
location="${jboss.server.deployers}/ejb3.deployer/jboss-ejb3x.jar"/>
+ <pathelement
location="${jboss.server.deployers}/ejb3.deployer/jboss-ejb3.jar"/>
</path>
<!-- The classpath for the jboss integration -->
@@ -106,11 +109,8 @@
<pathelement location="${jboss.lib}/jboss-system.jar"/>
<pathelement location="${jboss.server.lib}/jboss.jar"/>
<pathelement location="${jboss.client}/jbosssx-client.jar"/>
- <pathelement
location="${jboss.server.deploy}/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
- <pathelement
location="${jboss.server.deploy}/jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar"/>
- <pathelement
location="${jboss.server.deploy}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
- <pathelement
location="${jboss.server.deploy}/ejb3.deployer/jboss-ejb3.jar"/>
- <pathelement
location="${jboss.server.deploy}/ejb3.deployer/jboss-ejb3x.jar"/>
+ <pathelement
location="${jboss.server.deployers}/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+ <pathelement
location="${jboss.server.deployers}/jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar"/>
</path>
</target>
Modified: trunk/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java 2006-10-30
11:56:59 UTC (rev 1329)
+++ trunk/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -37,7 +37,9 @@
import org.jboss.ws.server.WSDLFilePublisher;
/**
- * The POJO deployer for web service endpoints
+ * The POJO deployer for web service endpoints. This Deployer is already decoupled from
the target
+ * container (i.e. JBoss, Tomcat). The containers deployer architecture should be used to
populate
+ * the UnifiedDeploymentInfo object.
*
* @author Thomas.Diesler(a)jboss.org
* @since 12-May-2006
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.BeanMetaData;
-import org.jboss.metadata.EjbPortComponentMetaData;
-import org.jboss.metadata.MessageDrivenMetaData;
-import org.jboss.metadata.SessionMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class ApplicationMetaDataAdaptor
-{
- public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(ApplicationMetaData apmd)
- {
- UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- buildUnifiedBeanMetaData(umd, apmd);
- umd.setConfigName(apmd.getConfigName());
- umd.setConfigFile(apmd.getConfigFile());
- umd.setWebServiceContextRoot(apmd.getWebServiceContextRoot());
- umd.setSecurityDomain(apmd.getSecurityDomain());
- //umd.setWsdlPublishLocationMap(apmd.getWsdlPublishLocationMap());
- return umd;
- }
-
- private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData metaData)
- {
- List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- Iterator it = metaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- BeanMetaData bmd = (BeanMetaData)it.next();
- UnifiedBeanMetaData ubmd = buildUnifiedBeanMetaData(bmd);
- if (ubmd != null)
- {
- beans.add(ubmd);
- }
- }
- umd.setEnterpriseBeans(beans);
- }
-
- private static UnifiedBeanMetaData buildUnifiedBeanMetaData(BeanMetaData bmd)
- {
- UnifiedBeanMetaData ubmd = null;
- if (bmd instanceof SessionMetaData)
- {
- ubmd = new UnifiedSessionMetaData();
- }
- else if (bmd instanceof MessageDrivenMetaData)
- {
- ubmd = new UnifiedMessageDrivenMetaData();
-
((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
- }
-
- if (ubmd != null)
- {
- ubmd.setEjbName(bmd.getEjbName());
- ubmd.setEjbClass(bmd.getEjbClass());
- ubmd.setServiceEndpoint(bmd.getServiceEndpoint());
- ubmd.setHome(bmd.getHome());
- ubmd.setLocalHome(bmd.getLocalHome());
- ubmd.setJndiName(bmd.getJndiName());
- ubmd.setLocalJndiName(bmd.getLocalJndiName());
-
- EjbPortComponentMetaData pcmd = bmd.getPortComponent();
- if (pcmd != null)
- {
- UnifiedEjbPortComponentMetaData upcmd = new
UnifiedEjbPortComponentMetaData();
- upcmd.setPortComponentName(pcmd.getPortComponentName());
- upcmd.setPortComponentURI(pcmd.getPortComponentURI());
- upcmd.setAuthMethod(pcmd.getAuthMethod());
- upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
- ubmd.setPortComponent(upcmd);
- }
- }
- return ubmd;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java 2006-10-30
11:56:59 UTC (rev 1329)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,184 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-//$Id: WebServiceDeployer.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.deployment.SubDeployerInterceptorSupport;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.mx.server.Invocation;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.ws.deployment.ServiceEndpointDeployer;
-import org.jboss.ws.deployment.ServiceEndpointPublisher;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.server.KernelLocator;
-
-/**
- * A deployer service that manages WS4EE compliant Web Services
- *
- * This service is called from the {@see org.jboss.ws.metadata.WebServiceInterceptor}
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Dimitris.Andreadis(a)jboss.org
- * @since 15-Jan-2005
- */
-public abstract class DeployerInterceptor extends SubDeployerInterceptorSupport
-{
- // The main deployer
- private MainDeployerMBean mainDeployer;
-
- /** Create the deployer service
- */
- protected void createService() throws Exception
- {
- mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class,
MainDeployerMBean.OBJECT_NAME, server);
- super.attach();
- }
-
- /** Destroy the deployer service
- */
- protected void destroyService()
- {
- super.detach();
- }
-
- /** Overwrite to create the webservice
- */
- protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- log.debug("create: " + di.url);
-
- Object retn = invokeNext(invocation);
-
- if (isWebserviceDeployment(di))
- {
- UnifiedDeploymentInfo udi = createUnifiedDeploymentInfo(di);
- di.context.put(UnifiedDeploymentInfo.class.getName(), udi);
- getServiceEndpointDeployer().create(udi);
- }
-
- return retn;
- }
-
- /** Overwrite to start the webservice
- */
- protected Object start(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- log.debug("start: " + di.url);
-
- Object retn = invokeNext(invocation);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- // late initialization of the web context loader
- if (di.metaData instanceof WebMetaData)
- {
- ClassLoader classLoader = ((WebMetaData)di.metaData).getContextLoader();
- udi.ucl = classLoader;
- }
-
- getServiceEndpointDeployer().start(udi);
- }
-
- return retn;
- }
-
- /** Overwrite to stop the webservice
- */
- protected Object stop(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- log.debug("stop: " + di.url);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- getServiceEndpointDeployer().stop(udi);
- }
-
- return invokeNext(invocation);
- }
-
- /** Overwrite to destroy the webservice
- */
- protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- log.debug("destroy: " + di.url);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- getServiceEndpointDeployer().destroy(udi);
- }
-
- return invokeNext(invocation);
- }
-
- protected ServiceEndpointDeployer getServiceEndpointDeployer()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
- return (ServiceEndpointDeployer)entry.getTarget();
- }
-
- protected ServiceEndpointPublisher getServiceEndpointPublisher()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointPublisher.BEAN_NAME);
- return (ServiceEndpointPublisher)entry.getTarget();
- }
-
- /** Return true if the deployment contains a web service endpoint
- */
- protected abstract boolean isWebserviceDeployment(DeploymentInfo di);
-
- protected abstract UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo
di) throws Throwable;
-
- protected UnifiedDeploymentInfo getServiceEndpointDeployment(DeploymentInfo di)
- {
- return
(UnifiedDeploymentInfo)di.context.get(UnifiedDeploymentInfo.class.getName());
- }
-
- /** Handle all webservice deployment exceptions.
- * You can either simply logs the problem and keep the EJB/WAR module
- * alive or undeploy properly.
- */
- protected void handleStartupException(DeploymentInfo di, Throwable th)
- {
- log.error("Cannot startup webservice for: " + di.shortName, th);
- mainDeployer.undeploy(di);
- }
-
- /** Handle all webservice deployment exceptions.
- *
- * You can either simply logs the problem and keep the EJB/WAR module
- * alive or undeploy properly.
- */
- protected void handleShutdownException(String moduleName, Throwable th)
- {
- log.error("Cannot shutdown webservice for: " + moduleName, th);
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-//$Id: WebServiceDeployerEJB.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.mx.server.Invocation;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
-
-/**
- * A deployer service that manages WS4EE compliant Web-Services for EJB Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public abstract class DeployerInterceptorEJB extends DeployerInterceptor
-{
- protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- Object retObj = super.create(invocation, di);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- UnifiedMetaData wsMetaData =
getServiceEndpointDeployer().getUnifiedMetaData(udi);
- udi.localUrl = generateWebDeployment(di, wsMetaData);
- udi.context.put(DeploymentInfo.class.getName(), di);
- getServiceEndpointPublisher().publishServiceEndpoint(udi);
- }
-
- return retObj;
- }
-
- protected abstract URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData
wsMetaData) throws IOException;
-
- protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- getServiceEndpointPublisher().destroyServiceEndpoint(udi);
- }
-
- return super.destroy(invocation, di);
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,119 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-//$Id: WebServiceDeployerEJB21.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Iterator;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.BeanMetaData;
-import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JSR109Deployment;
-import org.jboss.ws.deployment.JSR181Deployment;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
-
-/**
- * A deployer service that manages WS4EE compliant Web-Services for EJB-2.1 Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public class DeployerInterceptorEJB21 extends DeployerInterceptorEJB implements
DeployerInterceptorEJB21MBean
-{
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
- {
- UnifiedDeploymentInfo udi;
- URL webservicesURL = getWebservicesDescriptor(di);
- if (webservicesURL != null)
- {
- udi = new JSR109Deployment(UnifiedDeploymentInfo.DeploymentType.JSR109_EJB21,
webservicesURL);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
- }
- else
- {
- udi = new JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB21);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
- }
- return udi;
- }
-
- /** Return true if the deployment is a web service endpoint
- */
- protected boolean isWebserviceDeployment(DeploymentInfo di)
- {
- ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
- boolean isWebserviceDeployment = applMetaData.isWebServiceDeployment();
-
- // Check if we have a webservices.xml descriptor
- if (isWebserviceDeployment == false)
- {
- isWebserviceDeployment = getWebservicesDescriptor(di) != null;
- }
-
- // Check if the ejb-jar contains annotated endpoints
- if (isWebserviceDeployment == false)
- {
- try
- {
- Iterator itBeans = applMetaData.getEnterpriseBeans();
- while (itBeans.hasNext() && isWebserviceDeployment == false)
- {
- BeanMetaData beanMetaData = (BeanMetaData)itBeans.next();
- String ejbClassName = beanMetaData.getEjbClass();
- Class ejbClass = di.annotationsCl.loadClass(ejbClassName);
- isWebserviceDeployment =
ejbClass.isAnnotationPresent(javax.jws.WebService.class);
- }
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new WSException(e);
- }
- }
-
- applMetaData.setWebServiceDeployment(isWebserviceDeployment);
- return isWebserviceDeployment;
- }
-
- /**
- * Get the resource name of the webservices.xml descriptor.
- */
- protected URL getWebservicesDescriptor(DeploymentInfo di)
- {
- return di.localCl.findResource("META-INF/webservices.xml");
- }
-
- protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
- {
- ServiceEndpointGeneratorEJB21 generator = new ServiceEndpointGeneratorEJB21();
- return generator.generatWebDeployment(di, wsMetaData);
- }
-
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,37 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface DeployerInterceptorEJB21MBean extends SubDeployerInterceptorMBean
-{
- //default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB21");
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id: WebServiceDeployerEJB3.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-
-import javax.jws.WebService;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.ejb3.Ejb3ModuleMBean;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JSR181Deployment;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-
-/**
- * A deployer service that manages WS4EE compliant Web-Services for EJB3 Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-May-2005
- */
-public class DeployerInterceptorEJB3 extends DeployerInterceptorEJB implements
DeployerInterceptorEJB3MBean
-{
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
- {
- UnifiedDeploymentInfo udi = new
JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB3);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
-
- Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
-
- // The container objects below provide access to all of the ejb metadata
- ArrayList<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- for (Object container : ejb3Module.getContainers().values())
- {
- if (container instanceof StatelessContainer)
- {
- StatelessContainer slc = (StatelessContainer)container;
- UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
- uslc.setEjbName(slc.getEjbName());
- uslc.setEjbClass(slc.getBeanClassName());
- beans.add(uslc);
- }
- }
-
- UnifiedApplicationMetaData appMetaData = new UnifiedApplicationMetaData();
- appMetaData.setEnterpriseBeans(beans);
- udi.metaData = appMetaData;
-
- return udi;
- }
-
- /** Return true if the deployment is a web service endpoint
- */
- protected boolean isWebserviceDeployment(DeploymentInfo di)
- {
- boolean isWebserviceDeployment = false;
-
- // Check if the ejb3 contains annotated endpoints
- Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
- for (Object manager : ejb3Module.getContainers().values())
- {
- if (manager instanceof StatelessContainer)
- {
- StatelessContainer container = (StatelessContainer)manager;
- if (container.resolveAnnotation(WebService.class) != null)
- {
- isWebserviceDeployment = true;
- break;
- }
- }
- }
-
- return isWebserviceDeployment;
- }
-
- private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
- {
- Ejb3ModuleMBean ejb3Module;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
- if (ejb3Module == null)
- throw new WSException("Cannot obtain EJB3 module: " + objectName);
-
- return ejb3Module;
- }
- catch (MBeanProxyCreationException ex)
- {
- throw new WSException("Cannot obtain proxy to EJB3 module");
- }
- }
-
- protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
- {
- return new ServiceEndpointGeneratorEJB3().generatWebDeployment(di, wsMetaData);
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,37 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface DeployerInterceptorEJB3MBean extends SubDeployerInterceptorMBean
-{
- //default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB3");
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,173 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id: WebServiceDeployerJSE.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.mx.server.Invocation;
-import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JAXWSDeployment;
-import org.jboss.ws.deployment.JSR109Deployment;
-import org.jboss.ws.deployment.JSR181Deployment;
-import org.jboss.ws.deployment.ServiceEndpointPublisher;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-
-/**
- * A deployer service that manages WS4EE compliant Web Services for WAR
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public class DeployerInterceptorJSE extends DeployerInterceptor implements
DeployerInterceptorJSEMBean
-{
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
- {
- UnifiedDeploymentInfo udi;
-
- DeploymentType type =
(DeploymentType)di.context.get("UnifiedDeploymentInfo.Type");
- if (type == UnifiedDeploymentInfo.DeploymentType.JSR109_JSE)
- {
- URL webservicesURL = getWebservicesDescriptor(di);
- udi = new JSR109Deployment(UnifiedDeploymentInfo.DeploymentType.JSR109_JSE,
webservicesURL);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
-
- }
- else if (type == UnifiedDeploymentInfo.DeploymentType.JSR181_JSE)
- {
- udi = new JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_JSE);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
- }
- else if (type == UnifiedDeploymentInfo.DeploymentType.JAXWS_PROVIDER_JSE)
- {
- udi = new
JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_PROVIDER_JSE);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
- }
- else
- {
- throw new WSException("Unexpected type: " + type);
- }
-
- return udi;
- }
-
- /** Overwrite to create the webservice
- *
- * This implemantation modifies the servlet entries in web.xml
- */
- protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- Object retn = super.create(invocation, di);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- ServiceEndpointPublisher endpointPublisher = getServiceEndpointPublisher();
- Map<String, String> sepTargetMap =
endpointPublisher.rewriteWebXML(udi.localUrl);
- updateServiceEndpointTargetBeans(udi, sepTargetMap);
- }
- return retn;
- }
-
- private void updateServiceEndpointTargetBeans(UnifiedDeploymentInfo udi,
Map<String, String> sepTargetMap)
- {
- UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
-
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String targetBean = sepTargetMap.get(sepMetaData.getLinkName());
- sepMetaData.setServiceEndpointImplName(targetBean);
- }
- }
- }
-
- /** Return true if the deployment is a web service endpoint
- */
- protected boolean isWebserviceDeployment(DeploymentInfo di)
- {
- WebMetaData webMetaData = (WebMetaData)di.metaData;
- boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
-
- // Check if we have a webservices.xml descriptor
- if (isWebserviceDeployment == false)
- {
- if (getWebservicesDescriptor(di) != null)
- {
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JSR109_JSE);
- isWebserviceDeployment = true;
- }
- }
-
- // Check if the web.xml contains annotated endpoint impl
- if (isWebserviceDeployment == false)
- {
- Map servletClassMap = webMetaData.getServletClassMap();
- Iterator<String> it = servletClassMap.values().iterator();
- while (it.hasNext() && isWebserviceDeployment == false)
- {
- String servletClassName = it.next();
- try
- {
- Class servletClass = di.annotationsCl.loadClass(servletClassName);
- if (servletClass.isAnnotationPresent(javax.jws.WebService.class))
- {
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JSR181_JSE);
- isWebserviceDeployment = true;
- }
- if
(servletClass.isAnnotationPresent(javax.xml.ws.WebServiceProvider.class))
- {
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXWS_PROVIDER_JSE);
- isWebserviceDeployment = true;
- }
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + servletClassName);
- }
- }
- }
-
- webMetaData.setWebServiceDeployment(isWebserviceDeployment);
- return isWebserviceDeployment;
- }
-
- /**
- * Get the resource name of the webservices.xml descriptor.
- */
- protected URL getWebservicesDescriptor(DeploymentInfo di)
- {
- return di.localCl.findResource("WEB-INF/webservices.xml");
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,37 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface DeployerInterceptorJSEMBean extends SubDeployerInterceptorMBean
-{
- //default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerJSE");
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,132 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id: WebServiceDeployerNestedJSE.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com
$
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.deployment.SubDeployerSupport;
-import org.jboss.system.server.ServerConfig;
-import org.jboss.system.server.ServerConfigLocator;
-import org.jboss.ws.utils.IOUtils;
-
-/**
- * A deployer service that manages WS4EE compliant Web Services for
- * nested POJO endpoints.
- *
- * The WebServiceDeployerJSE attaches itself as an deployment interceptor to
- * the jboss.web:service=WebServer deployer. As a consequence, all *.war deployments
- * that are picked up before the interceptor is installed are not treated as potential
- * web service endpoint deployments.
- *
- * Nested POJO endpoints can be packaged in *.jse deployments that are then picked up by
this
- * deployer.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Mar-2005
- */
-public class DeployerInterceptorNestedJSE extends SubDeployerSupport implements
DeployerInterceptorNestedJSEMBean
-{
- private static final String NESTED_JSE_WAR_FILE =
"org.jboss.ws.server.nested.jse";
-
- // The MainDeployer
- protected MainDeployerMBean mainDeployer;
-
- public void setMainDeployer(MainDeployerMBean mainDeployer)
- {
- this.mainDeployer = mainDeployer;
- }
-
- public boolean accepts(DeploymentInfo sdi)
- {
- setSuffixes(new String[] { ".jse" });
- return super.accepts(sdi);
- }
-
- /** Copy the *.jse to a *.war and deploy through the main deployer
- */
- public void create(DeploymentInfo di) throws DeploymentException
- {
- log.debug("create: " + di.url);
-
- try
- {
- File jseFile = new File(di.localUrl.getFile());
- if (jseFile.isFile() == false)
- throw new DeploymentException("Expected a file: " + di.localUrl);
-
- ServerConfig config = ServerConfigLocator.locate();
- String warFileName = config.getServerTempDir().getCanonicalPath() +
"/deploy/" + di.shortName;
- warFileName = warFileName.substring(0, warFileName.length() - 4) +
".war";
- File warFile = new File(warFileName);
-
- FileOutputStream fos = new FileOutputStream(warFile);
- FileInputStream fis = new FileInputStream(jseFile);
- try
- {
- IOUtils.copyStream(fos, fis);
- }
- finally
- {
- fos.close();
- fis.close();
- }
-
- mainDeployer.deploy(warFile.toURL());
-
- // remember the war url that we deployed
- di.context.put(NESTED_JSE_WAR_FILE, warFile);
-
- super.create(di);
- }
- catch (IOException ex)
- {
- throw new DeploymentException("Failed to create: " + di.url, ex);
- }
- }
-
- /** Undeploy the *.war through the main deployer
- */
- public void destroy(DeploymentInfo di) throws DeploymentException
- {
- log.debug("destroy: " + di.url);
- try
- {
- File warFile = (File)di.context.get(NESTED_JSE_WAR_FILE);
- mainDeployer.undeploy(warFile.toURL());
- warFile.delete();
-
- super.destroy(di);
- }
- catch (IOException ex)
- {
- throw new DeploymentException("Failed to destroy: " + di.url, ex);
- }
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,42 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id: WebServiceDeployerNestedJSEMBean.java 296 2006-05-08 19:45:49Z
thomas.diesler(a)jboss.com $
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.deployment.SubDeployerMBean;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Mar-2005
- */
-public interface DeployerInterceptorNestedJSEMBean extends SubDeployerMBean
-{
- //default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerNestedJSE");
-
- void setMainDeployer(MainDeployerMBean mainDeployer);
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id: WebServiceDeploymentAdaptor.java 317 2006-05-14 17:16:59Z
thomas.diesler(a)jboss.com $
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-
-/**
- * Build container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class DeploymentInfoAdaptor
-{
- public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
DeploymentInfo di)
- {
- if (di.parent != null)
- {
- udi.parent = new UnifiedDeploymentInfo(null);
- buildDeploymentInfo(udi.parent, di.parent);
- }
-
- udi.shortName = di.shortName;
- udi.url = di.url;
- udi.localUrl = di.localUrl;
- udi.metaData = buildMetaData(di.metaData);
- udi.annotationsCl = di.annotationsCl;
- udi.localCl = di.localCl;
- udi.ucl = di.ucl;
- udi.deployedObject = di.deployedObject;
-
- return udi;
- }
-
- private static Object buildMetaData(Object metaData)
- {
- Object retMetaData = null;
- if (metaData instanceof WebMetaData)
- {
- retMetaData =
WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
- }
- else if (metaData instanceof ApplicationMetaData)
- {
- retMetaData =
ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData((ApplicationMetaData)metaData);
- }
- return retMetaData;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/JBossHttpServer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/JBossHttpServer.java 2006-10-30
11:56:59 UTC (rev 1329)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss/JBossHttpServer.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,230 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-//$Id$
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Map;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.xml.ws.Endpoint;
-
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.WSException;
-import org.jboss.ws.server.HttpContext;
-import org.jboss.ws.server.HttpServer;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
-import org.w3c.dom.Element;
-
-/**
- * A Tomcat HTTP Server
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jul-2006
- */
-public class JBossHttpServer extends HttpServer
-{
- private static final String MAIN_DEPLOYER =
"jboss.system:service=MainDeployer";
-
- /** Start an instance of this HTTP server */
- @Override
- public void start()
- {
- // verify required properties
- }
-
- /** Create an HTTP context */
- public HttpContext createContext(String contextRoot)
- {
- return new HttpContext(this, contextRoot);
- }
-
- /** Publish an JAXWS endpoint to the HTTP server */
- @Override
- public void publish(HttpContext context, Endpoint endpoint)
- {
- Class implClass = getImplementorClass(endpoint);
- String implName = implClass.getName();
-
- try
- {
- Element webDoc = createWebAppDescriptor(context, endpoint);
- Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
-
- File tmpWar = null;
- try
- {
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig serverConfig = factory.getServerConfig();
- File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() +
"/jbossws");
-
- String deploymentName =
implName.substring(implName.lastIndexOf(".") + 1);
- tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
- tmpWar.delete();
- File webInf = new File(tmpWar, "WEB-INF");
- webInf.mkdirs();
-
- File webXml = new File(webInf, "web.xml");
- FileWriter fw = new FileWriter(webXml);
- new DOMWriter(fw).setPrettyprint(true).print(webDoc);
- fw.close();
-
- File jbossWebXml = new File(webInf, "jboss-web.xml");
- fw = new FileWriter(jbossWebXml);
- new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
- fw.close();
- }
- catch (IOException e)
- {
- throw new WSException("Failed to create webservice war", e);
- }
-
- Map<String, Object> epProps = endpoint.getProperties();
- epProps.put("jbossws-endpoint-war-url", tmpWar);
-
- URL tmpURL = tmpWar.toURL();
- MBeanServerConnection server = getServer();
- server.invoke(new ObjectName(MAIN_DEPLOYER), "deploy", new Object[] {
tmpURL }, new String[] { "java.net.URL" });
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException(ex);
- }
- }
-
- /** Destroys an JAXWS endpoint on the HTTP server */
- @Override
- public void destroy(HttpContext context, Endpoint endpoint)
- {
- Map<String, Object> epProps = endpoint.getProperties();
- File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
- if (tmpWar == null)
- throw new IllegalStateException("Cannot find endpoint war property");
-
- try
- {
- URL tmpURL = tmpWar.toURL();
- MBeanServerConnection server = getServer();
- server.invoke(new ObjectName(MAIN_DEPLOYER), "undeploy", new Object[]
{ tmpURL }, new String[] { "java.net.URL" });
-
- tmpWar.delete();
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException(ex);
- }
- }
-
- private Class getImplementorClass(Endpoint endpoint)
- {
- Object implementor = endpoint.getImplementor();
- Class implClass = (implementor instanceof Class ? (Class)implementor :
implementor.getClass());
- return implClass;
- }
-
- private MBeanServerConnection getServer() throws NamingException
- {
- InitialContext iniCtx = new InitialContext();
- MBeanServerConnection server =
(MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
- return server;
- }
-
- private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
- {
- Class implClass = getImplementorClass(endpoint);
- String implName = implClass.getName();
-
- Element webApp = DOMUtils.createElement("web-app");
-
- /*
- <servlet>
- <servlet-name>
- <servlet-class>
- </servlet>
- */
- Element servlet =
(Element)webApp.appendChild(DOMUtils.createElement("servlet"));
- Element servletName =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
- Element servletClass =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
- servletClass.appendChild(DOMUtils.createTextNode(implName));
-
- /*
- <servlet-mapping>
- <servlet-name>
- <url-pattern>
- </servlet-mapping>
- */
- Element servletMapping =
(Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
- servletName =
(Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
- Element urlPatternElement =
(Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
-
- String urlPattern = "/*";
- urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
-
- // Add security-constraint in generated web.xml for Endpoint API
- // FIXME: JBWS-1069
-
- return webApp;
- }
-
- private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
- {
- /* Create a jboss-web
- <jboss-web>
- <security-domain>java:/jaas/cts</security-domain>
- <context-root>/ws/ejbN/</context-root>
- </jboss-web>
- */
- Element jbossWeb = DOMUtils.createElement("jboss-web");
-
- // Get the context root for this deployment
- String contextRoot = context.getContextRoot();
- if (contextRoot == null)
- throw new WSException("Cannot obtain context root");
-
- Element root =
(Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
- root.appendChild(DOMUtils.createTextNode(contextRoot));
-
- // Add security-constraint in generated web.xml for Endpoint API
- // FIXME: JBWS-1069
-
- return jbossWeb;
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
-
-import java.net.URL;
-
-import javax.management.MBeanServer;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.deployment.ServiceEndpointPublisher;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-
-/**
- * Publish the HTTP service endpoint to Tomcat
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class JBossServiceEndpointPublisher extends ServiceEndpointPublisher
-{
-
- public String publishServiceEndpoint(URL warURL) throws Exception
- {
- rewriteWebXML(warURL);
- getMainDeployer().deploy(warURL);
- return "OK";
- }
-
- public String destroyServiceEndpoint(URL warURL) throws Exception
- {
- getMainDeployer().undeploy(warURL);
- return "OK";
- }
-
- public String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
- {
- URL warURL = udi.localUrl;
- DeploymentInfo di =
(DeploymentInfo)udi.context.get(DeploymentInfo.class.getName());
- if (di == null)
- throw new IllegalStateException("Cannot obtain DeploymentInfo from
context");
-
- rewriteWebXML(warURL);
-
- // Preserve the repository config
- DeploymentInfo auxdi = new DeploymentInfo(warURL, null,
MBeanServerLocator.locateJBoss());
- auxdi.repositoryConfig = di.getTopRepositoryConfig();
- getMainDeployer().deploy(auxdi);
- return "OK";
- }
-
- public String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
- {
- return destroyServiceEndpoint(udi.localUrl);
- }
-
- private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- MainDeployerMBean mainDeployer =
(MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME,
server);
- return mainDeployer;
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id: ServiceEndpointServlet.java 296 2006-05-08 19:45:49Z thomas.diesler(a)jboss.com $
-
-import java.util.List;
-
-import javax.servlet.ServletContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.StandardEndpointServlet;
-
-/**
- * A servlet that is installed for every web service endpoint.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-May-2006
- */
-public class JBossServiceEndpointServlet extends StandardEndpointServlet
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(JBossServiceEndpointServlet.class);
-
- /** Initialize the service endpoint
- */
- protected void initServiceEndpoint(String contextPath)
- {
- super.initServiceEndpoint(contextPath);
-
- ServiceEndpoint wsEndpoint = epManager.getServiceEndpointByID(sepId);
- if (wsEndpoint == null)
- throw new WSException("Cannot obtain endpoint for: " + sepId);
-
- // read the config name/file from web.xml
- ServletContext ctx = getServletContext();
- String configName = ctx.getInitParameter("jbossws-config-name");
- String configFile = ctx.getInitParameter("jbossws-config-file");
- if (configName != null || configFile != null)
- {
- log.debug("Updating service endpoint config\n config-name: " +
configName + "\n config-file: " + configFile);
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- sepMetaData.setConfigName(configName);
- sepMetaData.setConfigFile(configFile);
-
- List<HandlerMetaData> sepHandlers =
sepMetaData.getHandlers(HandlerType.ENDPOINT);
- sepMetaData.clearHandlers();
-
- // Add pre handlers
- WSCommonConfig sepConfig = sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.PRE));
-
- // Restore the endpoint handlers
- sepMetaData.addHandlers(sepHandlers);
-
- // Add post handlers
- sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.POST));
-
- log.debug("Updated server meta data" + sepMetaData);
- }
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
-
-/**
- * A servlet that reports the serviceURL for a given service ID.
- * <p/>
- * When the web service client ENC is setup, it may contain port-component-link
- * entries that point to service endpoints in the same top level deployment.
- * The final serviceURL of those endpoints will become available after the
- * reference to the javax.xml.rpc.Service is bound to JNDI.
- * <p/>
- * When the client does a lookup of the javax.xml.rpc.Service from JNDI the
ObjectFactory
- * will contact this servlet for the final serviceURL. It is acceptable that the client
- * wsdl does not contain the correct serviceURL if the client is using the
port-component-link element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 29-May-2004
- */
-public class PortComponentLinkServlet extends HttpServlet
-{
- // provide logging
- private static final Logger log = Logger.getLogger(PortComponentLinkServlet.class);
-
- protected ServiceEndpointManager epManager;
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- epManager = factory.getServiceEndpointManager();
- }
-
- /**
- * Get the serviceURL as string for a given serviceID.
- */
- public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- String pcLink = req.getParameter("pcLink");
- if (pcLink == null)
- throw new IllegalArgumentException("Cannot obtain request parameter
'pcLink'");
-
- ServiceEndpoint serviceEndpoint = epManager.resolvePortComponentLink(pcLink);
- ;
- if (serviceEndpoint == null)
- throw new WSException("Cannot resolve port-component-link: " +
pcLink);
-
- res.setContentType("text/plain");
- PrintWriter out = res.getWriter();
-
- String endpointAddress =
serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
- out.println(endpointAddress);
-
- log.debug("Resolved " + pcLink + " to: " + endpointAddress);
- out.close();
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java 2006-10-30
11:56:59 UTC (rev 1329)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-//$Id: ServiceEndpointManagerFactoryImpl.java 294 2006-05-08 16:33:42Z
thomas.diesler(a)jboss.com $
-
-import java.io.File;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * JBoss specific implementation of a ServerConfig
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ServerConfigImpl implements ServerConfig
-{
- public File getServerTempDir()
- {
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getServerDataDir()
- {
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,274 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-//$Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.logging.Logger;
-import org.jboss.system.server.ServerConfig;
-import org.jboss.system.server.ServerConfigLocator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.w3c.dom.Element;
-
-/**
- * Generate a web deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public abstract class ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB.class);
-
- public URL generatWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData) throws
IOException
- {
- // Collect the list of PortComponentMetaData
- List<EndpointMetaData> epMetaDataList = new
ArrayList<EndpointMetaData>();
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- epMetaDataList.add(epMetaData);
- }
- }
-
- Element webDoc = createWebAppDescriptor(di, epMetaDataList);
- Element jbossDoc = createJBossWebAppDescriptor(di, epMetaDataList);
-
- File tmpWar = null;
- try
- {
- ServerConfig config = ServerConfigLocator.locate();
- File tmpdir = new File(config.getServerTempDir().getCanonicalPath() +
"/deploy");
-
- String deploymentName = di.getCanonicalName().replace('/', '-')
+ "-ws";
- tmpWar = File.createTempFile(deploymentName, ".war", tmpdir);
- tmpWar.delete();
- File webInf = new File(tmpWar, "WEB-INF");
- webInf.mkdirs();
-
- File webXml = new File(webInf, "web.xml");
- FileWriter fw = new FileWriter(webXml);
- new DOMWriter(fw).setPrettyprint(true).print(webDoc);
- fw.close();
-
- File jbossWebXml = new File(webInf, "jboss-web.xml");
- fw = new FileWriter(jbossWebXml);
- new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
- fw.close();
- }
- catch (IOException e)
- {
- throw new WSException("Failed to create webservice.war", e);
- }
-
- return tmpWar.toURL();
- }
-
- private Element createWebAppDescriptor(DeploymentInfo di, List<EndpointMetaData>
epMetaDataList)
- {
- Element webApp = DOMUtils.createElement("web-app");
-
- /*
- <servlet>
- <servlet-name>
- <servlet-class>
- </servlet>
- */
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String ejbName = sepMetaData.getLinkName();
- Element servlet =
(Element)webApp.appendChild(DOMUtils.createElement("servlet"));
- Element servletName =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode(ejbName));
- Element servletClass =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
- String targetBean = sepMetaData.getServiceEndpointImplName();
- String seiName = sepMetaData.getServiceEndpointInterfaceName();
- String servletClassName = (targetBean != null ? targetBean : seiName);
- servletClass.appendChild(DOMUtils.createTextNode(servletClassName));
- }
-
- /*
- <servlet-mapping>
- <servlet-name>
- <url-pattern>
- </servlet-mapping>
- */
- ArrayList urlPatters = new ArrayList();
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String ejbName = sepMetaData.getLinkName();
- Element servletMapping =
(Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
- Element servletName =
(Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode(ejbName));
- Element urlPatternElement =
(Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
-
- String urlPattern = "/*";
- if (sepMetaData.getURLPattern() != null)
- {
- urlPattern = sepMetaData.getURLPattern();
- }
-
- if (urlPatters.contains(urlPattern))
- throw new IllegalArgumentException("Cannot use the same url-pattern with
different endpoints, " + "check your <port-component-uri> in
jboss.xml");
-
- urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
- urlPatters.add(urlPattern);
- }
-
- String authMethod = null;
-
- // Add web-app/security-constraint for each port component
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String ejbName = sepMetaData.getLinkName();
- if (sepMetaData.getAuthMethod() != null || sepMetaData.getTransportGuarantee()
!= null)
- {
- /*
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>TestUnAuthPort</web-resource-name>
- <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>*</role-name>
- </auth-constraint>
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
- */
- Element securityConstraint =
(Element)webApp.appendChild(DOMUtils.createElement("security-constraint"));
- Element wrc =
(Element)securityConstraint.appendChild(DOMUtils.createElement("web-resource-collection"));
- Element wrName =
(Element)wrc.appendChild(DOMUtils.createElement("web-resource-name"));
- wrName.appendChild(DOMUtils.createTextNode(ejbName));
- Element pattern =
(Element)wrc.appendChild(DOMUtils.createElement("url-pattern"));
- String uri = sepMetaData.getURLPattern();
- pattern.appendChild(DOMUtils.createTextNode(uri));
- Element method =
(Element)wrc.appendChild(DOMUtils.createElement("http-method"));
- method.appendChild(DOMUtils.createTextNode("GET"));
- method =
(Element)wrc.appendChild(DOMUtils.createElement("http-method"));
- method.appendChild(DOMUtils.createTextNode("POST"));
-
- // Optional auth-constraint
- if (sepMetaData.getAuthMethod() != null)
- {
- // Only the first auth-method gives the war login-config/auth-method
- if (authMethod == null)
- authMethod = sepMetaData.getAuthMethod();
-
- Element authConstraint =
(Element)securityConstraint.appendChild(DOMUtils.createElement("auth-constraint"));
- Element roleName =
(Element)authConstraint.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode("*"));
- }
- // Optional user-data-constraint
- if (sepMetaData.getTransportGuarantee() != null)
- {
- Element userData =
(Element)securityConstraint.appendChild(DOMUtils.createElement("user-data-constraint"));
- Element transport =
(Element)userData.appendChild(DOMUtils.createElement("transport-guarantee"));
-
transport.appendChild(DOMUtils.createTextNode(sepMetaData.getTransportGuarantee()));
- }
- }
- }
-
- // Optional login-config/auth-method
- if (authMethod != null)
- {
- Element loginConfig =
(Element)webApp.appendChild(DOMUtils.createElement("login-config"));
- Element method =
(Element)loginConfig.appendChild(DOMUtils.createElement("auth-method"));
- method.appendChild(DOMUtils.createTextNode(authMethod));
- Element realm =
(Element)loginConfig.appendChild(DOMUtils.createElement("realm-name"));
- realm.appendChild(DOMUtils.createTextNode("EJBServiceEndpointServlet
Realm"));
-
- addEJBSecurityRoles(di, webApp);
- }
-
- return webApp;
- }
-
- private Element createJBossWebAppDescriptor(DeploymentInfo di,
List<EndpointMetaData> epMetaDataList)
- {
- /* Create a jboss-web
- <jboss-web>
- <security-domain>java:/jaas/cts</security-domain>
- <context-root>/ws/ejbN/</context-root>
- </jboss-web>
- */
- Element jbossWeb = DOMUtils.createElement("jboss-web");
-
- UnifiedMetaData wsMetaData =
epMetaDataList.get(0).getServiceMetaData().getUnifiedMetaData();
- String securityDomain = wsMetaData.getSecurityDomain();
- if (securityDomain != null)
- {
- Element secDomain =
(Element)jbossWeb.appendChild(DOMUtils.createElement("security-domain"));
- secDomain.appendChild(DOMUtils.createTextNode("java:/jaas/" +
securityDomain));
- }
-
- // Get the context root for this deployment
- String contextRoot = null;
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String next = sepMetaData.getContextRoot();
- if (next != null)
- {
- if (contextRoot == null)
- {
- contextRoot = next;
- }
- else if (contextRoot.equals(next) == false)
- {
- throw new WSException("Multiple context root not supported");
- }
- }
- }
- if (contextRoot == null)
- throw new WSException("Cannot obtain context root");
-
- Element root =
(Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
- root.appendChild(DOMUtils.createTextNode(contextRoot));
-
- return jbossWeb;
- }
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected abstract void addEJBSecurityRoles(DeploymentInfo di, Element webApp);
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-//$Id$
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.AssemblyDescriptorMetaData;
-import org.jboss.ws.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB21 extends ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
- {
- // Fix:
http://jira.jboss.org/jira/browse/JBWS-309
- ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
- AssemblyDescriptorMetaData assemblyDescriptor =
applMetaData.getAssemblyDescriptor();
- if (assemblyDescriptor != null)
- {
- Map securityRoles = assemblyDescriptor.getSecurityRoles();
- if (securityRoles != null)
- {
- Iterator it = securityRoles.keySet().iterator();
- while (it.hasNext())
- {
- Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
- Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
- }
- }
- }
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-//$Id$
-
-import javax.annotation.security.RolesAllowed;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.ejb3.Ejb3ModuleMBean;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.WSException;
-import org.w3c.dom.Element;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB3 extends ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
- {
- // The container objects below provide access to all of the ejb metadata
- Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
- for (Object manager : ejb3Module.getContainers().values())
- {
- if (manager instanceof StatelessContainer)
- {
- StatelessContainer container = (StatelessContainer)manager;
-
- RolesAllowed anRolesAllowed =
(RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
- if (anRolesAllowed != null)
- {
- for (String role : anRolesAllowed.value())
- {
- Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
- Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode(role));
- }
- }
- }
- }
- }
-
- private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
- {
- Ejb3ModuleMBean ejb3Module;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
- if (ejb3Module == null)
- throw new WSException("Cannot obtain EJB3 module: " + objectName);
-
- return ejb3Module;
- }
- catch (MBeanProxyCreationException ex)
- {
- throw new WSException("Cannot obtain proxy to EJB3 module");
- }
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,129 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ejb.plugins.AbstractInterceptor;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.InvocationKey;
-import org.jboss.logging.Logger;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.common.CommonBinding;
-import org.jboss.ws.common.CommonBindingProvider;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-
-/**
- * This Interceptor does the ws4ee handler processing.
- *
- * According to the ws4ee spec the handler logic must be invoked after the container
- * applied method level security to the invocation.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Sep-2005
- */
-public class ServiceEndpointInterceptor extends AbstractInterceptor
-{
- // provide logging
- private static Logger log = Logger.getLogger(ServiceEndpointInterceptor.class);
-
- // Interceptor implementation --------------------------------------
-
- /** Before and after we call the service endpoint bean, we process the handler
chains.
- */
- public Object invoke(final Invocation mi) throws Exception
- {
- // If no msgContext, it's not for us
- CommonMessageContext msgContext =
(CommonMessageContext)mi.getPayloadValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
- if (msgContext == null)
- {
- return getNext().invoke(mi);
- }
-
- // Get the endpoint invocation
- EndpointInvocation epInv =
(EndpointInvocation)mi.getValue(EndpointInvocation.class.getName());
- OperationMetaData opMetaData = epInv.getOperationMetaData();
-
- // Get the handler callback
- String key = ServiceEndpointInvokerEJB21.HandlerCallback.class.getName();
- ServiceEndpointInvokerEJB21.HandlerCallback callback =
(ServiceEndpointInvokerEJB21.HandlerCallback)mi.getValue(key);
-
- // Handlers need to be Tx. Therefore we must invoke the handler chain after the
TransactionInterceptor.
- if (callback != null && epInv != null)
- {
- try
- {
- // call the request handlers
- boolean handlersPass =
callback.callRequestHandlerChain(HandlerType.ENDPOINT);
- handlersPass = handlersPass &&
callback.callRequestHandlerChain(HandlerType.POST);
-
- // Call the next interceptor in the chain
- if (handlersPass)
- {
- // The SOAPContentElements stored in the EndpointInvocation might have
changed after
- // handler processing. Get the updated request payload. This should be a
noop if request
- // handlers did not modify the incomming SOAP message.
- Object[] reqParams = epInv.getRequestPayload();
- mi.setArguments(reqParams);
- Object resObj = getNext().invoke(mi);
- epInv.setReturnValue(resObj);
-
- // Bind the response message
- CommonBindingProvider bindingProvider = new
CommonBindingProvider(opMetaData.getEndpointMetaData());
- CommonBinding binding =
(CommonBinding)bindingProvider.getCommonBinding();
- SOAPMessage resMessage =
(SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
- msgContext.setSOAPMessage(resMessage);
- }
-
- // call the response handlers
- handlersPass = callback.callResponseHandlerChain(HandlerType.POST);
- handlersPass = handlersPass &&
callback.callResponseHandlerChain(HandlerType.ENDPOINT);
-
- // update the return value after response handler processing
- Object resObj = epInv.getReturnValue();
-
- return resObj;
- }
- catch (Exception ex)
- {
- // call the fault handlers
- boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST, ex);
- handlersPass = handlersPass &&
callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
-
- throw ex;
- }
- finally
- {
- // do nothing
- }
- }
- else
- {
- log.warn("Handler callback not available");
- return getNext().invoke(mi);
- }
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,264 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import java.lang.reflect.Method;
-import java.security.Principal;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.ejb.EjbModule;
-import org.jboss.ejb.Interceptor;
-import org.jboss.ejb.StatelessSessionContainer;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.InvocationKey;
-import org.jboss.invocation.InvocationType;
-import org.jboss.invocation.PayloadKey;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.server.ServiceEndpointInvoker;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * Handles invocations on EJB2.1 endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public class ServiceEndpointInvokerEJB21 extends AbstractServiceEndpointInvoker
implements ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
-
- private String jndiName;
- private MBeanServer server;
- private ObjectName objectName;
-
- public ServiceEndpointInvokerEJB21()
- {
- server = MBeanServerLocator.locateJBoss();
- }
-
- /** Initialize the service endpoint */
- @Override
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- super.initServiceEndpoint(seInfo);
-
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- String ejbName = epMetaData.getLinkName();
- if (ejbName == null)
- throw new WSException("Cannot obtain ejb-link from port component");
-
- UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)seInfo.getUnifiedDeploymentInfo().metaData;
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain ejb meta data for: " + ejbName);
-
- // verify the service endpoint
- String seiName = epMetaData.getServiceEndpointInterfaceName();
- if (epMetaData.getType() == Type.JAXRPC && seiName != null)
- {
- String bmdSEI = beanMetaData.getServiceEndpoint();
- if (seiName.equals(bmdSEI) == false)
- throw new WSException("Endpoint meta data defines SEI '" +
seiName + "', <service-endpoint> in ejb-jar.xml defines '" +
bmdSEI + "'");
- }
-
- // get the bean's JNDI name
- jndiName = beanMetaData.getContainerObjectNameJndiName();
- if (jndiName == null)
- throw new WSException("Cannot obtain JNDI name for: " + ejbName);
-
- objectName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + jndiName +
",service=EJB");
-
- // Dynamically add the service endpoint interceptor
- //
http://jira.jboss.org/jira/browse/JBWS-758
- try
- {
- EjbModule ejbModule = (EjbModule)server.getAttribute(objectName,
"EjbModule");
- StatelessSessionContainer container =
(StatelessSessionContainer)ejbModule.getContainer(ejbName);
-
- boolean injectionPointFound = false;
- Interceptor prev = container.getInterceptor();
- while (prev != null && prev.getNext() != null)
- {
- Interceptor next = prev.getNext();
- if (next.getNext() == null)
- {
- log.debug("Inject service endpoint interceptor after: " +
prev.getClass().getName());
- ServiceEndpointInterceptor sepInterceptor = new
ServiceEndpointInterceptor();
- prev.setNext(sepInterceptor);
- sepInterceptor.setNext(next);
- injectionPointFound = true;
- }
- prev = next;
- }
- if (injectionPointFound == false)
- log.warn("Cannot service endpoint interceptor injection point");
- }
- catch (Exception ex)
- {
- log.warn("Cannot add service endpoint interceptor", ex);
- }
- }
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- if (server.isRegistered(objectName) == false)
- throw new WSException("Cannot find service endpoint target: " +
objectName);
-
- return null;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
- {
- return null;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
-
- // these are provided by the ServerLoginHandler
- Principal principal = SecurityAssociation.getPrincipal();
- Object credential = SecurityAssociation.getCredential();
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-
- // invoke on the container
- try
- {
- // setup the invocation
- Method method = epInv.getJavaMethod();
- Object[] args = epInv.getRequestPayload();
- Invocation inv = new Invocation(null, method, args, null, principal,
credential);
-
- inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
- inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getSOAPMessage());
- inv.setType(InvocationType.SERVICE_ENDPOINT);
-
- // Set the handler callback and endpoint invocation
- inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(seInfo),
PayloadKey.TRANSIENT);
- inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
-
- String[] sig = { Invocation.class.getName() };
- Object retObj = server.invoke(objectName, "invoke", new Object[] { inv
}, sig);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
- {
- // do nothing
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- if (type == HandlerType.PRE)
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
- else
- return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- if (type == HandlerType.PRE)
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
- else
- return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
- {
- if (type == HandlerType.PRE)
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
- else
- return true;
- }
-
- // The ServiceEndpointInterceptor calls the methods in this callback
- public class HandlerCallback
- {
- private ServiceEndpointInfo seInfo;
-
- public HandlerCallback(ServiceEndpointInfo seInfo)
- {
- this.seInfo = seInfo;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callRequestHandlerChain(HandlerType type)
- {
- if (type != HandlerType.PRE)
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
- else
- return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callResponseHandlerChain(HandlerType type)
- {
- if (type != HandlerType.PRE)
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
- else
- return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callFaultHandlerChain(HandlerType type, Exception ex)
- {
- if (type != HandlerType.PRE)
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
- else
- return true;
- }
-
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,145 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import java.lang.reflect.Method;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.aop.Dispatcher;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.server.ServiceEndpointInvoker;
-import org.jboss.ws.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * Handles invocations on EJB3 endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jul-2005
- */
-public class ServiceEndpointInvokerEJB3 extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB3.class);
-
- private MBeanServer server;
- private ObjectName objectName;
-
- public ServiceEndpointInvokerEJB3()
- {
- server = MBeanServerLocator.locateJBoss();
- }
-
- /** Initialize the service endpoint */
- @Override
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- super.initServiceEndpoint(seInfo);
-
- String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
- UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
- String nameStr = "jboss.j2ee:name=" + ejbName +
",service=EJB3,jar=" + udi.shortName;
- if (udi.parent != null)
- {
- nameStr += ",ear=" + udi.parent.shortName;
- }
-
- objectName = ObjectNameFactory.create(nameStr.toString());
- }
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- if (server.isRegistered(objectName) == false)
- throw new WSException("Cannot find service endpoint target: " +
objectName);
-
- return null;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
- {
- return null;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
-
- /* [FIXME] how to do this for EJB3
-
- // these are provided by the ServerLoginHandler
- Principal principal = SecurityAssociation.getPrincipal();
- Object credential = SecurityAssociation.getCredential();
-
- CommonMessageContext msgContext = MessageContextAssociation.getMessageContext();
-
- Invocation inv = new Invocation(null, method, args, null, principal, credential);
- inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
- inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getMessage());
- inv.setType(InvocationType.SERVICE_ENDPOINT);
- */
-
- // invoke on the container
- try
- {
- // setup the invocation
- Method seiMethod = epInv.getJavaMethod();
- Object[] args = epInv.getRequestPayload();
-
- Dispatcher dispatcher = Dispatcher.singleton;
- String canonicalName = objectName.getCanonicalName();
- StatelessContainer container =
(StatelessContainer)dispatcher.getRegistered(canonicalName);
- if (container == null)
- throw new WSException("Cannot obtain container from Dispatcher: " +
canonicalName);
-
- Class implClass = container.getBeanClass();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object retObj = container.localInvoke(implMethod, args);
- epInv.setReturnValue(retObj);
- }
- catch (Throwable e)
- {
- handleInvocationException(e);
- }
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
- {
- // do nothing
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import java.lang.reflect.Method;
-
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.server.ServiceEndpointInvoker;
-import org.jboss.ws.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.utils.ThreadLocalAssociation;
-
-/**
- * Handles invocations on MDB endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Mar-2006
- */
-public class ServiceEndpointInvokerMDB extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerMDB.class);
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException
- {
- return null;
- }
-
- // The dispatcher sets the target bean object
- public void setTargetBeanObject(Object targetMDB)
- {
- ThreadLocalAssociation.localInvokerMDBAssoc().set(targetMDB);
- }
-
- /** Create an instance of the SEI implementation bean if necessary
- */
- public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass) throws InstantiationException,
IllegalAccessException
- {
- return ThreadLocalAssociation.localInvokerMDBAssoc().get();
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
- try
- {
- Class implClass = seiImpl.getClass();
- Method seiMethod = epInv.getJavaMethod();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object[] args = epInv.getRequestPayload();
- Object retObj = implMethod.invoke(seiImpl, args);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- finally
- {
- // cleanup thread local
- setTargetBeanObject(null);
- }
- }
-
- /** Destroy an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
- {
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-
-import org.jboss.webservice.metadata.serviceref.HandlerMetaData;
-import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
-import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
-import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-
-/**
- * Build container independent service ref meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class ServiceRefMetaDataAdaptor
-{
- public static UnifiedServiceRefMetaData
buildUnifiedServiceRefMetaData(ServiceRefMetaData srmd)
- {
- UnifiedServiceRefMetaData usrmd = new UnifiedServiceRefMetaData();
- usrmd.setServiceRefName(srmd.getServiceRefName());
- usrmd.setServiceInterface(srmd.getServiceInterface());
- usrmd.setWsdlFile(srmd.getWsdlFile());
- usrmd.setJaxrpcMappingFile(srmd.getJaxrpcMappingFile());
- usrmd.setServiceQName(srmd.getServiceQName());
-
- LinkedHashMap<String, UnifiedPortComponentRefMetaData> pcrefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
- for (PortComponentRefMetaData pcmd : srmd.getPortComponentRefs())
- {
- UnifiedPortComponentRefMetaData upcmd = new UnifiedPortComponentRefMetaData();
- upcmd.setServiceEndpointInterface(pcmd.getServiceEndpointInterface());
- upcmd.setPortComponentLink(pcmd.getPortComponentLink());
- upcmd.setCallProperties(pcmd.getCallProperties());
- pcrefs.put(pcmd.getServiceEndpointInterface(), upcmd);
- }
- usrmd.setPortComponentRefs(pcrefs);
-
- ArrayList<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
- for (HandlerMetaData hmd : srmd.getHandlers())
- {
- UnifiedHandlerMetaData uhmd = new UnifiedHandlerMetaData(null);
- uhmd.setHandlerName(hmd.getHandlerName());
- uhmd.setHandlerClass(hmd.getHandlerClass());
- Arrays.asList(hmd.getSoapHeaders());
-
- for(String portname : hmd.getPortNames())
- {
- uhmd.addPortName(portname);
- }
- for (InitParamMetaData ipmd : hmd.getInitParams())
- {
- HandlerInitParam ip = new HandlerInitParam();
- ip.setParamName(ipmd.getParamName());
- ip.setParamValue(ipmd.getParamValue());
- uhmd.addInitParam(ip);
- }
- handlers.add(uhmd);
- }
- usrmd.setHandlers(handlers);
-
- usrmd.setConfigName(srmd.getConfigName());
- usrmd.setConfigFile(srmd.getConfigFile());
- usrmd.setWsdlOverride(srmd.getWsdlOverride());
- usrmd.setCallProperties(srmd.getCallProperties());
- usrmd.setResourceCL(srmd.getResourceCL());
-
- return usrmd;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java 2006-10-30
11:56:59 UTC (rev 1329)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-
-/**
- * Build container independent web meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class WebMetaDataAdaptor
-{
- public static UnifiedWebMetaData buildUnifiedWebMetaData(WebMetaData wmd)
- {
- UnifiedWebMetaData umd = new UnifiedWebMetaData();
- umd.setContextRoot(wmd.getContextRoot());
- umd.setServletMappings(wmd.getServletMappings());
- umd.setServletClassMap(wmd.getServletClassMap());
- umd.setConfigName(wmd.getConfigName());
- umd.setConfigFile(wmd.getConfigFile());
- umd.setContextLoader(wmd.getContextLoader());
- umd.setSecurityDomain(wmd.getSecurityDomain());
- //umd.setWsdlPublishLocationMap(wmd.getWsdlPublishLocationMap());
- return umd;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-// $Id$
-
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.naming.Context;
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.xml.rpc.JAXRPCException;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.naming.Util;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JSR109ClientDeployment;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.jaxrpc.ServiceReferenceable;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.metadata.wsdl.WSDL11DefinitionFactory;
-
-/**
- * Binds a JAXRPC Service object in the client's ENC for every service-ref element in
the
- * deployment descriptor.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public class WebServiceClientDeployer extends ServiceMBeanSupport implements
WebServiceClientDeployerMBean
-{
- /**
- * This binds a jaxrpc Service into the callers ENC for every service-ref element
- *
- * @param envCtx ENC to bind the javax.rpc.xml.Service object to
- * @param serviceRefs An iterator of the service-ref elements in the client deployment
descriptor
- * @param di The client's deployment info
- * @throws org.jboss.deployment.DeploymentException if it goes wrong
- */
- public void setupServiceRefEnvironment(Context envCtx, Iterator serviceRefs,
DeploymentInfo di) throws DeploymentException
- {
- try
- {
- while (serviceRefs.hasNext())
- {
- ServiceRefMetaData serviceRef = (ServiceRefMetaData)serviceRefs.next();
- String serviceRefName = serviceRef.getServiceRefName();
-
- UnifiedServiceRefMetaData wsServiceRef =
ServiceRefMetaDataAdaptor.buildUnifiedServiceRefMetaData(serviceRef);
-
- JavaWsdlMapping javaWsdlMapping = getJavaWsdlMapping(wsServiceRef);
- wsServiceRef.setJavaWsdlMapping(javaWsdlMapping);
-
- Definition wsdlDefinition = getWsdlDefinition(wsServiceRef);
- wsServiceRef.setWsdlDefinition(wsdlDefinition);
-
- // build the container independent deployment info
- UnifiedDeploymentInfo udi = new
JSR109ClientDeployment(UnifiedDeploymentInfo.DeploymentType.JSR109_Client);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
-
- ServiceReferenceable ref = new ServiceReferenceable(wsServiceRef, udi);
- Util.bind(envCtx, serviceRefName, ref);
-
- log.debug("Webservice binding: java:comp/env/" + serviceRefName);
- }
- }
- catch (Exception e)
- {
- throw new DeploymentException("Cannot bind webservice to client
environment", e);
- }
- }
-
- private JavaWsdlMapping getJavaWsdlMapping(UnifiedServiceRefMetaData serviceRef)
- {
- JavaWsdlMapping javaWsdlMapping = null;
- URL mappingURL = serviceRef.getJavaWsdlMappingURL();
- if (mappingURL != null)
- {
- try
- {
- // setup the XML binding Unmarshaller
- JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
- javaWsdlMapping = mappingFactory.parse(mappingURL);
- }
- catch (Exception e)
- {
- throw new JAXRPCException("Cannot unmarshal jaxrpc-mapping-file: "
+ mappingURL, e);
- }
- }
- return javaWsdlMapping;
- }
-
- private Definition getWsdlDefinition(UnifiedServiceRefMetaData serviceRef)
- {
- Definition wsdlDefinition = null;
- {
- URL wsdlOverride = serviceRef.getWsdlOverride();
- URL wsdlURL = serviceRef.getWsdlURL();
- if (wsdlOverride == null && wsdlURL != null)
- {
- try
- {
- WSDL11DefinitionFactory factory = WSDL11DefinitionFactory.newInstance();
- wsdlDefinition = factory.parse(wsdlURL);
- }
- catch (WSDLException e)
- {
- throw new WSException("Cannot unmarshall wsdl, cause: " +
e.toString());
- }
- }
- }
- return wsdlDefinition;
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -1,38 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.ws.integration.jboss;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.utils.ObjectNameFactory;
-import org.jboss.system.ServiceMBean;
-import org.jboss.webservice.WebServiceClientDeployment;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface WebServiceClientDeployerMBean extends WebServiceClientDeployment,
ServiceMBean
-{
- // default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceClientDeployer");
-}
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java (from
rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.metadata.EjbPortComponentMetaData;
+import org.jboss.metadata.MessageDrivenMetaData;
+import org.jboss.metadata.SessionMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
+
+/**
+ * Build container independent application meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class ApplicationMetaDataAdaptor
+{
+ public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(ApplicationMetaData apmd)
+ {
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ buildUnifiedBeanMetaData(umd, apmd);
+ umd.setConfigName(apmd.getConfigName());
+ umd.setConfigFile(apmd.getConfigFile());
+ umd.setWebServiceContextRoot(apmd.getWebServiceContextRoot());
+ umd.setSecurityDomain(apmd.getSecurityDomain());
+ //umd.setWsdlPublishLocationMap(apmd.getWsdlPublishLocationMap());
+ return umd;
+ }
+
+ private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData metaData)
+ {
+ List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ Iterator it = metaData.getEnterpriseBeans();
+ while (it.hasNext())
+ {
+ BeanMetaData bmd = (BeanMetaData)it.next();
+ UnifiedBeanMetaData ubmd = buildUnifiedBeanMetaData(bmd);
+ if (ubmd != null)
+ {
+ beans.add(ubmd);
+ }
+ }
+ umd.setEnterpriseBeans(beans);
+ }
+
+ private static UnifiedBeanMetaData buildUnifiedBeanMetaData(BeanMetaData bmd)
+ {
+ UnifiedBeanMetaData ubmd = null;
+ if (bmd instanceof SessionMetaData)
+ {
+ ubmd = new UnifiedSessionMetaData();
+ }
+ else if (bmd instanceof MessageDrivenMetaData)
+ {
+ ubmd = new UnifiedMessageDrivenMetaData();
+
((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
+ }
+
+ if (ubmd != null)
+ {
+ ubmd.setEjbName(bmd.getEjbName());
+ ubmd.setEjbClass(bmd.getEjbClass());
+ ubmd.setServiceEndpoint(bmd.getServiceEndpoint());
+ ubmd.setHome(bmd.getHome());
+ ubmd.setLocalHome(bmd.getLocalHome());
+ ubmd.setJndiName(bmd.getJndiName());
+ ubmd.setLocalJndiName(bmd.getLocalJndiName());
+
+ EjbPortComponentMetaData pcmd = bmd.getPortComponent();
+ if (pcmd != null)
+ {
+ UnifiedEjbPortComponentMetaData upcmd = new
UnifiedEjbPortComponentMetaData();
+ upcmd.setPortComponentName(pcmd.getPortComponentName());
+ upcmd.setPortComponentURI(pcmd.getPortComponentURI());
+ upcmd.setAuthMethod(pcmd.getAuthMethod());
+ upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
+ ubmd.setPortComponent(upcmd);
+ }
+ }
+ return ubmd;
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,184 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+//$Id: WebServiceDeployer.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerInterceptorSupport;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.mx.server.Invocation;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.ws.deployment.ServiceEndpointDeployer;
+import org.jboss.ws.deployment.ServiceEndpointPublisher;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.server.KernelLocator;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services
+ *
+ * This service is called from the {@see org.jboss.ws.metadata.WebServiceInterceptor}
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Dimitris.Andreadis(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public abstract class DeployerInterceptor extends SubDeployerInterceptorSupport
+{
+ // The main deployer
+ private MainDeployerMBean mainDeployer;
+
+ /** Create the deployer service
+ */
+ protected void createService() throws Exception
+ {
+ mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class,
MainDeployerMBean.OBJECT_NAME, server);
+ super.attach();
+ }
+
+ /** Destroy the deployer service
+ */
+ protected void destroyService()
+ {
+ super.detach();
+ }
+
+ /** Overwrite to create the webservice
+ */
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("create: " + di.url);
+
+ Object retn = invokeNext(invocation);
+
+ if (isWebserviceDeployment(di))
+ {
+ UnifiedDeploymentInfo udi = createUnifiedDeploymentInfo(di);
+ di.context.put(UnifiedDeploymentInfo.class.getName(), udi);
+ getServiceEndpointDeployer().create(udi);
+ }
+
+ return retn;
+ }
+
+ /** Overwrite to start the webservice
+ */
+ protected Object start(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("start: " + di.url);
+
+ Object retn = invokeNext(invocation);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ // late initialization of the web context loader
+ if (di.metaData instanceof WebMetaData)
+ {
+ ClassLoader classLoader = ((WebMetaData)di.metaData).getContextLoader();
+ udi.ucl = classLoader;
+ }
+
+ getServiceEndpointDeployer().start(udi);
+ }
+
+ return retn;
+ }
+
+ /** Overwrite to stop the webservice
+ */
+ protected Object stop(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("stop: " + di.url);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointDeployer().stop(udi);
+ }
+
+ return invokeNext(invocation);
+ }
+
+ /** Overwrite to destroy the webservice
+ */
+ protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("destroy: " + di.url);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointDeployer().destroy(udi);
+ }
+
+ return invokeNext(invocation);
+ }
+
+ protected ServiceEndpointDeployer getServiceEndpointDeployer()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
+ return (ServiceEndpointDeployer)entry.getTarget();
+ }
+
+ protected ServiceEndpointPublisher getServiceEndpointPublisher()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointPublisher.BEAN_NAME);
+ return (ServiceEndpointPublisher)entry.getTarget();
+ }
+
+ /** Return true if the deployment contains a web service endpoint
+ */
+ protected abstract boolean isWebserviceDeployment(DeploymentInfo di);
+
+ protected abstract UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo
di) throws Throwable;
+
+ protected UnifiedDeploymentInfo getServiceEndpointDeployment(DeploymentInfo di)
+ {
+ return
(UnifiedDeploymentInfo)di.context.get(UnifiedDeploymentInfo.class.getName());
+ }
+
+ /** Handle all webservice deployment exceptions.
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleStartupException(DeploymentInfo di, Throwable th)
+ {
+ log.error("Cannot startup webservice for: " + di.shortName, th);
+ mainDeployer.undeploy(di);
+ }
+
+ /** Handle all webservice deployment exceptions.
+ *
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleShutdownException(String moduleName, Throwable th)
+ {
+ log.error("Cannot shutdown webservice for: " + moduleName, th);
+ }
+}
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+//$Id: WebServiceDeployerEJB.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.mx.server.Invocation;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public abstract class DeployerInterceptorEJB extends DeployerInterceptor
+{
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ Object retObj = super.create(invocation, di);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ UnifiedMetaData wsMetaData =
getServiceEndpointDeployer().getUnifiedMetaData(udi);
+ udi.localUrl = generateWebDeployment(di, wsMetaData);
+ udi.context.put(DeploymentInfo.class.getName(), di);
+ getServiceEndpointPublisher().publishServiceEndpoint(udi);
+ }
+
+ return retObj;
+ }
+
+ protected abstract URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData
wsMetaData) throws IOException;
+
+ protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointPublisher().destroyServiceEndpoint(udi);
+ }
+
+ return super.destroy(invocation, di);
+ }
+}
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+//$Id: WebServiceDeployerEJB21.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Iterator;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.ws.WSException;
+import org.jboss.ws.deployment.JSR109Deployment;
+import org.jboss.ws.deployment.JSR181Deployment;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB-2.1 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class DeployerInterceptorEJB21 extends DeployerInterceptorEJB implements
DeployerInterceptorEJB21MBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
+ {
+ UnifiedDeploymentInfo udi;
+ URL webservicesURL = getWebservicesDescriptor(di);
+ if (webservicesURL != null)
+ {
+ udi = new JSR109Deployment(UnifiedDeploymentInfo.DeploymentType.JSR109_EJB21,
webservicesURL);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ else
+ {
+ udi = new JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB21);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ return udi;
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
+ boolean isWebserviceDeployment = applMetaData.isWebServiceDeployment();
+
+ // Check if we have a webservices.xml descriptor
+ if (isWebserviceDeployment == false)
+ {
+ isWebserviceDeployment = getWebservicesDescriptor(di) != null;
+ }
+
+ // Check if the ejb-jar contains annotated endpoints
+ if (isWebserviceDeployment == false)
+ {
+ try
+ {
+ Iterator itBeans = applMetaData.getEnterpriseBeans();
+ while (itBeans.hasNext() && isWebserviceDeployment == false)
+ {
+ BeanMetaData beanMetaData = (BeanMetaData)itBeans.next();
+ String ejbClassName = beanMetaData.getEjbClass();
+ Class ejbClass = di.annotationsCl.loadClass(ejbClassName);
+ isWebserviceDeployment =
ejbClass.isAnnotationPresent(javax.jws.WebService.class);
+ }
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new WSException(e);
+ }
+ }
+
+ applMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
+ /**
+ * Get the resource name of the webservices.xml descriptor.
+ */
+ protected URL getWebservicesDescriptor(DeploymentInfo di)
+ {
+ return di.localCl.findResource("META-INF/webservices.xml");
+ }
+
+ protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
+ {
+ ServiceEndpointGeneratorEJB21 generator = new ServiceEndpointGeneratorEJB21();
+ return generator.generatWebDeployment(di, wsMetaData);
+ }
+
+}
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21MBean.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21MBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorEJB21MBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB21");
+}
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id: WebServiceDeployerEJB3.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+
+import javax.jws.WebService;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.deployment.JSR181Deployment;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB3 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public class DeployerInterceptorEJB3 extends DeployerInterceptorEJB implements
DeployerInterceptorEJB3MBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
+ {
+ UnifiedDeploymentInfo udi = new
JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB3);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
+
+ // The container objects below provide access to all of the ejb metadata
+ ArrayList<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ for (Object container : ejb3Module.getContainers().values())
+ {
+ if (container instanceof StatelessContainer)
+ {
+ StatelessContainer slc = (StatelessContainer)container;
+ UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
+ uslc.setEjbName(slc.getEjbName());
+ uslc.setEjbClass(slc.getBeanClassName());
+ beans.add(uslc);
+ }
+ }
+
+ UnifiedApplicationMetaData appMetaData = new UnifiedApplicationMetaData();
+ appMetaData.setEnterpriseBeans(beans);
+ udi.metaData = appMetaData;
+
+ return udi;
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ boolean isWebserviceDeployment = false;
+
+ // Check if the ejb3 contains annotated endpoints
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
+ {
+ if (manager instanceof StatelessContainer)
+ {
+ StatelessContainer container = (StatelessContainer)manager;
+ if (container.resolveAnnotation(WebService.class) != null)
+ {
+ isWebserviceDeployment = true;
+ break;
+ }
+ }
+ }
+
+ return isWebserviceDeployment;
+ }
+
+ private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
+
+ protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
+ {
+ return new ServiceEndpointGeneratorEJB3().generatWebDeployment(di, wsMetaData);
+ }
+}
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3MBean.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3MBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorEJB3MBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB3");
+}
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSE.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSE.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,173 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id: WebServiceDeployerJSE.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.mx.server.Invocation;
+import org.jboss.ws.WSException;
+import org.jboss.ws.deployment.JAXWSDeployment;
+import org.jboss.ws.deployment.JSR109Deployment;
+import org.jboss.ws.deployment.JSR181Deployment;
+import org.jboss.ws.deployment.ServiceEndpointPublisher;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services for WAR
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class DeployerInterceptorJSE extends DeployerInterceptor implements
DeployerInterceptorJSEMBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
+ {
+ UnifiedDeploymentInfo udi;
+
+ DeploymentType type =
(DeploymentType)di.context.get("UnifiedDeploymentInfo.Type");
+ if (type == UnifiedDeploymentInfo.DeploymentType.JSR109_JSE)
+ {
+ URL webservicesURL = getWebservicesDescriptor(di);
+ udi = new JSR109Deployment(UnifiedDeploymentInfo.DeploymentType.JSR109_JSE,
webservicesURL);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ }
+ else if (type == UnifiedDeploymentInfo.DeploymentType.JSR181_JSE)
+ {
+ udi = new JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_JSE);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ else if (type == UnifiedDeploymentInfo.DeploymentType.JAXWS_PROVIDER_JSE)
+ {
+ udi = new
JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_PROVIDER_JSE);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ else
+ {
+ throw new WSException("Unexpected type: " + type);
+ }
+
+ return udi;
+ }
+
+ /** Overwrite to create the webservice
+ *
+ * This implemantation modifies the servlet entries in web.xml
+ */
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ Object retn = super.create(invocation, di);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ ServiceEndpointPublisher endpointPublisher = getServiceEndpointPublisher();
+ Map<String, String> sepTargetMap =
endpointPublisher.rewriteWebXML(udi.localUrl);
+ updateServiceEndpointTargetBeans(udi, sepTargetMap);
+ }
+ return retn;
+ }
+
+ private void updateServiceEndpointTargetBeans(UnifiedDeploymentInfo udi,
Map<String, String> sepTargetMap)
+ {
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String targetBean = sepTargetMap.get(sepMetaData.getLinkName());
+ sepMetaData.setServiceEndpointImplName(targetBean);
+ }
+ }
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ WebMetaData webMetaData = (WebMetaData)di.metaData;
+ boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
+
+ // Check if we have a webservices.xml descriptor
+ if (isWebserviceDeployment == false)
+ {
+ if (getWebservicesDescriptor(di) != null)
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JSR109_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+
+ // Check if the web.xml contains annotated endpoint impl
+ if (isWebserviceDeployment == false)
+ {
+ Map servletClassMap = webMetaData.getServletClassMap();
+ Iterator<String> it = servletClassMap.values().iterator();
+ while (it.hasNext() && isWebserviceDeployment == false)
+ {
+ String servletClassName = it.next();
+ try
+ {
+ Class servletClass = di.annotationsCl.loadClass(servletClassName);
+ if (servletClass.isAnnotationPresent(javax.jws.WebService.class))
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JSR181_JSE);
+ isWebserviceDeployment = true;
+ }
+ if
(servletClass.isAnnotationPresent(javax.xml.ws.WebServiceProvider.class))
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXWS_PROVIDER_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+ }
+
+ webMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
+ /**
+ * Get the resource name of the webservices.xml descriptor.
+ */
+ protected URL getWebservicesDescriptor(DeploymentInfo di)
+ {
+ return di.localCl.findResource("WEB-INF/webservices.xml");
+ }
+}
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSEMBean.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSEMBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorJSEMBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerJSE");
+}
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSE.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSE.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id: WebServiceDeployerNestedJSE.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com
$
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerSupport;
+import org.jboss.system.server.ServerConfig;
+import org.jboss.system.server.ServerConfigLocator;
+import org.jboss.ws.utils.IOUtils;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services for
+ * nested POJO endpoints.
+ *
+ * The WebServiceDeployerJSE attaches itself as an deployment interceptor to
+ * the jboss.web:service=WebServer deployer. As a consequence, all *.war deployments
+ * that are picked up before the interceptor is installed are not treated as potential
+ * web service endpoint deployments.
+ *
+ * Nested POJO endpoints can be packaged in *.jse deployments that are then picked up by
this
+ * deployer.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-Mar-2005
+ */
+public class DeployerInterceptorNestedJSE extends SubDeployerSupport implements
DeployerInterceptorNestedJSEMBean
+{
+ private static final String NESTED_JSE_WAR_FILE =
"org.jboss.ws.server.nested.jse";
+
+ // The MainDeployer
+ protected MainDeployerMBean mainDeployer;
+
+ public void setMainDeployer(MainDeployerMBean mainDeployer)
+ {
+ this.mainDeployer = mainDeployer;
+ }
+
+ public boolean accepts(DeploymentInfo sdi)
+ {
+ setSuffixes(new String[] { ".jse" });
+ return super.accepts(sdi);
+ }
+
+ /** Copy the *.jse to a *.war and deploy through the main deployer
+ */
+ public void create(DeploymentInfo di) throws DeploymentException
+ {
+ log.debug("create: " + di.url);
+
+ try
+ {
+ File jseFile = new File(di.localUrl.getFile());
+ if (jseFile.isFile() == false)
+ throw new DeploymentException("Expected a file: " + di.localUrl);
+
+ ServerConfig config = ServerConfigLocator.locate();
+ String warFileName = config.getServerTempDir().getCanonicalPath() +
"/deploy/" + di.shortName;
+ warFileName = warFileName.substring(0, warFileName.length() - 4) +
".war";
+ File warFile = new File(warFileName);
+
+ FileOutputStream fos = new FileOutputStream(warFile);
+ FileInputStream fis = new FileInputStream(jseFile);
+ try
+ {
+ IOUtils.copyStream(fos, fis);
+ }
+ finally
+ {
+ fos.close();
+ fis.close();
+ }
+
+ mainDeployer.deploy(warFile.toURL());
+
+ // remember the war url that we deployed
+ di.context.put(NESTED_JSE_WAR_FILE, warFile);
+
+ super.create(di);
+ }
+ catch (IOException ex)
+ {
+ throw new DeploymentException("Failed to create: " + di.url, ex);
+ }
+ }
+
+ /** Undeploy the *.war through the main deployer
+ */
+ public void destroy(DeploymentInfo di) throws DeploymentException
+ {
+ log.debug("destroy: " + di.url);
+ try
+ {
+ File warFile = (File)di.context.get(NESTED_JSE_WAR_FILE);
+ mainDeployer.undeploy(warFile.toURL());
+ warFile.delete();
+
+ super.destroy(di);
+ }
+ catch (IOException ex)
+ {
+ throw new DeploymentException("Failed to destroy: " + di.url, ex);
+ }
+ }
+}
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSEMBean.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSEMBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id: WebServiceDeployerNestedJSEMBean.java 296 2006-05-08 19:45:49Z
thomas.diesler(a)jboss.com $
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerMBean;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-Mar-2005
+ */
+public interface DeployerInterceptorNestedJSEMBean extends SubDeployerMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerNestedJSE");
+
+ void setMainDeployer(MainDeployerMBean mainDeployer);
+}
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/DeploymentInfoAdaptor.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/DeploymentInfoAdaptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id: WebServiceDeploymentAdaptor.java 317 2006-05-14 17:16:59Z
thomas.diesler(a)jboss.com $
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+
+/**
+ * Build container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class DeploymentInfoAdaptor
+{
+ public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
DeploymentInfo di)
+ {
+ if (di.parent != null)
+ {
+ udi.parent = new UnifiedDeploymentInfo(null);
+ buildDeploymentInfo(udi.parent, di.parent);
+ }
+
+ udi.shortName = di.shortName;
+ udi.url = di.url;
+ udi.localUrl = di.localUrl;
+ udi.metaData = buildMetaData(di.metaData);
+ udi.annotationsCl = di.annotationsCl;
+ udi.localCl = di.localCl;
+ udi.ucl = di.ucl;
+ udi.deployedObject = di.deployedObject;
+
+ return udi;
+ }
+
+ private static Object buildMetaData(Object metaData)
+ {
+ Object retMetaData = null;
+ if (metaData instanceof WebMetaData)
+ {
+ retMetaData =
WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
+ }
+ else if (metaData instanceof ApplicationMetaData)
+ {
+ retMetaData =
ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData((ApplicationMetaData)metaData);
+ }
+ return retMetaData;
+ }
+}
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossHttpServer.java (from
rev 1317, trunk/src/main/java/org/jboss/ws/integration/jboss/JBossHttpServer.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/JBossHttpServer.java 2006-10-27
07:43:19 UTC (rev 1317)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossHttpServer.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,230 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+//$Id$
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Map;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.ws.Endpoint;
+
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.WSException;
+import org.jboss.ws.server.HttpContext;
+import org.jboss.ws.server.HttpServer;
+import org.jboss.ws.server.ServerConfig;
+import org.jboss.ws.server.ServerConfigFactory;
+import org.w3c.dom.Element;
+
+/**
+ * A Tomcat HTTP Server
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class JBossHttpServer extends HttpServer
+{
+ private static final String MAIN_DEPLOYER =
"jboss.system:service=MainDeployer";
+
+ /** Start an instance of this HTTP server */
+ @Override
+ public void start()
+ {
+ // verify required properties
+ }
+
+ /** Create an HTTP context */
+ public HttpContext createContext(String contextRoot)
+ {
+ return new HttpContext(this, contextRoot);
+ }
+
+ /** Publish an JAXWS endpoint to the HTTP server */
+ @Override
+ public void publish(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+ String implName = implClass.getName();
+
+ try
+ {
+ Element webDoc = createWebAppDescriptor(context, endpoint);
+ Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
+
+ File tmpWar = null;
+ try
+ {
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ ServerConfig serverConfig = factory.getServerConfig();
+ File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() +
"/jbossws");
+
+ String deploymentName =
implName.substring(implName.lastIndexOf(".") + 1);
+ tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
+ tmpWar.delete();
+ File webInf = new File(tmpWar, "WEB-INF");
+ webInf.mkdirs();
+
+ File webXml = new File(webInf, "web.xml");
+ FileWriter fw = new FileWriter(webXml);
+ new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+ fw.close();
+
+ File jbossWebXml = new File(webInf, "jboss-web.xml");
+ fw = new FileWriter(jbossWebXml);
+ new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+ fw.close();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to create webservice war", e);
+ }
+
+ Map<String, Object> epProps = endpoint.getProperties();
+ epProps.put("jbossws-endpoint-war-url", tmpWar);
+
+ URL tmpURL = tmpWar.toURL();
+ MBeanServerConnection server = getServer();
+ server.invoke(new ObjectName(MAIN_DEPLOYER), "deploy", new Object[] {
tmpURL }, new String[] { "java.net.URL" });
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+
+ /** Destroys an JAXWS endpoint on the HTTP server */
+ @Override
+ public void destroy(HttpContext context, Endpoint endpoint)
+ {
+ Map<String, Object> epProps = endpoint.getProperties();
+ File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
+ if (tmpWar == null)
+ throw new IllegalStateException("Cannot find endpoint war property");
+
+ try
+ {
+ URL tmpURL = tmpWar.toURL();
+ MBeanServerConnection server = getServer();
+ server.invoke(new ObjectName(MAIN_DEPLOYER), "undeploy", new Object[]
{ tmpURL }, new String[] { "java.net.URL" });
+
+ tmpWar.delete();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+
+ private Class getImplementorClass(Endpoint endpoint)
+ {
+ Object implementor = endpoint.getImplementor();
+ Class implClass = (implementor instanceof Class ? (Class)implementor :
implementor.getClass());
+ return implClass;
+ }
+
+ private MBeanServerConnection getServer() throws NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ MBeanServerConnection server =
(MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ return server;
+ }
+
+ private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+ String implName = implClass.getName();
+
+ Element webApp = DOMUtils.createElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ Element servlet =
(Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+ Element servletName =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+ Element servletClass =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+ servletClass.appendChild(DOMUtils.createTextNode(implName));
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ Element servletMapping =
(Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+ servletName =
(Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+ Element urlPatternElement =
(Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+ String urlPattern = "/*";
+ urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+
+ // Add security-constraint in generated web.xml for Endpoint API
+ // FIXME: JBWS-1069
+
+ return webApp;
+ }
+
+ private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ </jboss-web>
+ */
+ Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+ // Get the context root for this deployment
+ String contextRoot = context.getContextRoot();
+ if (contextRoot == null)
+ throw new WSException("Cannot obtain context root");
+
+ Element root =
(Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+ root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+ // Add security-constraint in generated web.xml for Endpoint API
+ // FIXME: JBWS-1069
+
+ return jbossWeb;
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossHttpServer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossServiceEndpointPublisher.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossServiceEndpointPublisher.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
+
+import java.net.URL;
+
+import javax.management.MBeanServer;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.deployment.ServiceEndpointPublisher;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+
+/**
+ * Publish the HTTP service endpoint to Tomcat
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class JBossServiceEndpointPublisher extends ServiceEndpointPublisher
+{
+
+ public String publishServiceEndpoint(URL warURL) throws Exception
+ {
+ rewriteWebXML(warURL);
+ getMainDeployer().deploy(warURL);
+ return "OK";
+ }
+
+ public String destroyServiceEndpoint(URL warURL) throws Exception
+ {
+ getMainDeployer().undeploy(warURL);
+ return "OK";
+ }
+
+ public String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
+ {
+ URL warURL = udi.localUrl;
+ DeploymentInfo di =
(DeploymentInfo)udi.context.get(DeploymentInfo.class.getName());
+ if (di == null)
+ throw new IllegalStateException("Cannot obtain DeploymentInfo from
context");
+
+ rewriteWebXML(warURL);
+
+ // Preserve the repository config
+ DeploymentInfo auxdi = new DeploymentInfo(warURL, null,
MBeanServerLocator.locateJBoss());
+ auxdi.repositoryConfig = di.getTopRepositoryConfig();
+ getMainDeployer().deploy(auxdi);
+ return "OK";
+ }
+
+ public String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
+ {
+ return destroyServiceEndpoint(udi.localUrl);
+ }
+
+ private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ MainDeployerMBean mainDeployer =
(MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME,
server);
+ return mainDeployer;
+ }
+}
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossServiceEndpointServlet.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/JBossServiceEndpointServlet.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id: ServiceEndpointServlet.java 296 2006-05-08 19:45:49Z thomas.diesler(a)jboss.com $
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.HandlerMetaData;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.config.WSCommonConfig;
+import org.jboss.ws.server.ServiceEndpoint;
+import org.jboss.ws.server.StandardEndpointServlet;
+
+/**
+ * A servlet that is installed for every web service endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-May-2006
+ */
+public class JBossServiceEndpointServlet extends StandardEndpointServlet
+{
+ // provide logging
+ private static final Logger log =
Logger.getLogger(JBossServiceEndpointServlet.class);
+
+ /** Initialize the service endpoint
+ */
+ protected void initServiceEndpoint(String contextPath)
+ {
+ super.initServiceEndpoint(contextPath);
+
+ ServiceEndpoint wsEndpoint = epManager.getServiceEndpointByID(sepId);
+ if (wsEndpoint == null)
+ throw new WSException("Cannot obtain endpoint for: " + sepId);
+
+ // read the config name/file from web.xml
+ ServletContext ctx = getServletContext();
+ String configName = ctx.getInitParameter("jbossws-config-name");
+ String configFile = ctx.getInitParameter("jbossws-config-file");
+ if (configName != null || configFile != null)
+ {
+ log.debug("Updating service endpoint config\n config-name: " +
configName + "\n config-file: " + configFile);
+ ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
+ sepMetaData.setConfigName(configName);
+ sepMetaData.setConfigFile(configFile);
+
+ List<HandlerMetaData> sepHandlers =
sepMetaData.getHandlers(HandlerType.ENDPOINT);
+ sepMetaData.clearHandlers();
+
+ // Add pre handlers
+ WSCommonConfig sepConfig = sepMetaData.getEndpointConfig();
+ sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.PRE));
+
+ // Restore the endpoint handlers
+ sepMetaData.addHandlers(sepHandlers);
+
+ // Add post handlers
+ sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.POST));
+
+ log.debug("Updated server meta data" + sepMetaData);
+ }
+ }
+}
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/PortComponentLinkServlet.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/PortComponentLinkServlet.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.server.ServiceEndpoint;
+import org.jboss.ws.server.ServiceEndpointManager;
+import org.jboss.ws.server.ServiceEndpointManagerFactory;
+
+/**
+ * A servlet that reports the serviceURL for a given service ID.
+ * <p/>
+ * When the web service client ENC is setup, it may contain port-component-link
+ * entries that point to service endpoints in the same top level deployment.
+ * The final serviceURL of those endpoints will become available after the
+ * reference to the javax.xml.rpc.Service is bound to JNDI.
+ * <p/>
+ * When the client does a lookup of the javax.xml.rpc.Service from JNDI the
ObjectFactory
+ * will contact this servlet for the final serviceURL. It is acceptable that the client
+ * wsdl does not contain the correct serviceURL if the client is using the
port-component-link element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-May-2004
+ */
+public class PortComponentLinkServlet extends HttpServlet
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(PortComponentLinkServlet.class);
+
+ protected ServiceEndpointManager epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+
+ /**
+ * Get the serviceURL as string for a given serviceID.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ String pcLink = req.getParameter("pcLink");
+ if (pcLink == null)
+ throw new IllegalArgumentException("Cannot obtain request parameter
'pcLink'");
+
+ ServiceEndpoint serviceEndpoint = epManager.resolvePortComponentLink(pcLink);
+ ;
+ if (serviceEndpoint == null)
+ throw new WSException("Cannot resolve port-component-link: " +
pcLink);
+
+ res.setContentType("text/plain");
+ PrintWriter out = res.getWriter();
+
+ String endpointAddress =
serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
+ out.println(endpointAddress);
+
+ log.debug("Resolved " + pcLink + " to: " + endpointAddress);
+ out.close();
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/PortComponentLinkServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,274 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+//$Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.logging.Logger;
+import org.jboss.system.server.ServerConfig;
+import org.jboss.system.server.ServerConfigLocator;
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.UnifiedMetaData;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a web deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public abstract class ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB.class);
+
+ public URL generatWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData) throws
IOException
+ {
+ // Collect the list of PortComponentMetaData
+ List<EndpointMetaData> epMetaDataList = new
ArrayList<EndpointMetaData>();
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ epMetaDataList.add(epMetaData);
+ }
+ }
+
+ Element webDoc = createWebAppDescriptor(di, epMetaDataList);
+ Element jbossDoc = createJBossWebAppDescriptor(di, epMetaDataList);
+
+ File tmpWar = null;
+ try
+ {
+ ServerConfig config = ServerConfigLocator.locate();
+ File tmpdir = new File(config.getServerTempDir().getCanonicalPath() +
"/deploy");
+
+ String deploymentName = di.getCanonicalName().replace('/', '-')
+ "-ws";
+ tmpWar = File.createTempFile(deploymentName, ".war", tmpdir);
+ tmpWar.delete();
+ File webInf = new File(tmpWar, "WEB-INF");
+ webInf.mkdirs();
+
+ File webXml = new File(webInf, "web.xml");
+ FileWriter fw = new FileWriter(webXml);
+ new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+ fw.close();
+
+ File jbossWebXml = new File(webInf, "jboss-web.xml");
+ fw = new FileWriter(jbossWebXml);
+ new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+ fw.close();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to create webservice.war", e);
+ }
+
+ return tmpWar.toURL();
+ }
+
+ private Element createWebAppDescriptor(DeploymentInfo di, List<EndpointMetaData>
epMetaDataList)
+ {
+ Element webApp = DOMUtils.createElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ Element servlet =
(Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+ Element servletName =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element servletClass =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+ String targetBean = sepMetaData.getServiceEndpointImplName();
+ String seiName = sepMetaData.getServiceEndpointInterfaceName();
+ String servletClassName = (targetBean != null ? targetBean : seiName);
+ servletClass.appendChild(DOMUtils.createTextNode(servletClassName));
+ }
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ ArrayList urlPatters = new ArrayList();
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ Element servletMapping =
(Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+ Element servletName =
(Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element urlPatternElement =
(Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+ String urlPattern = "/*";
+ if (sepMetaData.getURLPattern() != null)
+ {
+ urlPattern = sepMetaData.getURLPattern();
+ }
+
+ if (urlPatters.contains(urlPattern))
+ throw new IllegalArgumentException("Cannot use the same url-pattern with
different endpoints, " + "check your <port-component-uri> in
jboss.xml");
+
+ urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+ urlPatters.add(urlPattern);
+ }
+
+ String authMethod = null;
+
+ // Add web-app/security-constraint for each port component
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ if (sepMetaData.getAuthMethod() != null || sepMetaData.getTransportGuarantee()
!= null)
+ {
+ /*
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>TestUnAuthPort</web-resource-name>
+ <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>*</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ */
+ Element securityConstraint =
(Element)webApp.appendChild(DOMUtils.createElement("security-constraint"));
+ Element wrc =
(Element)securityConstraint.appendChild(DOMUtils.createElement("web-resource-collection"));
+ Element wrName =
(Element)wrc.appendChild(DOMUtils.createElement("web-resource-name"));
+ wrName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element pattern =
(Element)wrc.appendChild(DOMUtils.createElement("url-pattern"));
+ String uri = sepMetaData.getURLPattern();
+ pattern.appendChild(DOMUtils.createTextNode(uri));
+ Element method =
(Element)wrc.appendChild(DOMUtils.createElement("http-method"));
+ method.appendChild(DOMUtils.createTextNode("GET"));
+ method =
(Element)wrc.appendChild(DOMUtils.createElement("http-method"));
+ method.appendChild(DOMUtils.createTextNode("POST"));
+
+ // Optional auth-constraint
+ if (sepMetaData.getAuthMethod() != null)
+ {
+ // Only the first auth-method gives the war login-config/auth-method
+ if (authMethod == null)
+ authMethod = sepMetaData.getAuthMethod();
+
+ Element authConstraint =
(Element)securityConstraint.appendChild(DOMUtils.createElement("auth-constraint"));
+ Element roleName =
(Element)authConstraint.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode("*"));
+ }
+ // Optional user-data-constraint
+ if (sepMetaData.getTransportGuarantee() != null)
+ {
+ Element userData =
(Element)securityConstraint.appendChild(DOMUtils.createElement("user-data-constraint"));
+ Element transport =
(Element)userData.appendChild(DOMUtils.createElement("transport-guarantee"));
+
transport.appendChild(DOMUtils.createTextNode(sepMetaData.getTransportGuarantee()));
+ }
+ }
+ }
+
+ // Optional login-config/auth-method
+ if (authMethod != null)
+ {
+ Element loginConfig =
(Element)webApp.appendChild(DOMUtils.createElement("login-config"));
+ Element method =
(Element)loginConfig.appendChild(DOMUtils.createElement("auth-method"));
+ method.appendChild(DOMUtils.createTextNode(authMethod));
+ Element realm =
(Element)loginConfig.appendChild(DOMUtils.createElement("realm-name"));
+ realm.appendChild(DOMUtils.createTextNode("EJBServiceEndpointServlet
Realm"));
+
+ addEJBSecurityRoles(di, webApp);
+ }
+
+ return webApp;
+ }
+
+ private Element createJBossWebAppDescriptor(DeploymentInfo di,
List<EndpointMetaData> epMetaDataList)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ </jboss-web>
+ */
+ Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+ UnifiedMetaData wsMetaData =
epMetaDataList.get(0).getServiceMetaData().getUnifiedMetaData();
+ String securityDomain = wsMetaData.getSecurityDomain();
+ if (securityDomain != null)
+ {
+ Element secDomain =
(Element)jbossWeb.appendChild(DOMUtils.createElement("security-domain"));
+ secDomain.appendChild(DOMUtils.createTextNode("java:/jaas/" +
securityDomain));
+ }
+
+ // Get the context root for this deployment
+ String contextRoot = null;
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String next = sepMetaData.getContextRoot();
+ if (next != null)
+ {
+ if (contextRoot == null)
+ {
+ contextRoot = next;
+ }
+ else if (contextRoot.equals(next) == false)
+ {
+ throw new WSException("Multiple context root not supported");
+ }
+ }
+ }
+ if (contextRoot == null)
+ throw new WSException("Cannot obtain context root");
+
+ Element root =
(Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+ root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+ return jbossWeb;
+ }
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected abstract void addEJBSecurityRoles(DeploymentInfo di, Element webApp);
+}
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB21.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB21.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+//$Id$
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.AssemblyDescriptorMetaData;
+import org.jboss.ws.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointGeneratorEJB21 extends ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
+ {
+ // Fix:
http://jira.jboss.org/jira/browse/JBWS-309
+ ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
+ AssemblyDescriptorMetaData assemblyDescriptor =
applMetaData.getAssemblyDescriptor();
+ if (assemblyDescriptor != null)
+ {
+ Map securityRoles = assemblyDescriptor.getSecurityRoles();
+ if (securityRoles != null)
+ {
+ Iterator it = securityRoles.keySet().iterator();
+ while (it.hasNext())
+ {
+ Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
+ }
+ }
+ }
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB3.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB3.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+//$Id$
+
+import javax.annotation.security.RolesAllowed;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.WSException;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointGeneratorEJB3 extends ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
+ {
+ // The container objects below provide access to all of the ejb metadata
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
+ {
+ if (manager instanceof StatelessContainer)
+ {
+ StatelessContainer container = (StatelessContainer)manager;
+
+ RolesAllowed anRolesAllowed =
(RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
+ if (anRolesAllowed != null)
+ {
+ for (String role : anRolesAllowed.value())
+ {
+ Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode(role));
+ }
+ }
+ }
+ }
+ }
+
+ private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointGeneratorEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInterceptor.java (from
rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInterceptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,129 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ejb.plugins.AbstractInterceptor;
+import org.jboss.invocation.Invocation;
+import org.jboss.invocation.InvocationKey;
+import org.jboss.logging.Logger;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.common.CommonBindingProvider;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+
+/**
+ * This Interceptor does the ws4ee handler processing.
+ *
+ * According to the ws4ee spec the handler logic must be invoked after the container
+ * applied method level security to the invocation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Sep-2005
+ */
+public class ServiceEndpointInterceptor extends AbstractInterceptor
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ServiceEndpointInterceptor.class);
+
+ // Interceptor implementation --------------------------------------
+
+ /** Before and after we call the service endpoint bean, we process the handler
chains.
+ */
+ public Object invoke(final Invocation mi) throws Exception
+ {
+ // If no msgContext, it's not for us
+ CommonMessageContext msgContext =
(CommonMessageContext)mi.getPayloadValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
+ if (msgContext == null)
+ {
+ return getNext().invoke(mi);
+ }
+
+ // Get the endpoint invocation
+ EndpointInvocation epInv =
(EndpointInvocation)mi.getValue(EndpointInvocation.class.getName());
+ OperationMetaData opMetaData = epInv.getOperationMetaData();
+
+ // Get the handler callback
+ String key = ServiceEndpointInvokerEJB21.HandlerCallback.class.getName();
+ ServiceEndpointInvokerEJB21.HandlerCallback callback =
(ServiceEndpointInvokerEJB21.HandlerCallback)mi.getValue(key);
+
+ // Handlers need to be Tx. Therefore we must invoke the handler chain after the
TransactionInterceptor.
+ if (callback != null && epInv != null)
+ {
+ try
+ {
+ // call the request handlers
+ boolean handlersPass =
callback.callRequestHandlerChain(HandlerType.ENDPOINT);
+ handlersPass = handlersPass &&
callback.callRequestHandlerChain(HandlerType.POST);
+
+ // Call the next interceptor in the chain
+ if (handlersPass)
+ {
+ // The SOAPContentElements stored in the EndpointInvocation might have
changed after
+ // handler processing. Get the updated request payload. This should be a
noop if request
+ // handlers did not modify the incomming SOAP message.
+ Object[] reqParams = epInv.getRequestPayload();
+ mi.setArguments(reqParams);
+ Object resObj = getNext().invoke(mi);
+ epInv.setReturnValue(resObj);
+
+ // Bind the response message
+ CommonBindingProvider bindingProvider = new
CommonBindingProvider(opMetaData.getEndpointMetaData());
+ CommonBinding binding =
(CommonBinding)bindingProvider.getCommonBinding();
+ SOAPMessage resMessage =
(SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
+ msgContext.setSOAPMessage(resMessage);
+ }
+
+ // call the response handlers
+ handlersPass = callback.callResponseHandlerChain(HandlerType.POST);
+ handlersPass = handlersPass &&
callback.callResponseHandlerChain(HandlerType.ENDPOINT);
+
+ // update the return value after response handler processing
+ Object resObj = epInv.getReturnValue();
+
+ return resObj;
+ }
+ catch (Exception ex)
+ {
+ // call the fault handlers
+ boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST, ex);
+ handlersPass = handlersPass &&
callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
+
+ throw ex;
+ }
+ finally
+ {
+ // do nothing
+ }
+ }
+ else
+ {
+ log.warn("Handler callback not available");
+ return getNext().invoke(mi);
+ }
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerEJB21.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerEJB21.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,264 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import java.lang.reflect.Method;
+import java.security.Principal;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.ejb.EjbModule;
+import org.jboss.ejb.Interceptor;
+import org.jboss.ejb.StatelessSessionContainer;
+import org.jboss.invocation.Invocation;
+import org.jboss.invocation.InvocationKey;
+import org.jboss.invocation.InvocationType;
+import org.jboss.invocation.PayloadKey;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.EndpointMetaData.Type;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.server.ServiceEndpointInfo;
+import org.jboss.ws.server.ServiceEndpointInvoker;
+import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * Handles invocations on EJB2.1 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Jan-2005
+ */
+public class ServiceEndpointInvokerEJB21 extends AbstractServiceEndpointInvoker
implements ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
+
+ private String jndiName;
+ private MBeanServer server;
+ private ObjectName objectName;
+
+ public ServiceEndpointInvokerEJB21()
+ {
+ server = MBeanServerLocator.locateJBoss();
+ }
+
+ /** Initialize the service endpoint */
+ @Override
+ public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ super.initServiceEndpoint(seInfo);
+
+ ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
+ String ejbName = epMetaData.getLinkName();
+ if (ejbName == null)
+ throw new WSException("Cannot obtain ejb-link from port component");
+
+ UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)seInfo.getUnifiedDeploymentInfo().metaData;
+ UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
+ if (beanMetaData == null)
+ throw new WSException("Cannot obtain ejb meta data for: " + ejbName);
+
+ // verify the service endpoint
+ String seiName = epMetaData.getServiceEndpointInterfaceName();
+ if (epMetaData.getType() == Type.JAXRPC && seiName != null)
+ {
+ String bmdSEI = beanMetaData.getServiceEndpoint();
+ if (seiName.equals(bmdSEI) == false)
+ throw new WSException("Endpoint meta data defines SEI '" +
seiName + "', <service-endpoint> in ejb-jar.xml defines '" +
bmdSEI + "'");
+ }
+
+ // get the bean's JNDI name
+ jndiName = beanMetaData.getContainerObjectNameJndiName();
+ if (jndiName == null)
+ throw new WSException("Cannot obtain JNDI name for: " + ejbName);
+
+ objectName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + jndiName +
",service=EJB");
+
+ // Dynamically add the service endpoint interceptor
+ //
http://jira.jboss.org/jira/browse/JBWS-758
+ try
+ {
+ EjbModule ejbModule = (EjbModule)server.getAttribute(objectName,
"EjbModule");
+ StatelessSessionContainer container =
(StatelessSessionContainer)ejbModule.getContainer(ejbName);
+
+ boolean injectionPointFound = false;
+ Interceptor prev = container.getInterceptor();
+ while (prev != null && prev.getNext() != null)
+ {
+ Interceptor next = prev.getNext();
+ if (next.getNext() == null)
+ {
+ log.debug("Inject service endpoint interceptor after: " +
prev.getClass().getName());
+ ServiceEndpointInterceptor sepInterceptor = new
ServiceEndpointInterceptor();
+ prev.setNext(sepInterceptor);
+ sepInterceptor.setNext(next);
+ injectionPointFound = true;
+ }
+ prev = next;
+ }
+ if (injectionPointFound == false)
+ log.warn("Cannot service endpoint interceptor injection point");
+ }
+ catch (Exception ex)
+ {
+ log.warn("Cannot add service endpoint interceptor", ex);
+ }
+ }
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ if (server.isRegistered(objectName) == false)
+ throw new WSException("Cannot find service endpoint target: " +
objectName);
+
+ return null;
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
+ {
+ return null;
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+
+ // these are provided by the ServerLoginHandler
+ Principal principal = SecurityAssociation.getPrincipal();
+ Object credential = SecurityAssociation.getCredential();
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+
+ // invoke on the container
+ try
+ {
+ // setup the invocation
+ Method method = epInv.getJavaMethod();
+ Object[] args = epInv.getRequestPayload();
+ Invocation inv = new Invocation(null, method, args, null, principal,
credential);
+
+ inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+ inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getSOAPMessage());
+ inv.setType(InvocationType.SERVICE_ENDPOINT);
+
+ // Set the handler callback and endpoint invocation
+ inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(seInfo),
PayloadKey.TRANSIENT);
+ inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
+
+ String[] sig = { Invocation.class.getName() };
+ Object retObj = server.invoke(objectName, "invoke", new Object[] { inv
}, sig);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ // do nothing
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ else
+ return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ else
+ return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ else
+ return true;
+ }
+
+ // The ServiceEndpointInterceptor calls the methods in this callback
+ public class HandlerCallback
+ {
+ private ServiceEndpointInfo seInfo;
+
+ public HandlerCallback(ServiceEndpointInfo seInfo)
+ {
+ this.seInfo = seInfo;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callRequestHandlerChain(HandlerType type)
+ {
+ if (type != HandlerType.PRE)
+ return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ else
+ return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callResponseHandlerChain(HandlerType type)
+ {
+ if (type != HandlerType.PRE)
+ return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ else
+ return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callFaultHandlerChain(HandlerType type, Exception ex)
+ {
+ if (type != HandlerType.PRE)
+ return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ else
+ return true;
+ }
+
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerEJB3.java (from
rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerEJB3.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,145 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import java.lang.reflect.Method;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.aop.Dispatcher;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.server.ServiceEndpointInfo;
+import org.jboss.ws.server.ServiceEndpointInvoker;
+import org.jboss.ws.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * Handles invocations on EJB3 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jul-2005
+ */
+public class ServiceEndpointInvokerEJB3 extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB3.class);
+
+ private MBeanServer server;
+ private ObjectName objectName;
+
+ public ServiceEndpointInvokerEJB3()
+ {
+ server = MBeanServerLocator.locateJBoss();
+ }
+
+ /** Initialize the service endpoint */
+ @Override
+ public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ super.initServiceEndpoint(seInfo);
+
+ String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
+ UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
+ String nameStr = "jboss.j2ee:name=" + ejbName +
",service=EJB3,jar=" + udi.shortName;
+ if (udi.parent != null)
+ {
+ nameStr += ",ear=" + udi.parent.shortName;
+ }
+
+ objectName = ObjectNameFactory.create(nameStr.toString());
+ }
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ if (server.isRegistered(objectName) == false)
+ throw new WSException("Cannot find service endpoint target: " +
objectName);
+
+ return null;
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
+ {
+ return null;
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+
+ /* [FIXME] how to do this for EJB3
+
+ // these are provided by the ServerLoginHandler
+ Principal principal = SecurityAssociation.getPrincipal();
+ Object credential = SecurityAssociation.getCredential();
+
+ CommonMessageContext msgContext = MessageContextAssociation.getMessageContext();
+
+ Invocation inv = new Invocation(null, method, args, null, principal, credential);
+ inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+ inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getMessage());
+ inv.setType(InvocationType.SERVICE_ENDPOINT);
+ */
+
+ // invoke on the container
+ try
+ {
+ // setup the invocation
+ Method seiMethod = epInv.getJavaMethod();
+ Object[] args = epInv.getRequestPayload();
+
+ Dispatcher dispatcher = Dispatcher.singleton;
+ String canonicalName = objectName.getCanonicalName();
+ StatelessContainer container =
(StatelessContainer)dispatcher.getRegistered(canonicalName);
+ if (container == null)
+ throw new WSException("Cannot obtain container from Dispatcher: " +
canonicalName);
+
+ Class implClass = container.getBeanClass();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object retObj = container.localInvoke(implMethod, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Throwable e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ // do nothing
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerMDB.java (from
rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerMDB.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import java.lang.reflect.Method;
+
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.server.ServiceEndpointInfo;
+import org.jboss.ws.server.ServiceEndpointInvoker;
+import org.jboss.ws.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.utils.ThreadLocalAssociation;
+
+/**
+ * Handles invocations on MDB endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2006
+ */
+public class ServiceEndpointInvokerMDB extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerMDB.class);
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException
+ {
+ return null;
+ }
+
+ // The dispatcher sets the target bean object
+ public void setTargetBeanObject(Object targetMDB)
+ {
+ ThreadLocalAssociation.localInvokerMDBAssoc().set(targetMDB);
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary
+ */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass) throws InstantiationException,
IllegalAccessException
+ {
+ return ThreadLocalAssociation.localInvokerMDBAssoc().get();
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+ try
+ {
+ Class implClass = seiImpl.getClass();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getRequestPayload();
+ Object retObj = implMethod.invoke(seiImpl, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ finally
+ {
+ // cleanup thread local
+ setTargetBeanObject(null);
+ }
+ }
+
+ /** Destroy an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceEndpointInvokerMDB.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceRefMetaDataAdaptor.java (from
rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceRefMetaDataAdaptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+
+import org.jboss.webservice.metadata.serviceref.HandlerMetaData;
+import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
+import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+
+/**
+ * Build container independent service ref meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class ServiceRefMetaDataAdaptor
+{
+ public static UnifiedServiceRefMetaData
buildUnifiedServiceRefMetaData(ServiceRefMetaData srmd)
+ {
+ UnifiedServiceRefMetaData usrmd = new UnifiedServiceRefMetaData();
+ usrmd.setServiceRefName(srmd.getServiceRefName());
+ usrmd.setServiceInterface(srmd.getServiceInterface());
+ usrmd.setWsdlFile(srmd.getWsdlFile());
+ usrmd.setJaxrpcMappingFile(srmd.getJaxrpcMappingFile());
+ usrmd.setServiceQName(srmd.getServiceQName());
+
+ LinkedHashMap<String, UnifiedPortComponentRefMetaData> pcrefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
+ for (PortComponentRefMetaData pcmd : srmd.getPortComponentRefs())
+ {
+ UnifiedPortComponentRefMetaData upcmd = new UnifiedPortComponentRefMetaData();
+ upcmd.setServiceEndpointInterface(pcmd.getServiceEndpointInterface());
+ upcmd.setPortComponentLink(pcmd.getPortComponentLink());
+ upcmd.setCallProperties(pcmd.getCallProperties());
+ pcrefs.put(pcmd.getServiceEndpointInterface(), upcmd);
+ }
+ usrmd.setPortComponentRefs(pcrefs);
+
+ ArrayList<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
+ for (HandlerMetaData hmd : srmd.getHandlers())
+ {
+ UnifiedHandlerMetaData uhmd = new UnifiedHandlerMetaData(null);
+ uhmd.setHandlerName(hmd.getHandlerName());
+ uhmd.setHandlerClass(hmd.getHandlerClass());
+ Arrays.asList(hmd.getSoapHeaders());
+
+ for(String portname : hmd.getPortNames())
+ {
+ uhmd.addPortName(portname);
+ }
+ for (InitParamMetaData ipmd : hmd.getInitParams())
+ {
+ HandlerInitParam ip = new HandlerInitParam();
+ ip.setParamName(ipmd.getParamName());
+ ip.setParamValue(ipmd.getParamValue());
+ uhmd.addInitParam(ip);
+ }
+ handlers.add(uhmd);
+ }
+ usrmd.setHandlers(handlers);
+
+ usrmd.setConfigName(srmd.getConfigName());
+ usrmd.setConfigFile(srmd.getConfigFile());
+ usrmd.setWsdlOverride(srmd.getWsdlOverride());
+ usrmd.setCallProperties(srmd.getCallProperties());
+ usrmd.setResourceCL(srmd.getResourceCL());
+
+ return usrmd;
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/ServiceRefMetaDataAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/WebMetaDataAdaptor.java (from
rev 1317, trunk/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebMetaDataAdaptor.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import org.jboss.metadata.WebMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+
+/**
+ * Build container independent web meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class WebMetaDataAdaptor
+{
+ public static UnifiedWebMetaData buildUnifiedWebMetaData(WebMetaData wmd)
+ {
+ UnifiedWebMetaData umd = new UnifiedWebMetaData();
+ umd.setContextRoot(wmd.getContextRoot());
+ umd.setServletMappings(wmd.getServletMappings());
+ umd.setServletClassMap(wmd.getServletClassMap());
+ umd.setConfigName(wmd.getConfigName());
+ umd.setConfigFile(wmd.getConfigFile());
+ umd.setContextLoader(wmd.getContextLoader());
+ umd.setSecurityDomain(wmd.getSecurityDomain());
+ //umd.setWsdlPublishLocationMap(wmd.getWsdlPublishLocationMap());
+ return umd;
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebMetaDataAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,139 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+// $Id$
+
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.naming.Context;
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.xml.rpc.JAXRPCException;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.naming.Util;
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.ws.WSException;
+import org.jboss.ws.deployment.JSR109ClientDeployment;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.jaxrpc.ServiceReferenceable;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.metadata.wsdl.WSDL11DefinitionFactory;
+
+/**
+ * Binds a JAXRPC Service object in the client's ENC for every service-ref element in
the
+ * deployment descriptor.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class WebServiceClientDeployer extends ServiceMBeanSupport implements
WebServiceClientDeployerMBean
+{
+ /**
+ * This binds a jaxrpc Service into the callers ENC for every service-ref element
+ *
+ * @param envCtx ENC to bind the javax.rpc.xml.Service object to
+ * @param serviceRefs An iterator of the service-ref elements in the client deployment
descriptor
+ * @param di The client's deployment info
+ * @throws org.jboss.deployment.DeploymentException if it goes wrong
+ */
+ public void setupServiceRefEnvironment(Context envCtx, Iterator serviceRefs,
DeploymentInfo di) throws DeploymentException
+ {
+ try
+ {
+ while (serviceRefs.hasNext())
+ {
+ ServiceRefMetaData serviceRef = (ServiceRefMetaData)serviceRefs.next();
+ String serviceRefName = serviceRef.getServiceRefName();
+
+ UnifiedServiceRefMetaData wsServiceRef =
ServiceRefMetaDataAdaptor.buildUnifiedServiceRefMetaData(serviceRef);
+
+ JavaWsdlMapping javaWsdlMapping = getJavaWsdlMapping(wsServiceRef);
+ wsServiceRef.setJavaWsdlMapping(javaWsdlMapping);
+
+ Definition wsdlDefinition = getWsdlDefinition(wsServiceRef);
+ wsServiceRef.setWsdlDefinition(wsdlDefinition);
+
+ // build the container independent deployment info
+ UnifiedDeploymentInfo udi = new
JSR109ClientDeployment(UnifiedDeploymentInfo.DeploymentType.JSR109_Client);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ ServiceReferenceable ref = new ServiceReferenceable(wsServiceRef, udi);
+ Util.bind(envCtx, serviceRefName, ref);
+
+ log.debug("Webservice binding: java:comp/env/" + serviceRefName);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Cannot bind webservice to client
environment", e);
+ }
+ }
+
+ private JavaWsdlMapping getJavaWsdlMapping(UnifiedServiceRefMetaData serviceRef)
+ {
+ JavaWsdlMapping javaWsdlMapping = null;
+ URL mappingURL = serviceRef.getJavaWsdlMappingURL();
+ if (mappingURL != null)
+ {
+ try
+ {
+ // setup the XML binding Unmarshaller
+ JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
+ javaWsdlMapping = mappingFactory.parse(mappingURL);
+ }
+ catch (Exception e)
+ {
+ throw new JAXRPCException("Cannot unmarshal jaxrpc-mapping-file: "
+ mappingURL, e);
+ }
+ }
+ return javaWsdlMapping;
+ }
+
+ private Definition getWsdlDefinition(UnifiedServiceRefMetaData serviceRef)
+ {
+ Definition wsdlDefinition = null;
+ {
+ URL wsdlOverride = serviceRef.getWsdlOverride();
+ URL wsdlURL = serviceRef.getWsdlURL();
+ if (wsdlOverride == null && wsdlURL != null)
+ {
+ try
+ {
+ WSDL11DefinitionFactory factory = WSDL11DefinitionFactory.newInstance();
+ wsdlDefinition = factory.parse(wsdlURL);
+ }
+ catch (WSDLException e)
+ {
+ throw new WSException("Cannot unmarshall wsdl, cause: " +
e.toString());
+ }
+ }
+ }
+ return wsdlDefinition;
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployerMBean.java
(from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployerMBean.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.ws.integration.jboss40;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.utils.ObjectNameFactory;
+import org.jboss.system.ServiceMBean;
+import org.jboss.webservice.WebServiceClientDeployment;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface WebServiceClientDeployerMBean extends WebServiceClientDeployment,
ServiceMBean
+{
+ // default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceClientDeployer");
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployerMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/integration/jboss40/jms (from rev 1317,
trunk/src/main/java/org/jboss/ws/integration/jboss/jms)
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/JMSMessageDispatcher.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/jms/JMSMessageDispatcher.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/JMSMessageDispatcher.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -19,7 +19,7 @@
* 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.ws.integration.jboss.jms;
+package org.jboss.ws.integration.jboss40.jms;
// $Id$
@@ -34,7 +34,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.integration.jboss.ServiceEndpointInvokerMDB;
+import org.jboss.ws.integration.jboss40.ServiceEndpointInvokerMDB;
import org.jboss.ws.metadata.ServerEndpointMetaData;
import org.jboss.ws.server.ServiceEndpoint;
import org.jboss.ws.server.ServiceEndpointInvoker;
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/JMSTransportSupport.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/jms/JMSTransportSupport.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/JMSTransportSupport.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -19,7 +19,7 @@
* 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.ws.integration.jboss.jms;
+package org.jboss.ws.integration.jboss40.jms;
// $Id$
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/MessageDispatcher.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss/jms/MessageDispatcher.java 2006-10-27
07:43:19 UTC (rev 1317)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss40/jms/MessageDispatcher.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -19,7 +19,7 @@
* 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.ws.integration.jboss.jms;
+package org.jboss.ws.integration.jboss40.jms;
// $Id:MessageDispatcher.java 898 2006-09-05 08:23:03Z thomas.diesler(a)jboss.com $
Added: trunk/src/main/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB3.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB3.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB3.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jboss50;
+
+//$Id$
+
+import javax.management.MBeanServer;
+
+import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.kernel.Kernel;
+import org.jboss.logging.Logger;
+
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB3 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public class WebServiceDeployerEJB3 extends AbstractSimpleDeployer
+{
+ // logging support
+ private static Logger log = Logger.getLogger(WebServiceDeployerEJB3.class);
+
+ private MBeanServer mbeanServer;
+ private Kernel kernel;
+
+ public Kernel getKernel()
+ {
+ return kernel;
+ }
+
+ public void setKernel(Kernel kernel)
+ {
+ this.kernel = kernel;
+ }
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ @Override
+ public void deploy(DeploymentUnit dunit) throws DeploymentException
+ {
+ log.info("deploy: " + dunit);
+ }
+
+ /*
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
+ {
+ UnifiedDeploymentInfo udi = new
JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB3);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
+
+ // The container objects below provide access to all of the ejb metadata
+ ArrayList<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ for (Object container : ejb3Module.getContainers().values())
+ {
+ if (container instanceof StatelessContainer)
+ {
+ StatelessContainer slc = (StatelessContainer)container;
+ UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
+ uslc.setEjbName(slc.getEjbName());
+ uslc.setEjbClass(slc.getBeanClassName());
+ beans.add(uslc);
+ }
+ }
+
+ UnifiedApplicationMetaData appMetaData = new UnifiedApplicationMetaData();
+ appMetaData.setEnterpriseBeans(beans);
+ udi.metaData = appMetaData;
+
+ return udi;
+ }
+ /*
+
+ /** Return true if the deployment is a web service endpoint
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ boolean isWebserviceDeployment = false;
+
+ // Check if the ejb3 contains annotated endpoints
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
+ {
+ if (manager instanceof StatelessContainer)
+ {
+ StatelessContainer container = (StatelessContainer)manager;
+ if (container.resolveAnnotation(WebService.class) != null)
+ {
+ isWebserviceDeployment = true;
+ break;
+ }
+ }
+ }
+
+ return isWebserviceDeployment;
+ }
+
+ private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
+
+ protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
+ {
+ return new ServiceEndpointGeneratorEJB3().generatWebDeployment(di, wsMetaData);
+ }
+ */
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/org/jboss/ws/integration/jbossall/ServerConfigImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jbossall/ServerConfigImpl.java 2006-10-30
11:56:59 UTC (rev 1329)
+++ trunk/src/main/java/org/jboss/ws/integration/jbossall/ServerConfigImpl.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.integration.jbossall;
+
+//$Id$
+
+import java.io.File;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.server.ServerConfig;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * JBoss specific implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class ServerConfigImpl implements ServerConfig
+{
+ public File getServerTempDir()
+ {
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getServerDataDir()
+ {
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/integration/jbossall/ServerConfigImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2006-10-30 11:56:59
UTC (rev 1329)
+++ trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2006-10-30 14:13:14
UTC (rev 1330)
@@ -1,42 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
-<deployment
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<deployment
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="ServiceEndpointManager"
class="org.jboss.ws.server.ServiceEndpointManager">
- <!--
- The WSDL, that is a required deployment artifact for an endpoint, has a
<soap:address>
- element which points to the location of the endpoint. JBoss supports rewriting of
that SOAP address.
-
- If the content of <soap:address> is a valid URL, JBossWS will not rewrite
it unless AlwaysModifySOAPAddress is true.
- If the content of <soap:address> is not a valid URL, JBossWS will rewrite
it using the attribute values given below.
- -->
- <property
name="webServiceHost">${jboss.bind.address}</property>
- <property name="webServiceSecurePort">8443</property>
- <property name="webServicePort">8080</property>
- <property name="alwaysModifySOAPAddress">true</property>
-
- <property
name="serviceEndpointInvokerJSE">org.jboss.ws.server.ServiceEndpointInvokerJSE</property>
- <property
name="serviceEndpointInvokerEJB21">org.jboss.ws.integration.jboss.ServiceEndpointInvokerEJB21</property>
- <property
name="serviceEndpointInvokerEJB3">org.jboss.ws.integration.jboss.ServiceEndpointInvokerEJB3</property>
- <property
name="serviceEndpointInvokerMDB">org.jboss.ws.integration.jboss.ServiceEndpointInvokerMDB</property>
- </bean>
-
- <bean name="ServiceEndpointDeployer"
class="org.jboss.ws.deployment.ServiceEndpointDeployer">
- <property name="serviceEndpointManager"><inject
bean="ServiceEndpointManager"/></property>
- </bean>
-
- <bean name="ServiceEndpointPublisher"
class="org.jboss.ws.integration.jboss.JBossServiceEndpointPublisher">
- <property name="serviceEndpointDeployer"><inject
bean="ServiceEndpointDeployer"/></property>
- <property
name="serviceEndpointServlet">org.jboss.ws.integration.jboss.JBossServiceEndpointServlet</property>
- </bean>
-
- <!-- A subscription manager for WS-Eventing -->
- <bean name="SubscriptionManager"
class="org.jboss.ws.eventing.mgmt.SubscriptionManager"/>
- <bean name="ServerConfig"
class="org.jboss.ws.integration.jboss.ServerConfigImpl"/>
+ <bean name="ServiceEndpointManager"
class="org.jboss.ws.server.ServiceEndpointManager">
+
+ <!--
+ The WSDL, that is a required deployment artifact for an endpoint, has a
<soap:address>
+ element which points to the location of the endpoint. JBoss supports rewriting of
that SOAP address.
+
+ If the content of <soap:address> is a valid URL, JBossWS will not rewrite it
unless AlwaysModifySOAPAddress is true.
+ If the content of <soap:address> is not a valid URL, JBossWS will rewrite it
using the attribute values given below.
+ -->
+ <property
name="webServiceHost">${jboss.bind.address}</property>
+ <property name="webServiceSecurePort">8443</property>
+ <property name="webServicePort">8080</property>
+ <property name="alwaysModifySOAPAddress">true</property>
+
+ <property
name="serviceEndpointInvokerJSE">org.jboss.ws.server.ServiceEndpointInvokerJSE</property>
+ <property
name="serviceEndpointInvokerEJB21">org.jboss.ws.integration.jboss.ServiceEndpointInvokerEJB21</property>
+ <property
name="serviceEndpointInvokerEJB3">org.jboss.ws.integration.jboss.ServiceEndpointInvokerEJB3</property>
+ <property
name="serviceEndpointInvokerMDB">org.jboss.ws.integration.jboss.ServiceEndpointInvokerMDB</property>
+ </bean>
- <bean name="KernelLocator"
class="org.jboss.ws.server.KernelLocator"/>
-
-</deployment>
+ <bean name="ServiceEndpointDeployer"
class="org.jboss.ws.deployment.ServiceEndpointDeployer">
+ <property name="serviceEndpointManager">
+ <inject bean="ServiceEndpointManager"/>
+ </property>
+ </bean>
+
+ <!--
+ <bean name="ServiceEndpointPublisher"
class="org.jboss.ws.integration.jboss.JBossServiceEndpointPublisher">
+ <property name="serviceEndpointDeployer"><inject
bean="ServiceEndpointDeployer"/></property>
+ <property
name="serviceEndpointServlet">org.jboss.ws.integration.jboss.JBossServiceEndpointServlet</property>
+ </bean>
+ -->
+
+ <!-- A subscription manager for WS-Eventing -->
+ <bean name="SubscriptionManager"
class="org.jboss.ws.eventing.mgmt.SubscriptionManager"/>
+
+ <bean name="ServerConfig"
class="org.jboss.ws.integration.jbossall.ServerConfigImpl"/>
+
+ <bean name="KernelLocator"
class="org.jboss.ws.server.KernelLocator"/>
+
+</deployment>
\ No newline at end of file
Added: trunk/src/main/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
---
trunk/src/main/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/main/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml 2006-10-30
14:13:14 UTC (rev 1330)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="WebServiceDeployerEJB3"
class="org.jboss.ws.integration.jboss50.WebServiceDeployerEJB3">
+ <install bean="MainDeployer" method="addDeployer">
+ <parameter>
+ <this/>
+ </parameter>
+ </install>
+ <uninstall bean="MainDeployer" method="removeDeployer">
+ <parameter>
+ <this/>
+ </parameter>
+ </uninstall>
+ <property name="kernel">
+ <inject bean="jboss.kernel:service=Kernel"/>
+ </property>
+ <property name="mbeanServer">
+ <inject bean="JMXKernel" property="mbeanServer"/>
+ </property>
+ <depends>AspectDeployer</depends>
+ </bean>
+
+</deployment>
\ No newline at end of file
Property changes on:
trunk/src/main/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/main/resources/jbossws.sar/META-INF/jboss-service.xml
===================================================================
--- trunk/src/main/resources/jbossws.sar/META-INF/jboss-service.xml 2006-10-30 11:56:59
UTC (rev 1329)
+++ trunk/src/main/resources/jbossws.sar/META-INF/jboss-service.xml 2006-10-30 14:13:14
UTC (rev 1330)
@@ -6,44 +6,44 @@
<!--
A deployer service for WS clients.
- -->
<mbean name="jboss.ws:service=WebServiceClientDeployer"
code="org.jboss.ws.integration.jboss.WebServiceClientDeployer">
<depends>jboss:service=Naming</depends>
</mbean>
+ -->
<!--
A deployer service for JSE endpoints.
- -->
<mbean name="jboss.ws:service=WebServiceDeployerJSE"
code="org.jboss.ws.integration.jboss.DeployerInterceptorJSE">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.web:service=WebServer</depends-list-element>
</depends-list>
</mbean>
+ -->
<!--
A deployer service for EJB2.1 endpoints.
- -->
<mbean name="jboss.ws:service=DeployerInterceptorEJB21"
code="org.jboss.ws.integration.jboss.DeployerInterceptorEJB21">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.ejb:service=EJBDeployer</depends-list-element>
</depends-list>
</mbean>
+ -->
<!--
A deployer service for EJB3 endpoints.
- -->
<mbean name="jboss.ws:service=DeployerInterceptorEJB3"
code="org.jboss.ws.integration.jboss.DeployerInterceptorEJB3">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.ejb3:service=EJB3Deployer</depends-list-element>
</depends-list>
</mbean>
+ -->
<!--
A deployer service for JSE endpoints that are nested in service archives (sar).
- -->
<mbean name="jboss.ws:service=DeployerInterceptorNestedJSE"
code="org.jboss.ws.integration.jboss.DeployerInterceptorNestedJSE">
<depends optional-attribute-name="MainDeployer"
proxy-type="attribute">jboss.system:service=MainDeployer</depends>
<depends>jboss.ws:service=WebServiceDeployerJSE</depends>
</mbean>
+ -->
</server>
Modified: trunk/src/main/resources/jbossws14.sar/META-INF/jboss-service.xml
===================================================================
--- trunk/src/main/resources/jbossws14.sar/META-INF/jboss-service.xml 2006-10-30 11:56:59
UTC (rev 1329)
+++ trunk/src/main/resources/jbossws14.sar/META-INF/jboss-service.xml 2006-10-30 14:13:14
UTC (rev 1330)
@@ -6,28 +6,28 @@
<!--
A deployer service for WS clients.
- -->
<mbean name="jboss.ws:service=WebServiceClientDeployer"
code="org.jboss.ws.integration.jboss.WebServiceClientDeployer">
<depends>jboss:service=Naming</depends>
</mbean>
+ -->
<!--
A deployer service for JSE endpoints.
- -->
<mbean name="jboss.ws:service=WebServiceDeployerJSE"
code="org.jboss.ws.integration.jboss.DeployerInterceptorJSE">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.web:service=WebServer</depends-list-element>
</depends-list>
</mbean>
+ -->
<!--
A deployer service for EJB2.1 endpoints.
- -->
<mbean name="jboss.ws:service=DeployerInterceptorEJB21"
code="org.jboss.ws.integration.jboss.DeployerInterceptorEJB21">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.ejb:service=EJBDeployer</depends-list-element>
</depends-list>
</mbean>
+ -->
<!--
A deployer service for EJB3 endpoints.
@@ -40,10 +40,10 @@
<!--
A deployer service for JSE endpoints that are nested in service archives (sar).
- -->
<mbean name="jboss.ws:service=DeployerInterceptorNestedJSE"
code="org.jboss.ws.integration.jboss.DeployerInterceptorNestedJSE">
<depends optional-attribute-name="MainDeployer"
proxy-type="attribute">jboss.system:service=MainDeployer</depends>
<depends>jboss.ws:service=WebServiceDeployerJSE</depends>
</mbean>
+ -->
</server>
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java 2006-10-30
11:56:59 UTC (rev 1329)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java 2006-10-30
14:13:14 UTC (rev 1330)
@@ -11,7 +11,7 @@
import java.rmi.RemoteException;
import org.jboss.logging.Logger;
-import org.jboss.ws.integration.jboss.jms.JMSTransportSupport;
+import org.jboss.ws.integration.jboss40.jms.JMSTransportSupport;
/**
* An example of a MDB acting as a web service endpoint.