Author: thomas.diesler(a)jboss.com
Date: 2007-03-03 06:53:17 -0500 (Sat, 03 Mar 2007)
New Revision: 2510
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21MBean.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3MBean.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSE.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSEMBean.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSE.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSEMBean.java
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeploymentInfoAdaptor.java
Modified:
trunk/build/ant-import/build-thirdparty.xml
trunk/integration-jboss40/.classpath
trunk/integration-jboss40/build.xml
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/secureejb/SecureEJBTestCase.java
trunk/jbossws-tests/src/main/resources/jaxrpc/samples/secureejb/META-INF/jboss.xml
Log:
[JBWS-1558] Add support for <secure-wsdl-access> in <port-component>
Modified: trunk/build/ant-import/build-thirdparty.xml
===================================================================
--- trunk/build/ant-import/build-thirdparty.xml 2007-03-02 14:41:35 UTC (rev 2509)
+++ trunk/build/ant-import/build-thirdparty.xml 2007-03-03 11:53:17 UTC (rev 2510)
@@ -151,7 +151,7 @@
<path refid="core.classpath"/>
</path>
- <!-- The compile classpath for jboss42 integration -->
+ <!-- The compile classpath for tomcat integration -->
<path id="tomcat.integration.classpath">
<path refid="core.classpath"/>
</path>
Modified: trunk/integration-jboss40/.classpath
===================================================================
--- trunk/integration-jboss40/.classpath 2007-03-02 14:41:35 UTC (rev 2509)
+++ trunk/integration-jboss40/.classpath 2007-03-03 11:53:17 UTC (rev 2510)
@@ -3,7 +3,6 @@
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src"
path="/jbossws-core"/>
- <classpathentry combineaccessrules="false" kind="src"
path="/integration-jboss42"/>
<classpathentry kind="lib" path="/build/thirdparty/ant.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/activation.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/commons-logging.jar"/>
@@ -31,5 +30,6 @@
<classpathentry kind="lib"
path="/build/thirdparty/mail.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/jboss-common.jar"
sourcepath="/build/thirdparty/jboss-common-sources.jar"/>
<classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-4.0.x"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/integration-jboss42"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/integration-jboss40/build.xml
===================================================================
--- trunk/integration-jboss40/build.xml 2007-03-02 14:41:35 UTC (rev 2509)
+++ trunk/integration-jboss40/build.xml 2007-03-03 11:53:17 UTC (rev 2510)
@@ -57,17 +57,12 @@
<!-- Compile integration java sources -->
<target name="jboss40-compile-classes"
depends="jboss40-init,core-compile">
<mkdir dir="${jboss40.output.classes.dir}"/>
- <javac sourcepath="" destdir="${jboss40.output.classes.dir}"
encoding="utf-8" debug="${javac.debug}"
verbose="${javac.verbose}"
+ <javac destdir="${jboss40.output.classes.dir}"
encoding="utf-8" debug="${javac.debug}"
verbose="${javac.verbose}"
deprecation="${javac.deprecation}"
failonerror="${javac.fail.onerror}">
<src location="${jboss42.java.dir}"/>
<src location="${jboss40.java.dir}"/>
<include name="org/jboss/ws/integration/jboss40/**"/>
- <include name="org/jboss/ws/integration/jboss42/**"/>
- <exclude
name="org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java"/>
- <exclude
name="org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java"/>
- <exclude
name="org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java"/>
- <exclude
name="org/jboss/ws/integration/jboss42/ServiceRefHandlerMBean.java"/>
- <exclude
name="org/jboss/ws/integration/jboss42/ServiceRefHandler.java"/>
+ <exclude
name="org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java"/>
<classpath refid="jboss40.integration.classpath"/>
<classpath path="${core.output.classes14.dir}"/>
<classpath path="${core.output.classes.dir}"/>
@@ -75,13 +70,11 @@
</target>
<target name="jboss40-compile-ejb3-classes"
depends="jboss40-init,core-compile,jboss40-check-ejb3-classes"
if="jboss40.ejb3.available">
<mkdir dir="${jboss40.output.classes.dir}"/>
- <javac sourcepath="" destdir="${jboss40.output.classes.dir}"
encoding="utf-8" debug="${javac.debug}"
verbose="${javac.verbose}"
+ <javac destdir="${jboss40.output.classes.dir}"
encoding="utf-8" debug="${javac.debug}"
verbose="${javac.verbose}"
deprecation="${javac.deprecation}"
failonerror="${javac.fail.onerror}">
<src location="${jboss42.java.dir}"/>
<src location="${jboss40.java.dir}"/>
- <include
name="org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java"/>
- <include
name="org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java"/>
- <include
name="org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java"/>
+ <include
name="org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java"/>
<classpath refid="jboss40.integration.classpath"/>
<classpath path="${core.output.classes14.dir}"/>
<classpath path="${core.output.classes.dir}"/>
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -0,0 +1,125 @@
+/*
+ * 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;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
+
+/**
+ * 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.setPublishLocationAdapter(getPublishLocationAdpater(apmd));
+ return umd;
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final
ApplicationMetaData apmd)
+ {
+ return new PublishLocationAdapter ()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ return apmd.getWsdlPublishLocationByName(name);
+ }
+ };
+ }
+
+ 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.setServiceEndpointInterface(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/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/ApplicationMetaDataAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -0,0 +1,212 @@
+/*
+ * 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.deployment.DeploymentException;
+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.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.core.server.ServiceEndpointDeployer;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * 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 final Object create(Invocation invocation, DeploymentInfo di) throws
Throwable
+ {
+ Object retn = invokeNext(invocation);
+ if (isWebserviceDeployment(di))
+ {
+ try
+ {
+ createServiceEndpoint(di);
+ }
+ catch (Exception ex)
+ {
+ destroyServiceEndpoint(di);
+ DeploymentException.rethrowAsDeploymentException("Cannot create service
endpoint", ex);
+ }
+ }
+ return retn;
+ }
+
+ /** Overwrite to start the webservice
+ */
+ protected final Object start(Invocation invocation, DeploymentInfo di) throws
Throwable
+ {
+ Object retn = invokeNext(invocation);
+ try
+ {
+ startServiceEndpoint(di);
+ }
+ catch (Exception ex)
+ {
+ destroyServiceEndpoint(di);
+ DeploymentException.rethrowAsDeploymentException("Cannot start service
endpoint", ex);
+ }
+ return retn;
+ }
+
+ /** Overwrite to stop the webservice
+ */
+ protected final Object stop(Invocation invocation, DeploymentInfo di) throws
Throwable
+ {
+ stopServiceEndpoint(di);
+ return invokeNext(invocation);
+ }
+
+ /** Overwrite to destroy the webservice
+ */
+ protected final Object destroy(Invocation invocation, DeploymentInfo di) throws
Throwable
+ {
+ destroyServiceEndpoint(di);
+ return invokeNext(invocation);
+ }
+
+ protected void createServiceEndpoint(DeploymentInfo di) throws Exception
+ {
+ log.debug("create: " + di.url);
+ UnifiedDeploymentInfo udi = createUnifiedDeploymentInfo(di);
+ di.context.put(UnifiedDeploymentInfo.class.getName(), udi);
+ getServiceEndpointDeployer().create(udi);
+ }
+
+ protected void startServiceEndpoint(DeploymentInfo di) throws Exception
+ {
+ UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(di);
+ if (udi != null)
+ {
+ log.debug("start: " + di.url);
+
+ // late initialization of the web context loader
+ if (di.metaData instanceof WebMetaData)
+ {
+ ClassLoader classLoader = ((WebMetaData)di.metaData).getContextLoader();
+ udi.classLoader = classLoader;
+ }
+
+ getServiceEndpointDeployer().start(udi);
+ }
+ }
+
+ protected void stopServiceEndpoint(DeploymentInfo di) throws Exception
+ {
+ UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(di);
+ if (udi != null)
+ {
+ log.debug("stop: " + di.url);
+ getServiceEndpointDeployer().stop(udi);
+ }
+ }
+
+ protected void destroyServiceEndpoint(DeploymentInfo di) throws Exception
+ {
+ UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(di);
+ if (udi != null)
+ {
+ log.debug("destroy: " + di.url);
+ getServiceEndpointDeployer().destroy(udi);
+ }
+ }
+
+ protected ServiceEndpointDeployer getServiceEndpointDeployer()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
+ return (ServiceEndpointDeployer)entry.getTarget();
+ }
+
+ protected AbstractServiceEndpointPublisher getServiceEndpointPublisher()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry =
registry.getEntry(AbstractServiceEndpointPublisher.BEAN_NAME);
+ return (AbstractServiceEndpointPublisher)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 Exception;
+
+ protected UnifiedDeploymentInfo getUnifiedDeploymentInfo(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);
+ }
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -0,0 +1,67 @@
+/*
+ * 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.net.URL;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.umdm.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 void createServiceEndpoint(DeploymentInfo di) throws Exception
+ {
+ super.createServiceEndpoint(di);
+
+ UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(di);
+ if (udi != null)
+ {
+ UnifiedMetaData wsMetaData =
getServiceEndpointDeployer().getUnifiedMetaData(udi);
+ udi.webappURL = generateWebDeployment(di, wsMetaData);
+ udi.context.put(DeploymentInfo.class.getName(), di);
+ getServiceEndpointPublisher().publishServiceEndpoint(udi);
+ }
+ }
+
+ protected abstract URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData
wsMetaData) throws IOException;
+
+ protected void destroyServiceEndpoint(DeploymentInfo di) throws Exception
+ {
+ super.destroyServiceEndpoint(di);
+
+ UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(di);
+ if (udi != null)
+ {
+ getServiceEndpointPublisher().destroyServiceEndpoint(udi);
+ }
+ }
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -0,0 +1,118 @@
+/*
+ * 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.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.core.UnifiedVirtualFile;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.jboss42.ServiceEndpointGeneratorEJB21;
+import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
+import org.jboss.ws.metadata.umdm.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
+ {
+ UnifiedVirtualFile vfsWebservices = getWebservicesFile(di);
+ UnifiedDeploymentInfo udi = new
JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_EJB21, vfsWebservices);
+ 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 = getWebservicesFile(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);
+ if (ejbClass.isAnnotationPresent(javax.jws.WebService.class))
+ throw new UnsupportedOperationException("JAXWS not supported on
EJB2.1 endpoints");
+ }
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new WSException(e);
+ }
+ }
+
+ applMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
+ private UnifiedVirtualFile getWebservicesFile(DeploymentInfo di)
+ {
+ UnifiedVirtualFile vfsRoot = new ResourceLoaderAdapter(di.localCl);
+ try
+ {
+ return vfsRoot.findChild("META-INF/webservices.xml");
+ }
+ catch (IOException e)
+ {
+ return null;
+ }
+ }
+
+ protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
+ {
+ ServiceEndpointGeneratorEJB21 generator = new ServiceEndpointGeneratorEJB21();
+ return generator.generatWebDeployment(wsMetaData, di);
+ }
+
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21MBean.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21MBean.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21MBean.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -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.core.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");
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB21MBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -0,0 +1,130 @@
+/*
+ * 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.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.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.jboss42.ServiceEndpointGeneratorEJB3;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * 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
JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_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(wsMetaData, di);
+ }
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3MBean.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3MBean.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3MBean.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -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.core.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");
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorEJB3MBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSE.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSE.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSE.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -0,0 +1,170 @@
+/*
+ * 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.util.Iterator;
+import java.util.Map;
+
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.UnifiedVirtualFile;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher.RewriteResults;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.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
+{
+ /** 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 (getWebservicesFile(di) != null)
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXRPC_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(WebService.class) ||
servletClass.isAnnotationPresent(WebServiceProvider.class))
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+ }
+
+ webMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
+ {
+ UnifiedDeploymentInfo udi;
+
+ DeploymentType type =
(DeploymentType)di.context.get("UnifiedDeploymentInfo.Type");
+ if (type == UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE)
+ {
+ UnifiedVirtualFile vfsWebservices = getWebservicesFile(di);
+ udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
vfsWebservices);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ else if (type == UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE)
+ {
+ udi = new JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_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 void createServiceEndpoint(DeploymentInfo di) throws Exception
+ {
+ super.createServiceEndpoint(di);
+ UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(di);
+ if (udi != null)
+ {
+ AbstractServiceEndpointPublisher endpointPublisher =
getServiceEndpointPublisher();
+ RewriteResults results = endpointPublisher.rewriteWebXml(udi);
+ updateServiceEndpointTargetBeans(udi, results);
+ }
+ }
+
+ private void updateServiceEndpointTargetBeans(UnifiedDeploymentInfo udi,
RewriteResults results)
+ {
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+ Map<String, String> sepTargetMap = results.sepTargetMap;
+
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String targetBean = sepTargetMap.get(sepMetaData.getLinkName());
+ sepMetaData.setServiceEndpointImplName(targetBean);
+ }
+ }
+ }
+
+ private UnifiedVirtualFile getWebservicesFile(DeploymentInfo di)
+ {
+ UnifiedVirtualFile vfsRoot = new ResourceLoaderAdapter(di.localCl);
+ try
+ {
+ return vfsRoot.findChild("WEB-INF/webservices.xml");
+ }
+ catch (IOException e)
+ {
+ return null;
+ }
+ }
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSEMBean.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSEMBean.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSEMBean.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -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.core.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");
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorJSEMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSE.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSE.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSE.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -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$
+
+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.core.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);
+ }
+ }
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSEMBean.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSEMBean.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSEMBean.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -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$
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerMBean;
+import org.jboss.ws.core.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);
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeployerInterceptorNestedJSEMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeploymentInfoAdaptor.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeploymentInfoAdaptor.java
(rev 0)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeploymentInfoAdaptor.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -0,0 +1,91 @@
+/*
+ * 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.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.jboss42.WebMetaDataAdaptor;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
+
+/**
+ * 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) throws Exception
+ {
+ if (di.parent != null)
+ {
+ udi.parent = new UnifiedDeploymentInfo(null);
+ buildDeploymentInfo(udi.parent, di.parent);
+ }
+
+ udi.vfRoot = new ResourceLoaderAdapter(di.localCl);
+ udi.name = di.getCanonicalName();
+ udi.simpleName = di.shortName;
+ udi.url = getDeploymentURL(di);
+ udi.classLoader = di.annotationsCl;
+ udi.deployedObject = di.deployedObject;
+
+ buildMetaData(udi, di.metaData);
+
+ return udi;
+ }
+
+ private static URL getDeploymentURL(DeploymentInfo di) throws MalformedURLException
+ {
+ URL deploymentURL = (di.localUrl != null ? di.localUrl : di.url);
+ if ("file".equals(deploymentURL.getProtocol()))
+ {
+ String path = deploymentURL.getPath();
+ if (new File(path).isFile())
+ {
+ deploymentURL = new URL("jar:file:" + path + "!/");
+ }
+ }
+ return deploymentURL;
+ }
+
+ private static void buildMetaData(UnifiedDeploymentInfo udi, Object metaData)
+ {
+ if (metaData instanceof WebMetaData)
+ {
+ udi.metaData =
WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
+ udi.webappURL = udi.url;
+ }
+ else if (metaData instanceof ApplicationMetaData)
+ {
+ udi.metaData =
ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData((ApplicationMetaData)metaData);
+ }
+ }
+}
Property changes on:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/DeploymentInfoAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java
===================================================================
---
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/integration-jboss40/src/main/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -39,7 +39,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.client.ServiceReferenceable;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.jboss42.DeploymentInfoAdaptor;
+import org.jboss.ws.integration.jboss40.DeploymentInfoAdaptor;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientDeployment;
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
Modified:
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java
===================================================================
---
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -117,6 +117,7 @@
upcmd.setPortComponentURI(pcmd.getPortComponentURI());
upcmd.setAuthMethod(pcmd.getAuthMethod());
upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
+ upcmd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
ubmd.setPortComponent(upcmd);
}
}
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
===================================================================
---
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -166,6 +166,7 @@
upcmd.setPortComponentURI(pcmd.getPortComponentURI());
upcmd.setAuthMethod(pcmd.getAuthMethod());
upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
+ upcmd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
ubmd.setPortComponent(upcmd);
}
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -172,6 +172,11 @@
String transportGuarantee = bpcMetaData.getTransportGuarantee();
sepMetaData.setTransportGuarantee(transportGuarantee);
}
+ if (bpcMetaData.getSecureWSDLAccess() != null)
+ {
+ Boolean secureWSDLAccess = bpcMetaData.getSecureWSDLAccess();
+ sepMetaData.setSecureWSDLAccess(secureWSDLAccess);
+ }
sepMetaData.setURLPattern(bpcMetaData.getURLPattern());
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -37,6 +37,7 @@
private String portComponentURI;
private String authMethod;
private String transportGuarantee;
+ private Boolean secureWSDLAccess;
public String getPortComponentName()
{
@@ -87,4 +88,14 @@
{
this.transportGuarantee = transportGuarantee;
}
+
+ public Boolean getSecureWSDLAccess()
+ {
+ return secureWSDLAccess;
+ }
+
+ public void setSecureWSDLAccess(Boolean secureWSDLAccess)
+ {
+ this.secureWSDLAccess = secureWSDLAccess;
+ }
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -26,6 +26,7 @@
import javax.management.ObjectName;
import javax.xml.namespace.QName;
+import org.jboss.logging.Logger;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
@@ -38,6 +39,8 @@
*/
public class ServerEndpointMetaData extends EndpointMetaData
{
+ protected static final Logger log = Logger.getLogger(ServerEndpointMetaData.class);
+
public static final String SEPID_DOMAIN = "jboss.ws";
public static final String SEPID_PROPERTY_CONTEXT = "context";
public static final String SEPID_PROPERTY_ENDPOINT = "endpoint";
@@ -59,7 +62,7 @@
// The optional transport guarantee
private String transportGuarantee;
// The optional secure wsdl access
- private boolean secureWSDLAccess = true;
+ private Boolean secureWSDLAccess;
// The bean that registers with the ServiceEndpointManager
private String managedEndpointBean =
"org.jboss.ws.core.server.ServiceEndpoint";
@@ -160,12 +163,19 @@
this.transportGuarantee = transportGuarantee;
}
- public boolean isSecureWSDLAccess()
+ public Boolean isSecureWSDLAccess()
{
+ // For backward compatiblity we leave wsdl access for jaxrpc endpoints unprotected
+ if (secureWSDLAccess == null)
+ {
+ secureWSDLAccess = (getType() == Type.JAXWS);
+ log.debug("Using default for secure wsdl access: " +
secureWSDLAccess);
+ }
+
return secureWSDLAccess;
}
- public void setSecureWSDLAccess(boolean secureWSDLAccess)
+ public void setSecureWSDLAccess(Boolean secureWSDLAccess)
{
this.secureWSDLAccess = secureWSDLAccess;
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -73,6 +73,8 @@
// The HTTP context root
private String contextRoot;
+ // The optional secure wsdl access
+ private Boolean secureWSDLAccess;
/** Construct a new PortComponentMetaData for a given WebserviceDescriptionMetaData
*/
@@ -161,11 +163,16 @@
this.contextRoot = contextRoot;
}
- /**
- * Serialize as a String
- *
- * @return
- */
+ public Boolean getSecureWSDLAccess()
+ {
+ return secureWSDLAccess;
+ }
+
+ public void setSecureWSDLAccess(Boolean secureWSDLAccess)
+ {
+ this.secureWSDLAccess = secureWSDLAccess;
+ }
+
public String serialize()
{
StringBuilder builder = new StringBuilder("<port-component>");
@@ -175,17 +182,9 @@
builder.append("<service-endpoint-interface>").append(serviceEndpointInterface).append("</service-endpoint-interface>");
builder.append("<service-impl-bean>");
if (ejbLink != null)
- {
- builder.append("<ejb-link>");
- builder.append(ejbLink);
- builder.append("</ejb-link>");
- }
+ builder.append("<ejb-link>" + ejbLink +
"</ejb-link>");
else
- {
- builder.append("<servlet-link>");
- builder.append(servletLink);
- builder.append("</servlet-link>");
- }
+ builder.append("<servlet-link>"+ servletLink +
"</servlet-link>");
builder.append("</service-impl-bean>");
builder.append("</port-component>");
return builder.toString();
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/secureejb/SecureEJBTestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/secureejb/SecureEJBTestCase.java 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/secureejb/SecureEJBTestCase.java 2007-03-03
11:53:17 UTC (rev 2510)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxrpc.samples.secureejb;
+import java.net.URL;
import java.rmi.RemoteException;
import javax.naming.InitialContext;
@@ -34,6 +35,9 @@
import org.jboss.security.SimplePrincipal;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLException;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
@@ -84,23 +88,19 @@
assertEquals("The 'mafia' boss is currently out of office, please call
again.", info);
}
- /** Test that the remote access to this bean is unchecked
- */
- public void testBasicSecuredSLSB() throws Exception
+ public void testRoleSecuredWSDLAccess() throws Exception
{
- InitialContext iniCtx = getInitialContext();
- OrganizationHome home =
(OrganizationHome)iniCtx.lookup("ejb/BasicSecuredSLSB");
-
- OrganizationRemote bean = home.create();
- String info = bean.getContactInfo("mafia");
- assertEquals("The 'mafia' boss is currently out of office, please call
again.", info);
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxrpc-samples-ejb/RoleSecured?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdl = factory.parse(wsdlURL);
+ assertNotNull("Expect unsecured wsdl access by default for jaxrpc",
wsdl);
}
-
- public void testBasicSecuredServiceAccess() throws Exception
+
+ public void testRoleSecuredServiceAccess() throws Exception
{
InitialContext iniCtx = getInitialContext();
- Service service =
(Service)iniCtx.lookup("java:comp/env/service/BasicSecured");
- QName portName = new QName("http://org.jboss.ws/samples/secureejb",
"BasicSecuredPort");
+ Service service =
(Service)iniCtx.lookup("java:comp/env/service/RoleSecured");
+ QName portName = new QName("http://org.jboss.ws/samples/secureejb",
"RoleSecuredPort");
OrganizationService port = (OrganizationService)service.getPort(portName,
OrganizationService.class);
try
@@ -121,11 +121,39 @@
assertEquals("The 'mafia' boss is currently out of office, please call
again.", info);
}
- public void testRoleSecuredServiceAccess() throws Exception
+ /** Test that the remote access to this bean is unchecked
+ */
+ public void testBasicSecuredSLSB() throws Exception
{
InitialContext iniCtx = getInitialContext();
- Service service =
(Service)iniCtx.lookup("java:comp/env/service/RoleSecured");
- QName portName = new QName("http://org.jboss.ws/samples/secureejb",
"RoleSecuredPort");
+ OrganizationHome home =
(OrganizationHome)iniCtx.lookup("ejb/BasicSecuredSLSB");
+
+ OrganizationRemote bean = home.create();
+ String info = bean.getContactInfo("mafia");
+ assertEquals("The 'mafia' boss is currently out of office, please call
again.", info);
+ }
+
+ public void testBasicSecuredWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxrpc-samples-ejb/BasicSecured?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ try
+ {
+ factory.parse(wsdlURL);
+ fail("Expect secured wsdl access");
+ }
+ catch (WSDLException ex)
+ {
+ String cause = ex.getCause().getMessage();
+ assertTrue("Server returned HTTP response code: 401",
cause.startsWith("Server returned HTTP response code: 401"));
+ }
+ }
+
+ public void testBasicSecuredServiceAccess() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service =
(Service)iniCtx.lookup("java:comp/env/service/BasicSecured");
+ QName portName = new QName("http://org.jboss.ws/samples/secureejb",
"BasicSecuredPort");
OrganizationService port = (OrganizationService)service.getPort(portName,
OrganizationService.class);
try
@@ -146,6 +174,14 @@
assertEquals("The 'mafia' boss is currently out of office, please call
again.", info);
}
+ public void testConfidentialSecuredWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxrpc-samples-ejb/ConfidentialSecured?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdl = factory.parse(wsdlURL);
+ assertNotNull("Expect unsecured wsdl access", wsdl);
+ }
+
public void testConfidentialServiceAccess() throws Exception
{
InitialContext iniCtx = getInitialContext();
Modified:
trunk/jbossws-tests/src/main/resources/jaxrpc/samples/secureejb/META-INF/jboss.xml
===================================================================
---
trunk/jbossws-tests/src/main/resources/jaxrpc/samples/secureejb/META-INF/jboss.xml 2007-03-02
14:41:35 UTC (rev 2509)
+++
trunk/jbossws-tests/src/main/resources/jaxrpc/samples/secureejb/META-INF/jboss.xml 2007-03-03
11:53:17 UTC (rev 2510)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
+<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss_4_2.dtd">
<jboss>
@@ -15,6 +15,7 @@
<port-component-uri>/jaxrpc-samples-ejb/RoleSecured</port-component-uri>
<auth-method>BASIC</auth-method>
<transport-guarantee>NONE</transport-guarantee>
+ <!-- default secure-wsdl-access (false for jaxrpc) -->
</port-component>
</session>
<session>
@@ -25,6 +26,7 @@
<port-component-uri>/jaxrpc-samples-ejb/BasicSecured</port-component-uri>
<auth-method>BASIC</auth-method>
<transport-guarantee>NONE</transport-guarantee>
+ <secure-wsdl-access>true</secure-wsdl-access>
</port-component>
</session>
<session>
@@ -34,6 +36,7 @@
<port-component-name>ConfidentialSecured</port-component-name>
<port-component-uri>/jaxrpc-samples-ejb/ConfidentialSecured</port-component-uri>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ <secure-wsdl-access>false</secure-wsdl-access>
</port-component>
</session>
</enterprise-beans>