JBossWS SVN: r3105 - in branches/tdiesler/trunk: integration/jboss50 and 19 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-16 08:10:39 -0400 (Wed, 16 May 2007)
New Revision: 3105
Added:
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB21.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB3.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerJSE.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/BasicInvocationContext.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/HandlerCallback.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/WebServiceContextInjector.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java
Removed:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointInterceptor.java
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/
branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerCallback.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java
Modified:
branches/tdiesler/trunk/build/build.xml
branches/tdiesler/trunk/build/version.properties
branches/tdiesler/trunk/integration/jboss50/.classpath
branches/tdiesler/trunk/integration/jboss50/ant-import/build-thirdparty.xml
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ModifyWebMetaDataDeployer.java
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml
branches/tdiesler/trunk/integration/spi/.classpath
branches/tdiesler/trunk/integration/spi/ant-import/build-thirdparty.xml
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicEndpoint.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/Endpoint.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
branches/tdiesler/trunk/jbossws/ant-import/build-thirdparty.xml
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/EndpointNameDeployer.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/EventingDeployer.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataAssociationDeployer.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactoryJAXRPC.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ContextServlet.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/LifecycleHandlerImpl.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ManagedEndpointRegistry.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/PortComponentLinkServlet.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointServlet.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServletRequestContext.java
branches/tdiesler/trunk/jbossws/version.properties
branches/tdiesler/trunk/testsuite/ant-import/build-testsuite.xml
branches/tdiesler/trunk/testsuite/build.xml
Log:
restructure
Modified: branches/tdiesler/trunk/build/build.xml
===================================================================
--- branches/tdiesler/trunk/build/build.xml 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/build/build.xml 2007-05-16 12:10:39 UTC (rev 3105)
@@ -42,7 +42,7 @@
<ant antfile="${testsuite.dir}/build.xml" target="clean" inheritall="false"/>
<ant antfile="${int.jboss50.dir}/build.xml" target="clean" inheritall="false"/>
<ant antfile="${int.jboss42.dir}/build.xml" target="clean" inheritall="false"/>
- <ant antfile="${int.sunri.dir}/build.xml" target="clean" inheritall="false"/>
+ <ant antfile="${int.sunri50.dir}/build.xml" target="clean" inheritall="false"/>
</target>
<target name="clobber" depends="prepare" description="Cleans up all generated files.">
@@ -51,7 +51,7 @@
<ant antfile="${testsuite.dir}/build.xml" target="clobber" inheritall="false"/>
<ant antfile="${int.jboss50.dir}/build.xml" target="clobber" inheritall="false"/>
<ant antfile="${int.jboss42.dir}/build.xml" target="clobber" inheritall="false"/>
- <ant antfile="${int.sunri.dir}/build.xml" target="clobber" inheritall="false"/>
+ <ant antfile="${int.sunri50.dir}/build.xml" target="clobber" inheritall="false"/>
</target>
<target name="main" description="Executes the default target (most)." depends="jars">
@@ -67,7 +67,7 @@
<ant antfile="${testsuite.dir}/build.xml" target="most" inheritall="false"/>
<ant antfile="${int.jboss50.dir}/build.xml" target="most" inheritall="false"/>
<ant antfile="${int.jboss42.dir}/build.xml" target="most" inheritall="false"/>
- <ant antfile="${int.sunri.dir}/build.xml" target="most" inheritall="false"/>
+ <ant antfile="${int.sunri50.dir}/build.xml" target="most" inheritall="false"/>
</target>
<target name="all" description="Create a distribution zip file" depends="most,build-bin-dist,build-src-dist">
Modified: branches/tdiesler/trunk/build/version.properties
===================================================================
--- branches/tdiesler/trunk/build/version.properties 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/build/version.properties 2007-05-16 12:10:39 UTC (rev 3105)
@@ -22,5 +22,6 @@
jboss-microcontainer=2.0.0.Beta3
junit=3.8.1
sun-jaf=1.1
+sun-jaxrpc=1.1
sun-jaxws=2.1.1
sun-servlet=2.5
Modified: branches/tdiesler/trunk/integration/jboss50/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/.classpath 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/jboss50/.classpath 2007-05-16 12:10:39 UTC (rev 3105)
@@ -6,5 +6,6 @@
<classpathentry kind="lib" path="/spi/thirdparty/jaxws-api.jar"/>
<classpathentry kind="lib" path="/spi/thirdparty/jsr181-api.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
+ <classpathentry kind="lib" path="/spi/thirdparty/jaxrpc-api.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/integration/jboss50/ant-import/build-thirdparty.xml
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/ant-import/build-thirdparty.xml 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/jboss50/ant-import/build-thirdparty.xml 2007-05-16 12:10:39 UTC (rev 3105)
@@ -34,15 +34,20 @@
<path id="jbws50.integration.classpath">
<pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
<pathelement location="${spi.dir}/thirdparty/jaxws-api.jar"/>
+ <pathelement location="${spi.dir}/thirdparty/jaxrpc-api.jar"/>
<pathelement location="${spi.dir}/thirdparty/jsr181-api.jar"/>
<pathelement location="${jboss50.lib}/jboss-aop-jdk50.jar"/>
<pathelement location="${jboss50.lib}/jboss-common-core.jar"/>
<pathelement location="${jboss50.lib}/jboss-deployers.jar"/>
<pathelement location="${jboss50.lib}/jboss-logging-spi.jar"/>
+ <pathelement location="${jboss50.lib}/jboss-j2se.jar"/>
+ <pathelement location="${jboss50.lib}/jboss-system.jar"/>
+ <pathelement location="${jboss50.lib}/jboss-system-jmx.jar"/>
<pathelement location="${jboss50.lib}/jboss-vfs.jar"/>
<pathelement location="${jboss50.lib}/jboss-xml-binding.jar"/>
<pathelement location="${jboss50.server.lib}/jboss.jar"/>
<pathelement location="${jboss50.server.lib}/jboss-javaee.jar"/>
+ <pathelement location="${jboss50.server.lib}/jbosssx.jar"/>
<pathelement location="${jboss50.server.deployers}/ejb3.deployer/jboss-ejb3.jar"/>
</path>
Added: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB21.java (rev 0)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB21.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,169 @@
+/*
+ * 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 java.lang.reflect.Method;
+import java.security.Principal;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.ejb.EjbModule;
+import org.jboss.ejb.Interceptor;
+import org.jboss.ejb.StatelessSessionContainer;
+import org.jboss.ejb.plugins.AbstractInterceptor;
+import org.jboss.invocation.Invocation;
+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.integration.Endpoint;
+import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.invocation.HandlerCallback;
+import org.jboss.ws.integration.invocation.InvocationContext;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * Handles invocations on EJB3 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class InvocationHandlerEJB21 implements InvocationHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(InvocationHandlerEJB21.class);
+
+ private String jndiName;
+ private MBeanServer server;
+ private ObjectName objectName;
+
+ public void create(Endpoint endpoint)
+ {
+ server = MBeanServerLocator.locateJBoss();
+
+ String ejbName = endpoint.getName().getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
+ if (ejbName == null)
+ throw new WebServiceException("Cannot obtain ejb-link from port component");
+
+ UnifiedDeploymentInfo udi = endpoint.getService().getDeployment().getContext().getAttachment(UnifiedDeploymentInfo.class);
+ UnifiedApplicationMetaData applMetaData = (UnifiedApplicationMetaData)udi.metaData;
+ UnifiedBeanMetaData beanMetaData = (UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
+ if (beanMetaData == null)
+ throw new WebServiceException("Cannot obtain ejb meta data for: " + ejbName);
+
+ // get the bean's JNDI name
+ jndiName = beanMetaData.getContainerObjectNameJndiName();
+ if (jndiName == null)
+ throw new WebServiceException("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());
+ AbstractInterceptor sepInterceptor = endpoint.getAttachment(AbstractInterceptor.class);
+ if (sepInterceptor == null)
+ throw new IllegalStateException("Cannot obtain endpoint interceptor");
+
+ 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);
+ }
+
+ if (server.isRegistered(objectName) == false)
+ throw new WebServiceException("Cannot find service endpoint target: " + objectName);
+
+ }
+
+ public void start(Endpoint ep)
+ {
+ }
+
+ public Object getTargetBean(Endpoint ep) throws InstantiationException, IllegalAccessException
+ {
+ return null;
+ }
+
+ public Object invoke(Endpoint ep, Object targetBean, Method method, Object[] args, InvocationContext context) throws Exception
+ {
+ // these are provided by the ServerLoginHandler
+ Principal principal = SecurityAssociation.getPrincipal();
+ Object credential = SecurityAssociation.getCredential();
+
+ 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);
+
+ HandlerCallback callback = ep.getAttachment(HandlerCallback.class);
+ if (callback == null)
+ throw new IllegalStateException("Cannot obtain handler callback");
+
+ inv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT);
+ inv.setValue(InvocationContext.class.getName(), context, PayloadKey.TRANSIENT);
+
+ String[] sig = { Invocation.class.getName() };
+ Object retObj = server.invoke(objectName, "invoke", new Object[] { inv }, sig);
+
+ return retObj;
+ }
+
+ public void stop(Endpoint ep)
+ {
+ // Nothing to do
+ }
+
+ public void destroy(Endpoint ep)
+ {
+ // Nothing to do
+ }
+}
Property changes on: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB3.java (rev 0)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB3.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,158 @@
+/*
+ * 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 java.lang.reflect.Method;
+
+import javax.ejb.EJBContext;
+import javax.management.ObjectName;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.aop.Dispatcher;
+import org.jboss.aop.MethodInfo;
+import org.jboss.ejb3.BeanContext;
+import org.jboss.ejb3.BeanContextLifecycleCallback;
+import org.jboss.ejb3.EJBContainerInvocation;
+import org.jboss.ejb3.stateless.StatelessBeanContext;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.injection.lang.reflect.BeanProperty;
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.invocation.InvocationContext;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+import org.jboss.ws.utils.ObjectNameFactory;
+
+/**
+ * Handles invocations on EJB3 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class InvocationHandlerEJB3 implements InvocationHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(InvocationHandlerEJB3.class);
+
+ private ObjectName objectName;
+
+ public void create(Endpoint endpoint)
+ {
+ String ejbName = endpoint.getName().getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
+ if (ejbName == null)
+ throw new WebServiceException("Cannot obtain ejb-link");
+
+ UnifiedDeploymentInfo udi = endpoint.getService().getDeployment().getContext().getAttachment(UnifiedDeploymentInfo.class);
+ String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + udi.simpleName;
+ if (udi.parent != null)
+ {
+ nameStr += ",ear=" + udi.parent.simpleName;
+ }
+
+ objectName = ObjectNameFactory.create(nameStr.toString());
+ }
+
+ public void start(Endpoint ep)
+ {
+ Dispatcher dispatcher = Dispatcher.singleton;
+ if (dispatcher.getRegistered(objectName.getCanonicalName()) == null)
+ throw new WebServiceException("Cannot find service endpoint target: " + objectName);
+ }
+
+ public Object getTargetBean(Endpoint ep) throws InstantiationException, IllegalAccessException
+ {
+ return null;
+ }
+
+ public Object invoke(Endpoint ep, Object targetBean, Method method, Object[] args, InvocationContext context) throws Exception
+ {
+ Dispatcher dispatcher = Dispatcher.singleton;
+ StatelessContainer container = (StatelessContainer)dispatcher.getRegistered(objectName.getCanonicalName());
+
+ MethodInfo info = container.getMethodInfo(method);
+
+ EJBContainerInvocation<StatelessContainer, StatelessBeanContext> ejb3Inv = new EJBContainerInvocation<StatelessContainer, StatelessBeanContext>(info);
+ ejb3Inv.setAdvisor(container);
+ ejb3Inv.setArguments(args);
+ ejb3Inv.setContextCallback(new ContextCallback(context));
+
+ Object retObj;
+ try
+ {
+ retObj = ejb3Inv.invokeNext();
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ catch (Throwable ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ return retObj;
+ }
+
+ public void stop(Endpoint ep)
+ {
+ // Nothing to do
+ }
+
+ public void destroy(Endpoint ep)
+ {
+ // Nothing to do
+ }
+
+ class ContextCallback implements BeanContextLifecycleCallback
+ {
+ private WebServiceContext wsContext;
+
+ public ContextCallback(InvocationContext context)
+ {
+ if (context instanceof WebServiceContext)
+ this.wsContext = (WebServiceContext)context;
+ }
+
+ public void attached(BeanContext beanCtx)
+ {
+ StatelessBeanContext sbc = (StatelessBeanContext)beanCtx;
+
+ BeanProperty beanProp = sbc.getWebServiceContextProperty();
+ if (beanProp != null && wsContext instanceof WebServiceContext)
+ {
+ EJBContext ejbCtx = beanCtx.getEJBContext();
+ beanProp.set(beanCtx.getInstance(), wsContext);
+ }
+ }
+
+ public void released(BeanContext beanCtx)
+ {
+ StatelessBeanContext sbc = (StatelessBeanContext)beanCtx;
+
+ BeanProperty beanProp = sbc.getWebServiceContextProperty();
+ if (beanProp != null)
+ beanProp.set(beanCtx.getInstance(), null);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerJSE.java (rev 0)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerJSE.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,78 @@
+/*
+ * 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 java.lang.reflect.Method;
+
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.invocation.InvocationContext;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+import org.jboss.ws.integration.invocation.WebServiceContextInjector;
+
+/**
+ * Handles invocations on JSE endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class InvocationHandlerJSE implements InvocationHandler
+{
+ public void create(Endpoint ep)
+ {
+ // Nothing to do
+ }
+
+ public void start(Endpoint endpoint)
+ {
+ // Nothing to do
+ }
+
+ public void stop(Endpoint endpoint)
+ {
+ // Nothing to do
+ }
+
+ public void destroy(Endpoint ep)
+ {
+ // Nothing to do
+ }
+
+ public Object getTargetBean(Endpoint endpoint) throws InstantiationException, IllegalAccessException
+ {
+ Class epImpl = endpoint.getEndpointImpl();
+ Object targetBean = epImpl.newInstance();
+ return targetBean;
+ }
+
+ public Object invoke(Endpoint endpoint, Object targetBean, Method method, Object[] args, InvocationContext context) throws Exception
+ {
+ if (context instanceof WebServiceContext)
+ new WebServiceContextInjector().injectContext(targetBean, (WebServiceContext)context);
+
+ Object retObj = method.invoke(targetBean, args);
+ return retObj;
+ }
+}
Property changes on: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/InvocationHandlerJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java (rev 0)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,103 @@
+/*
+ * 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.xml.rpc.handler.MessageContext;
+
+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.integration.invocation.HandlerCallback;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData.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
+ MessageContext msgContext = (MessageContext)mi.getPayloadValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
+ if (msgContext == null)
+ {
+ return getNext().invoke(mi);
+ }
+
+ // Get the handler callback
+ HandlerCallback callback = (HandlerCallback)mi.getValue(HandlerCallback.class.getName());
+
+ // Handlers need to be Tx. Therefore we must invoke the handler chain after the TransactionInterceptor.
+ if (callback != null)
+ {
+ try
+ {
+ // call the request handlers
+ boolean handlersPass = callback.callRequestHandlerChain(HandlerType.ENDPOINT);
+ handlersPass = handlersPass && callback.callRequestHandlerChain(HandlerType.POST);
+
+ Object resObj = getNext().invoke(mi);
+
+ // call the response handlers
+ handlersPass = callback.callResponseHandlerChain(HandlerType.POST);
+ handlersPass = handlersPass && callback.callResponseHandlerChain(HandlerType.ENDPOINT);
+
+ return resObj;
+ }
+ catch (Exception ex)
+ {
+ try
+ {
+ // call the fault handlers
+ boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST, ex);
+ handlersPass = handlersPass && callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
+ }
+ catch (Exception subEx)
+ {
+ log.warn("Cannot process handlerChain.handleFault, ignoring: ", subEx);
+ }
+ throw ex;
+ }
+ }
+ else
+ {
+ log.warn("Handler callback not available");
+ return getNext().invoke(mi);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -1,267 +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.jboss42.jbossws;
-
-// $Id$
-
-import java.lang.reflect.Method;
-import java.security.Principal;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-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.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.handler.HandlerCallback;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.server.AbstractInvocationHandler;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.invocation.InvocationContext;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * Handles invocations on EJB21 endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class InvocationHandlerEJB21 extends AbstractInvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(InvocationHandlerEJB21.class);
-
- private String jndiName;
- private MBeanServer server;
- private ObjectName objectName;
-
- /** Initialize the service endpoint */
- @Override
- public void create(Endpoint endpoint)
- {
- super.create(endpoint);
-
- server = MBeanServerLocator.locateJBoss();
-
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
- if (sepMetaData == null)
- throw new IllegalStateException("Cannot obtain endpoint meta data");
-
- String ejbName = sepMetaData.getLinkName();
- if (ejbName == null)
- throw new WSException("Cannot obtain ejb-link from port component");
-
- UnifiedDeploymentInfo udi = endpoint.getService().getDeployment().getContext().getAttachment(UnifiedDeploymentInfo.class);
- UnifiedApplicationMetaData applMetaData = (UnifiedApplicationMetaData)udi.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 = sepMetaData.getServiceEndpointInterfaceName();
- if (sepMetaData.getType() == Type.JAXRPC && seiName != null)
- {
- String bmdSEI = beanMetaData.getServiceEndpointInterface();
- 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()
- {
- 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 */
- @Override
- protected Object createServiceEndpointInstance(Class seiImplClass, InvocationContext context) throws Exception
- {
- return null;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv) throws Exception
- {
- 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);
-
- // EJB2.1 endpoints will only get an JAXRPC context
- if ((msgContext instanceof javax.xml.rpc.handler.MessageContext) == false)
- msgContext = new SOAPMessageContextJAXRPC(msgContext);
-
- 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
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
- inv.setValue(HandlerCallback.class.getName(), new HandlerCallbackImpl(sepMetaData), 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 destroyServiceEndpointInstance(Object seiImpl)
- {
- // do nothing
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- @Override
- public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
- {
- if (type == HandlerType.PRE)
- return delegate.callRequestHandlerChain(sepMetaData, type);
- else return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
- {
- if (type == HandlerType.PRE)
- return delegate.callResponseHandlerChain(sepMetaData, type);
- else return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type, Exception ex)
- {
- if (type == HandlerType.PRE)
- return delegate.callFaultHandlerChain(sepMetaData, type, ex);
- else return true;
- }
-
- // The ServiceEndpointInterceptor calls the methods in this callback
- public class HandlerCallbackImpl implements HandlerCallback
- {
- private ServerEndpointMetaData sepMetaData;
-
- public HandlerCallbackImpl(ServerEndpointMetaData sepMetaData)
- {
- this.sepMetaData = sepMetaData;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- public boolean callRequestHandlerChain(HandlerType type)
- {
- if (type == HandlerType.PRE)
- return true;
- else return delegate.callRequestHandlerChain(sepMetaData, type);
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- public boolean callResponseHandlerChain(HandlerType type)
- {
- if (type == HandlerType.PRE)
- return true;
- else return delegate.callResponseHandlerChain(sepMetaData, type);
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- public boolean callFaultHandlerChain(HandlerType type, Exception ex)
- {
- if (type == HandlerType.PRE)
- return true;
- else return delegate.callFaultHandlerChain(sepMetaData, type, ex);
- }
- }
-}
Deleted: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -1,192 +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.jboss42.jbossws;
-
-// $Id$
-
-import java.lang.reflect.Method;
-
-import javax.ejb.EJBContext;
-import javax.management.ObjectName;
-
-import org.jboss.aop.Dispatcher;
-import org.jboss.aop.MethodInfo;
-import org.jboss.ejb3.BeanContext;
-import org.jboss.ejb3.BeanContextLifecycleCallback;
-import org.jboss.ejb3.EJBContainerInvocation;
-import org.jboss.ejb3.stateless.StatelessBeanContext;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.injection.lang.reflect.BeanProperty;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.jaxws.WebServiceContextEJB;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.server.AbstractInvocationHandler;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.invocation.InvocationContext;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * Handles invocations on EJB3 endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class InvocationHandlerEJB3 extends AbstractInvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(InvocationHandlerEJB3.class);
-
- private ObjectName objectName;
-
- /** Initialize the service endpoint */
- @Override
- public void create(Endpoint endpoint)
- {
- super.create(endpoint);
-
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
- if (sepMetaData == null)
- throw new IllegalStateException("Cannot obtain endpoint meta data");
-
- String ejbName = sepMetaData.getLinkName();
- if (ejbName == null)
- throw new WSException("Cannot obtain ejb-link from port component");
-
- UnifiedDeploymentInfo udi = endpoint.getService().getDeployment().getContext().getAttachment(UnifiedDeploymentInfo.class);
- String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + udi.simpleName;
- if (udi.parent != null)
- {
- nameStr += ",ear=" + udi.parent.simpleName;
- }
-
- objectName = ObjectNameFactory.create(nameStr.toString());
- }
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint()
- {
- Dispatcher dispatcher = Dispatcher.singleton;
- if (dispatcher.getRegistered(objectName.getCanonicalName()) == null)
- throw new WSException("Cannot find service endpoint target: " + objectName);
-
- return null;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- @Override
- protected Object createServiceEndpointInstance(Class seiImplClass, InvocationContext context) throws Exception
- {
- return null;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv) throws Exception
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
-
- // invoke on the container
- try
- {
- // setup the invocation
- Method seiMethod = epInv.getJavaMethod();
- Object[] args = epInv.getRequestPayload();
-
- Dispatcher dispatcher = Dispatcher.singleton;
- StatelessContainer container = (StatelessContainer)dispatcher.getRegistered(objectName.getCanonicalName());
- Class beanClass = container.getBeanClass();
-
- Method implMethod = getImplMethod(beanClass, seiMethod);
- MethodInfo info = container.getMethodInfo(implMethod);
-
- EJBContainerInvocation<StatelessContainer, StatelessBeanContext> ejb3Inv = new EJBContainerInvocation<StatelessContainer, StatelessBeanContext>(info);
- ejb3Inv.setAdvisor(container);
- ejb3Inv.setArguments(args);
- ejb3Inv.setContextCallback(new ContextCallback());
-
- Object retObj = ejb3Inv.invokeNext();
-
- epInv.setReturnValue(retObj);
- }
- catch (Throwable th)
- {
- handleInvocationException(th);
- }
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(Object seiImpl)
- {
- // do nothing
- }
-
- class ContextCallback implements BeanContextLifecycleCallback
- {
- private SOAPMessageContextJAXWS jaxwsMessageContext;
- private SOAPMessageContextJAXRPC jaxrpcMessageContext;
-
- public ContextCallback()
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof SOAPMessageContextJAXRPC)
- {
- jaxrpcMessageContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxwsMessageContext = new SOAPMessageContextJAXWS(msgContext);
- }
- else if (msgContext instanceof SOAPMessageContextJAXWS)
- {
- jaxwsMessageContext = (SOAPMessageContextJAXWS)msgContext;
- jaxrpcMessageContext = new SOAPMessageContextJAXRPC(msgContext);
- }
- }
-
- public void attached(BeanContext beanCtx)
- {
- StatelessBeanContext sbc = (StatelessBeanContext)beanCtx;
- sbc.setMessageContextJAXRPC(jaxrpcMessageContext);
-
- BeanProperty beanProp = sbc.getWebServiceContextProperty();
- if (beanProp != null)
- {
- EJBContext ejbCtx = beanCtx.getEJBContext();
- beanProp.set(beanCtx.getInstance(), new WebServiceContextEJB(jaxwsMessageContext, ejbCtx));
- }
- }
-
- public void released(BeanContext beanCtx)
- {
- StatelessBeanContext sbc = (StatelessBeanContext)beanCtx;
- sbc.setMessageContextJAXRPC(null);
-
- BeanProperty beanProp = sbc.getWebServiceContextProperty();
- if (beanProp != null)
- beanProp.set(beanCtx.getInstance(), null);
- }
- }
-}
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ModifyWebMetaDataDeployer.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ModifyWebMetaDataDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ModifyWebMetaDataDeployer.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -71,7 +71,7 @@
Class<?> epBean = loader.loadClass(beanName);
ep.setEndpointImpl(epBean);
- ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
sepMetaData.setServiceEndpointImplName(beanName);
}
catch (ClassNotFoundException ex)
Deleted: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointInterceptor.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointInterceptor.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointInterceptor.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -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.jboss42.jbossws;
-
-// $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.core.CommonBinding;
-import org.jboss.ws.core.CommonBindingProvider;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
-import org.jboss.ws.core.jaxrpc.handler.HandlerCallback;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * 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
- HandlerCallback callback = (HandlerCallback)mi.getValue(HandlerCallback.class.getName());
-
- // 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)
- {
- CommonBindingProvider bindingProvider = new CommonBindingProvider(opMetaData.getEndpointMetaData());
- CommonBinding binding = bindingProvider.getCommonBinding();
-
- // Verify that the the message has not been mofified
- CommonMessageContext messageContext = MessageContextAssociation.peekMessageContext();
- if (messageContext.isModified())
- {
- log.debug("Handler modified payload, unbind message and update invocation args");
- epInv = bindingProvider.getCommonBinding().unbindRequestMessage(opMetaData, messageContext.getMessageAbstraction());
- }
-
- // 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
- 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)
- {
- try
- {
- SOAPMessage faultMessage = SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
- msgContext.setSOAPMessage(faultMessage);
-
- // call the fault handlers
- boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST, ex);
- handlersPass = handlersPass && callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
- }
- catch (Exception subEx)
- {
- log.warn("Cannot process handlerChain.handleFault, ignoring: ", subEx);
- }
- throw ex;
- }
- }
- else
- {
- log.warn("Handler callback not available");
- return getNext().invoke(mi);
- }
- }
-}
Modified: branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-05-16 12:10:39 UTC (rev 3105)
@@ -135,10 +135,10 @@
<property name="lifecycleHandler">org.jboss.ws.core.server.LifecycleHandlerImpl</property>
<property name="invocationHandler">
<map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>JAXRPC_JSE</key><value>org.jboss.ws.core.server.InvocationHandlerJSE</value></entry>
- <entry><key>JAXRPC_EJB21</key><value>org.jboss.ws.integration.jboss50.jbossws.InvocationHandlerEJB21</value></entry>
- <entry><key>JAXWS_JSE</key><value>org.jboss.ws.core.server.InvocationHandlerJSE</value></entry>
- <entry><key>JAXWS_EJB3</key><value>org.jboss.ws.integration.jboss50.jbossws.InvocationHandlerEJB3</value></entry>
+ <entry><key>JAXRPC_JSE</key><value>org.jboss.ws.integration.jboss50.InvocationHandlerJSE</value></entry>
+ <entry><key>JAXRPC_EJB21</key><value>org.jboss.ws.integration.jboss50.InvocationHandlerEJB21</value></entry>
+ <entry><key>JAXWS_JSE</key><value>org.jboss.ws.integration.jboss50.InvocationHandlerJSE</value></entry>
+ <entry><key>JAXWS_EJB3</key><value>org.jboss.ws.integration.jboss50.InvocationHandlerEJB3</value></entry>
</map>
</property>
</bean>
Modified: branches/tdiesler/trunk/integration/spi/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/spi/.classpath 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/spi/.classpath 2007-05-16 12:10:39 UTC (rev 3105)
@@ -16,5 +16,7 @@
<classpathentry kind="lib" path="thirdparty/servlet-api.jar"/>
<classpathentry kind="lib" path="thirdparty/junit.jar"/>
<classpathentry kind="lib" path="thirdparty/activation.jar"/>
+ <classpathentry kind="lib" path="thirdparty/jboss-javaee.jar"/>
+ <classpathentry kind="lib" path="thirdparty/jaxrpc-api.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/integration/spi/ant-import/build-thirdparty.xml
===================================================================
--- branches/tdiesler/trunk/integration/spi/ant-import/build-thirdparty.xml 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/spi/ant-import/build-thirdparty.xml 2007-05-16 12:10:39 UTC (rev 3105)
@@ -55,6 +55,7 @@
<get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar" dest="${thirdparty.dir}/activation.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-api.jar" dest="${thirdparty.dir}/jaxws-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jsr181-api.jar" dest="${thirdparty.dir}/jsr181-api.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxrpc/${sun-jaxrpc}/lib/jaxrpc-api.jar" dest="${thirdparty.dir}/jaxrpc-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-servlet/${sun-servlet}/lib/servlet-api.jar" dest="${thirdparty.dir}/servlet-api.jar" usetimestamp="true" verbose="true"/>
<checksum file="${build.dir}/version.properties" fileext=".md5"/>
@@ -72,6 +73,7 @@
<pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
<pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
<pathelement location="${thirdparty.dir}/jaxws-api.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxrpc-api.jar"/>
<pathelement location="${thirdparty.dir}/jsr181-api.jar"/>
<pathelement location="${thirdparty.dir}/servlet-api.jar"/>
</path>
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicEndpoint.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicEndpoint.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicEndpoint.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -154,17 +154,17 @@
this.invocationHandler = handler;
}
- public <T> T addMetaData(Class<T> key, Object value)
+ public <T> T addAttachment(Class<T> key, Object value)
{
return (T)metaData.put(key, value);
}
- public <T> T getMetaData(Class<T> key)
+ public <T> T getAttachment(Class<T> key)
{
return (T)metaData.get(key);
}
- public <T> T removeMetaData(Class<T> key)
+ public <T> T removeAttachment(Class<T> key)
{
return (T)metaData.get(key);
}
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/Endpoint.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/Endpoint.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/Endpoint.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -120,12 +120,12 @@
/** Set the endpoint bean invoker */
void setInvocationHandler(InvocationHandler invoker);
- /** Add arbitrary meta data */
- <T> T addMetaData(Class<T> key, Object value);
+ /** Add arbitrary attachments */
+ <T> T addAttachment(Class<T> key, Object value);
- /** Get arbitrary meta data */
- <T> T getMetaData(Class<T> key);
+ /** Get arbitrary attachments */
+ <T> T getAttachment(Class<T> key);
- /** Remove arbitrary meta data */
- <T> T removeMetaData(Class<T> key);
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> key);
}
Added: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/BasicInvocationContext.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/BasicInvocationContext.java (rev 0)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/BasicInvocationContext.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,85 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+package org.jboss.ws.integration.invocation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A basic invocation context.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class BasicInvocationContext implements InvocationContext
+{
+ private Map<Class, Object> attachments = new HashMap<Class, Object>();
+
+ public <T> T addAttachment(Class<T> key, Object value)
+ {
+ return (T)attachments.put(key, value);
+ }
+
+ public <T> T getAttachment(Class<T> key)
+ {
+ return (T)attachments.get(key);
+ }
+
+ public <T> T removeAttachment(Class<T> key)
+ {
+ return (T)attachments.get(key);
+ }
+}
Property changes on: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/BasicInvocationContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/HandlerCallback.java (from rev 3095, branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerCallback.java)
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/HandlerCallback.java (rev 0)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/HandlerCallback.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,44 @@
+/*
+* 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.invocation;
+
+// $Id$
+
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
+
+/**
+ * A handler callback for the EJB21 Invoker
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 26-Apr-2007
+ */
+public interface HandlerCallback
+{
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ boolean callRequestHandlerChain(HandlerType type);
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ boolean callResponseHandlerChain(HandlerType type);
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ boolean callFaultHandlerChain(HandlerType type, Exception ex);
+}
\ No newline at end of file
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -55,8 +55,6 @@
*/
package org.jboss.ws.integration.invocation;
-import javax.xml.ws.handler.MessageContext;
-
//$Id$
/**
@@ -67,6 +65,12 @@
*/
public interface InvocationContext
{
- /** Get the message context */
- MessageContext getMessageContext();
+ /** Add arbitrary attachments */
+ <T> T addAttachment(Class<T> key, Object value);
+
+ /** Get arbitrary attachments */
+ <T> T getAttachment(Class<T> key);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> key);
}
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -59,6 +59,8 @@
import java.lang.reflect.Method;
+import javax.xml.ws.WebServiceContext;
+
import org.jboss.ws.integration.Endpoint;
/**
@@ -69,21 +71,21 @@
*/
public interface InvocationHandler
{
- /** Initialize the invocation handler */
+ /** Create the invocation handler */
void create(Endpoint ep);
- /** Initialize the invocation handler */
+ /** Start the invocation handler */
void start(Endpoint ep);
/** Get an instance of the target bean */
Object getTargetBean(Endpoint ep) throws InstantiationException, IllegalAccessException;
/** Invoke the the service ep */
- Object invoke(Endpoint ep, Object targetBean, Method method, Object[] args, InvocationContext invContext) throws Exception;
+ Object invoke(Endpoint ep, Object targetBean, Method method, Object[] args, InvocationContext context) throws Exception;
- /** Initialize the invocation handler */
+ /** Stop the invocation handler */
void stop(Endpoint ep);
- /** Initialize the invocation handler */
+ /** Destroy the invocation handler */
void destroy(Endpoint ep);
}
Copied: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/WebServiceContextInjector.java (from rev 3095, branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java)
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/WebServiceContextInjector.java (rev 0)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/WebServiceContextInjector.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,82 @@
+/*
+ * 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.invocation;
+
+// $Id$
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Inject the JAXWS WebServiceContext
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Jan-2007
+ */
+public class WebServiceContextInjector
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(WebServiceContextInjector.class);
+
+ public void injectContext(Object epInstance, WebServiceContext wsContext)
+ {
+ try
+ {
+ // scan fields that are marked with @Resource
+ Field[] fields = epInstance.getClass().getDeclaredFields();
+ for (Field field : fields)
+ {
+ Class type = field.getType();
+ if (type == WebServiceContext.class && field.isAnnotationPresent(Resource.class))
+ {
+ field.setAccessible(true);
+ field.set(epInstance, wsContext);
+ }
+ }
+
+ // scan methods that are marked with @Resource
+ Method[] methods = epInstance.getClass().getDeclaredMethods();
+ for (Method method : methods)
+ {
+ Class[] paramTypes = method.getParameterTypes();
+ if (paramTypes.length == 1 && paramTypes[0] == WebServiceContext.class && method.isAnnotationPresent(Resource.class))
+ {
+ method.setAccessible(true);
+ method.invoke(epInstance, new Object[] { wsContext });
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.warn("Cannot inject WebServiceContext", ex);
+ }
+ }
+}
Deleted: branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -1,76 +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.jboss50.sunri;
-
-// $Id$
-
-import java.lang.reflect.Method;
-
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.invocation.InvocationHandler;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class InvocationHandlerJSE implements InvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(InvocationHandlerJSE.class);
-
- private Endpoint endpoint;
-
- /** Initialize the service endpoint */
- public void create(Endpoint endpoint)
- {
- this.endpoint = endpoint;
- }
-
- public void start(Endpoint endpoint)
- {
- }
-
- public Object getTargetBean(Endpoint endpoint)
- {
- throw new NotImplementedException();
- }
-
- /** Invoke the the service endpoint */
- public Object invoke(Endpoint endpoint, Object targetBean, Method method, Object[] args, MessageContext msgContext) throws Exception
- {
- throw new NotImplementedException();
- }
-
- public void stop(Endpoint endpoint)
- {
- }
-
- public void destroy(Endpoint endpoint)
- {
- }
-}
Modified: branches/tdiesler/trunk/jbossws/ant-import/build-thirdparty.xml
===================================================================
--- branches/tdiesler/trunk/jbossws/ant-import/build-thirdparty.xml 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/ant-import/build-thirdparty.xml 2007-05-16 12:10:39 UTC (rev 3105)
@@ -85,6 +85,7 @@
<get src="${jboss.repository}/oswego-concurrent/${oswego-concurrent}/lib/concurrent.jar" dest="${thirdparty.dir}/concurrent.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/qdox/${qdox}/lib/qdox.jar" dest="${thirdparty.dir}/qdox.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/stax-api/${stax-api}/lib/stax-api.jar" dest="${thirdparty.dir}/stax-api.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar" dest="${thirdparty.dir}/activation.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-javamail/${sun-javamail}/lib/mail.jar" dest="${thirdparty.dir}/mail.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar" dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-impl.jar" dest="${thirdparty.dir}/jaxb-impl.jar" usetimestamp="true" verbose="true"/>
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/EndpointNameDeployer.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/EndpointNameDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/EndpointNameDeployer.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -43,7 +43,7 @@
{
for (Endpoint ep : dep.getService().getEndpoints())
{
- ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/EventingDeployer.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/EventingDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/EventingDeployer.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -47,7 +47,7 @@
{
for (Endpoint ep : dep.getService().getEndpoints())
{
- ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
@@ -76,7 +76,7 @@
{
for (Endpoint ep : dep.getService().getEndpoints())
{
- ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataAssociationDeployer.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataAssociationDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataAssociationDeployer.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -50,11 +50,11 @@
for (Endpoint ep : dep.getService().getEndpoints())
{
- ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
{
sepMetaData = getEndpointMetaData(umd, ep.getName());
- ep.addMetaData(ServerEndpointMetaData.class, sepMetaData);
+ ep.addAttachment(ServerEndpointMetaData.class, sepMetaData);
Class targetBean = ep.getEndpointImpl();
if (targetBean != null)
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactoryJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactoryJAXRPC.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactoryJAXRPC.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -187,7 +187,7 @@
if (endpoint == null)
throw new WSException("Cannot resolve port-component-link: " + pcLink);
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
endpointAddress = sepMetaData.getEndpointAddress();
}
catch (Throwable ex)
Deleted: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerCallback.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerCallback.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerCallback.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -1,45 +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.core.jaxrpc.handler;
-
-// $Id$
-
-import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
-
-/**
- * A handler callback for the EJB21 Invoker
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 26-Apr-2007
- */
-public interface HandlerCallback
-{
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- public abstract boolean callRequestHandlerChain(HandlerType type);
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- public abstract boolean callResponseHandlerChain(HandlerType type);
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
- public abstract boolean callFaultHandlerChain(HandlerType type, Exception ex);
-
-}
\ No newline at end of file
Deleted: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -1,82 +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.core.jaxws;
-
-// $Id$
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.annotation.Resource;
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.logging.Logger;
-
-/**
- * Inject the JAXWS WebServiceContext
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Jan-2007
- */
-public class WebServiceContextInjector
-{
- // provide logging
- private static Logger log = Logger.getLogger(WebServiceContextInjector.class);
-
- public void injectContext(Object epInstance, WebServiceContext wsContext)
- {
- try
- {
- // scan fields that are marked with @Resource
- Field[] fields = epInstance.getClass().getDeclaredFields();
- for (Field field : fields)
- {
- Class type = field.getType();
- if (type == WebServiceContext.class && field.isAnnotationPresent(Resource.class))
- {
- field.setAccessible(true);
- field.set(epInstance, wsContext);
- }
- }
-
- // scan methods that are marked with @Resource
- Method[] methods = epInstance.getClass().getDeclaredMethods();
- for (Method method : methods)
- {
- Class[] paramTypes = method.getParameterTypes();
- if (paramTypes.length == 1 && paramTypes[0] == WebServiceContext.class && method.isAnnotationPresent(Resource.class))
- {
- method.setAccessible(true);
- method.invoke(epInstance, new Object[] { wsContext });
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.warn("Cannot inject WebServiceContext", ex);
- }
- }
-}
Deleted: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -1,430 +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.core.server;
-
-// $Id$
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.HashMap;
-
-import javax.activation.DataHandler;
-import javax.management.MBeanException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPBodyElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.ws.http.HTTPBinding;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonBinding;
-import org.jboss.ws.core.CommonBindingProvider;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.DirectionHolder;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.DirectionHolder.Direction;
-import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
-import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
-import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
-import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.invocation.InvocationContext;
-import org.jboss.ws.integration.invocation.InvocationHandler;
-import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/** An implementation handles invocations on the endpoint
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public abstract class AbstractInvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(AbstractInvocationHandler.class);
-
- protected Endpoint endpoint;
- protected CommonBindingProvider bindingProvider;
- protected ServerHandlerDelegate delegate;
-
- /** Initialize the service endpoint */
- public void create(Endpoint endpoint)
- {
- this.endpoint = endpoint;
-
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
- if (sepMetaData == null)
- throw new IllegalStateException("Cannot obtain endpoint meta data");
-
- if (sepMetaData.getType() == EndpointMetaData.Type.JAXRPC)
- {
- bindingProvider = new CommonBindingProvider(sepMetaData);
- delegate = new HandlerDelegateJAXRPC(sepMetaData);
- }
- else
- {
- bindingProvider = new BindingProviderImpl(sepMetaData);
- delegate = new HandlerDelegateJAXWS(sepMetaData);
- }
- }
-
- /** Load the SEI implementation bean if necessary */
- protected abstract Class loadServiceEndpoint() throws ClassNotFoundException;
-
- /** Create the instance of the SEI implementation bean if necessary */
- protected abstract Object createServiceEndpointInstance(Class seiImplClass, InvocationContext context) throws Exception;
-
- /** Invoke the instance of the SEI implementation bean */
- protected abstract void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv) throws Exception;
-
- /** Destroy the instance of the SEI implementation bean if necessary */
- protected abstract void destroyServiceEndpointInstance(Object seiImpl);
-
- public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
- {
- return delegate.callRequestHandlerChain(sepMetaData, type);
- }
-
- public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
- {
- return delegate.callResponseHandlerChain(sepMetaData, type);
- }
-
- public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
- {
- delegate.closeHandlerChain(sepMetaData, type);
- }
-
- public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type, Exception ex)
- {
- return delegate.callFaultHandlerChain(sepMetaData, type, ex);
- }
-
- /** Invoke the the service endpoint */
- public void invoke(ServletRequestContext reqContext) throws Exception
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)msgContext.getEndpointMetaData();
- MessageAbstraction reqMessage = msgContext.getMessageAbstraction();
-
- // The direction of the message
- DirectionHolder direction = new DirectionHolder(Direction.InBound);
-
- // Get the order of pre/post handlerchains
- HandlerType[] handlerType = delegate.getHandlerTypeOrder();
- HandlerType[] faultType = delegate.getHandlerTypeOrder();
-
- // Set the required inbound context properties
- setInboundContextProperties();
-
- try
- {
- boolean oneway = false;
- EndpointInvocation epInv = null;
- OperationMetaData opMetaData = null;
- CommonBinding binding = bindingProvider.getCommonBinding();
- binding.setHeaderSource(delegate);
-
- // call the request handler chain
- boolean handlersPass = callRequestHandlerChain(sepMetaData, handlerType[0]);
-
- // Unbind the request message
- if (handlersPass)
- {
- // Get the operation meta data from the SOAP message
- opMetaData = getDispatchDestination(sepMetaData, reqMessage);
- msgContext.setOperationMetaData(opMetaData);
- oneway = opMetaData.isOneWay();
-
- /*
- * From JAX-WS 10.2.1 - "7. If the node does not understand how to process
- * the message, then neither handlers nor the endpoint
- * are invoked and instead the binding generates a SOAP must
- * understand exception"
- *
- * Therefore, this must precede the ENDPOINT chain; however, The PRE
- * chain still must happen first since the message may be encrypted, in which
- * case the operation is still not known. Without knowing the operation, it
- * is not possible to determine what headers are understood by the endpoint.
- */
- if (binding instanceof CommonSOAPBinding)
- ((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);
-
- // Unbind the request message
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
-
- handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[1]);
- handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[2]);
-
- if (handlersPass)
- {
- msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- try
- {
- // Check if protocol handlers modified the payload
- if (msgContext.isModified())
- {
- log.debug("Handler modified payload, unbind message again");
- reqMessage = msgContext.getMessageAbstraction();
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
-
- InvocationHandler invHandler = endpoint.getInvocationHandler();
- Object targetBean = invHandler.getTargetBean(endpoint);
-
- Class implClass = endpoint.getEndpointImpl();
- Method seiMethod = epInv.getJavaMethod();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object[] args = epInv.getRequestPayload();
- Object retObj = invHandler.invoke(endpoint, targetBean, implMethod, args, reqContext);
- epInv.setReturnValue(retObj);
- }
- finally
- {
- msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- }
-
- // Reverse the message direction
- msgContext = processPivotInternal(msgContext, direction);
-
- // Set the required outbound context properties
- setOutboundContextProperties();
-
- if (binding instanceof CommonSOAPBinding)
- XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
-
- // Bind the response message
- MessageAbstraction resMessage = binding.bindResponseMessage(opMetaData, epInv);
- msgContext.setMessageAbstraction(resMessage);
- }
- else
- {
- // Reverse the message direction without calling the endpoint
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
- msgContext = processPivotInternal(msgContext, direction);
- msgContext.setMessageAbstraction(resMessage);
- }
-
- if (oneway == false)
- {
- // call the response handler chain, removing the fault type entry will not call handleFault for that chain
- handlersPass = callResponseHandlerChain(sepMetaData, handlerType[2]);
- faultType[2] = null;
- handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, handlerType[1]);
- faultType[1] = null;
- handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, handlerType[0]);
- faultType[0] = null;
- }
- }
- catch (RuntimeException ex)
- {
- // Reverse the message direction
- processPivotInternal(msgContext, direction);
-
- try
- {
- CommonBinding binding = bindingProvider.getCommonBinding();
- binding.bindFaultMessage(ex);
-
- // call the fault handler chain
- boolean handlersPass = true;
- if (faultType[2] != null)
- handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[2], ex);
- if (faultType[1] != null)
- handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[1], ex);
- if (faultType[0] != null)
- handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[0], ex);
- }
- catch (RuntimeException subEx)
- {
- log.warn("Exception while processing handleFault: ", ex);
- ex = subEx;
- }
- throw ex;
- }
- finally
- {
- closeHandlerChain(sepMetaData, handlerType[2]);
- closeHandlerChain(sepMetaData, handlerType[1]);
- closeHandlerChain(sepMetaData, handlerType[0]);
- }
- }
-
- protected void setInboundContextProperties()
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof MessageContextJAXWS)
- {
- // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
- msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
- }
- }
-
- protected void setOutboundContextProperties()
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof MessageContextJAXWS)
- {
- // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
- msgContext.put(MessageContextJAXWS.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
- }
- }
-
- private CommonMessageContext processPivotInternal(CommonMessageContext msgContext, DirectionHolder direction)
- {
- if (direction.getDirection() == Direction.InBound)
- {
- EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- if (epMetaData.getType() == EndpointMetaData.Type.JAXRPC)
- {
- msgContext = MessageContextJAXRPC.processPivot(msgContext);
- }
- else
- {
- msgContext = MessageContextJAXWS.processPivot(msgContext);
- }
- direction.setDirection(Direction.OutBound);
- }
- return msgContext;
- }
-
- private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData, MessageAbstraction reqMessage) throws SOAPException
- {
- OperationMetaData opMetaData;
-
- String bindingID = epMetaData.getBindingId();
- if (HTTPBinding.HTTP_BINDING.equals(bindingID))
- {
- if (epMetaData.getOperations().size() != 1)
- throw new IllegalStateException("Multiple operations not supported for HTTP binding");
-
- opMetaData = epMetaData.getOperations().get(0);
- }
- else
- {
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)reqMessage;
-
- opMetaData = soapMessage.getOperationMetaData(epMetaData);
- SOAPHeader soapHeader = soapMessage.getSOAPHeader();
-
- // Report a MustUnderstand fault
- if (opMetaData == null)
- {
- String faultString;
- SOAPBody soapBody = soapMessage.getSOAPBody();
- if (soapBody.getChildElements().hasNext())
- {
- SOAPBodyElement soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
- Name soapName = soapBodyElement.getElementName();
- faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for: " + soapName;
- }
- else
- {
- faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for empty soap body";
- }
-
- // R2724 If an INSTANCE receives a message that is inconsistent with its WSDL description, it SHOULD generate a soap:Fault
- // with a faultcode of "Client", unless a "MustUnderstand" or "VersionMismatch" fault is generated.
- if (soapHeader != null && soapHeader.examineMustUnderstandHeaderElements(Constants.URI_SOAP11_NEXT_ACTOR).hasNext())
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- else
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- }
- }
- return opMetaData;
- }
-
- protected Method getImplMethod(Class implClass, Method seiMethod) throws ClassNotFoundException, NoSuchMethodException
- {
- String methodName = seiMethod.getName();
- Class[] paramTypes = seiMethod.getParameterTypes();
- for (int i = 0; i < paramTypes.length; i++)
- {
- Class paramType = paramTypes[i];
- if (JavaUtils.isPrimitive(paramType) == false)
- {
- String paramTypeName = paramType.getName();
- paramType = JavaUtils.loadJavaType(paramTypeName);
- paramTypes[i] = paramType;
- }
- }
-
- Method implMethod = implClass.getMethod(methodName, paramTypes);
- return implMethod;
- }
-
- /** handle invocation exceptions */
- public void handleInvocationException(Throwable th) throws Exception
- {
- if (th instanceof InvocationTargetException)
- {
- // unwrap the throwable raised by the service endpoint implementation
- Throwable targetEx = ((InvocationTargetException)th).getTargetException();
- handleInvocationThrowable(targetEx);
- }
-
- if (th instanceof MBeanException)
- {
- throw ((MBeanException)th).getTargetException();
- }
-
- handleInvocationThrowable(th);
- }
-
- private void handleInvocationThrowable(Throwable th) throws Exception
- {
- if (th instanceof Exception)
- {
- throw (Exception)th;
- }
- else if (th instanceof Error)
- {
- throw (Error)th;
- }
- else
- {
- throw new UndeclaredThrowableException(th);
- }
- }
-}
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ContextServlet.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ContextServlet.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ContextServlet.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -93,7 +93,7 @@
for (ObjectName oname : endpoints)
{
Endpoint ep = epRegistry.getEndpoint(oname);
- ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
writer.print("<tr>");
writer.print(" <td>ServiceEndpointID</td>");
Deleted: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -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.core.server;
-
-// $Id$
-
-import java.lang.reflect.Method;
-
-import javax.xml.rpc.ServiceException;
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
-import org.jboss.ws.core.jaxws.WebServiceContextInjector;
-import org.jboss.ws.core.jaxws.WebServiceContextJSE;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.invocation.InvocationContext;
-import org.jboss.ws.integration.invocation.InvocationHandler;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class InvocationHandlerJSE implements InvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(InvocationHandlerJSE.class);
-
- public void create(Endpoint ep)
- {
- // noting to do
- }
-
- public void destroy(Endpoint endpoint)
- {
- }
-
- public Object getTargetBean(Endpoint ep) throws InstantiationException, IllegalAccessException
- {
- Class epClass = ep.getEndpointImpl();
- Object targetBean = epClass.newInstance();
- return targetBean;
- }
-
- public Object invoke(Endpoint endpoint, Object targetBean, Method method, Object[] args, InvocationContext invContext) throws Exception
- {
- if (targetBean instanceof ServiceLifecycle && context != null)
- {
- try
- {
- ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)seiImpl);
- ServletEndpointContext servletEndpointContext = new ServletEndpointContextImpl((ServletRequestContext)context);
- serviceLifecycle.init(servletEndpointContext);
- }
- catch (ServiceException ex)
- {
- throw new WSException(ex);
- }
- }
- return null;
- }
-
- public void start(Endpoint endpoint)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void stop(Endpoint endpoint)
- {
- // TODO Auto-generated method stub
-
- }
-
- /** Load the SEI implementation bean if necessary */
- public Class loadServiceEndpoint() throws ClassNotFoundException
- {
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
- if (sepMetaData == null)
- throw new IllegalStateException("Cannot obtain endpoint meta data");
-
- ClassLoader cl = sepMetaData.getClassLoader();
- String seiImplName = sepMetaData.getServiceEndpointImplName();
- Class seiImplClass = cl.loadClass(seiImplName);
- return seiImplClass;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(Class seiImplClass, InvocationContext context) throws IllegalAccessException, InstantiationException
- {
- Object seiImpl = seiImplClass.newInstance();
- if (seiImpl instanceof ServiceLifecycle && context != null)
- {
- try
- {
- ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)seiImpl);
- ServletEndpointContext servletEndpointContext = new ServletEndpointContextImpl((ServletRequestContext)context);
- serviceLifecycle.init(servletEndpointContext);
- }
- catch (ServiceException ex)
- {
- throw new WSException(ex);
- }
- }
- return seiImpl;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv) throws SOAPFaultException, Exception
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
- try
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof SOAPMessageContextJAXWS)
- {
- WebServiceContext wsContext = new WebServiceContextJSE((SOAPMessageContextJAXWS)msgContext);
- new WebServiceContextInjector().injectContext(seiImpl, wsContext);
- }
-
- 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);
- }
- }
-
- /** Destroy an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(Object seiImpl)
- {
- if (seiImpl instanceof ServiceLifecycle)
- {
- ((ServiceLifecycle)seiImpl).destroy();
- }
- }
-}
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/LifecycleHandlerImpl.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/LifecycleHandlerImpl.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/LifecycleHandlerImpl.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -49,7 +49,7 @@
private String getEndpointAddress(Endpoint ep)
{
- ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ManagedEndpointRegistry.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ManagedEndpointRegistry.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ManagedEndpointRegistry.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -75,7 +75,7 @@
for (ObjectName sepID : getEndpoints())
{
Endpoint auxEndpoint = getEndpoint(sepID);
- ServerEndpointMetaData sepMetaData = auxEndpoint.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = auxEndpoint.getAttachment(ServerEndpointMetaData.class);
if (pcName.equals(sepMetaData.getPortComponentName()))
{
if (endpoint != null)
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/PortComponentLinkServlet.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/PortComponentLinkServlet.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/PortComponentLinkServlet.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -83,7 +83,7 @@
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
String endpointAddress = sepMetaData.getEndpointAddress();
out.println(endpointAddress);
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -77,6 +77,7 @@
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.RequestHandler;
import org.jboss.ws.integration.Endpoint.EndpointState;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.integration.invocation.InvocationContext;
import org.jboss.ws.integration.invocation.InvocationHandler;
import org.jboss.ws.integration.management.ServerConfig;
@@ -184,7 +185,7 @@
{
log.debug("handleRequest: " + endpoint.getName());
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
@@ -309,7 +310,7 @@
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
@@ -356,12 +357,30 @@
ClassLoader classLoader = sepMetaData.getClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
- AbstractInvocationHandler invHandler = endpoint.getMetaData(AbstractInvocationHandler.class);
- if (invHandler == null)
- throw new IllegalStateException("Cannot obtain invocation handler");
-
+ // Get the Invoker
+ ServiceEndpointInvoker epInvoker = endpoint.getAttachment(ServiceEndpointInvoker.class);
+ if (epInvoker == null)
+ {
+ DeploymentType depType = endpoint.getService().getDeployment().getType();
+ if (depType == DeploymentType.JAXRPC_EJB21)
+ {
+ epInvoker = new ServiceEndpointInvokerEJB21();
+ }
+ else
+ {
+ epInvoker = new ServiceEndpointInvoker();
+ }
+ epInvoker.init(endpoint);
+
+ // TODO: proper invoker lifecycle handling, possibly
+ // called from endpoint lifecycle method
+ InvocationHandler invHandler = endpoint.getInvocationHandler();
+ invHandler.create(endpoint);
+ invHandler.start(endpoint);
+ }
+
// Invoke the service endpoint
- invHandler.invoke(reqContext);
+ epInvoker.invoke(reqContext);
// Get the response message context
msgContext = MessageContextAssociation.peekMessageContext();
@@ -459,7 +478,7 @@
{
log.debug("handleWSDLRequest: " + endpoint.getName());
- ServerEndpointMetaData epMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData epMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
if (epMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
Added: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java (rev 0)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,478 @@
+/*
+ * 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.core.server;
+
+// $Id$
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.HashMap;
+
+import javax.activation.DataHandler;
+import javax.management.MBeanException;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.server.ServiceLifecycle;
+import javax.xml.rpc.server.ServletEndpointContext;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.http.HTTPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.CommonSOAPBinding;
+import org.jboss.ws.core.DirectionHolder;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.DirectionHolder.Direction;
+import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
+import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jaxws.WebServiceContextJSE;
+import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
+import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.invocation.InvocationContext;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+
+/** An implementation handles invocations on the endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class ServiceEndpointInvoker
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceEndpointInvoker.class);
+
+ protected Endpoint endpoint;
+ protected CommonBindingProvider bindingProvider;
+ protected ServerHandlerDelegate delegate;
+
+ /** Initialize the service endpoint */
+ public void init(Endpoint endpoint)
+ {
+ this.endpoint = endpoint;
+
+ ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
+ if (sepMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data");
+
+ if (sepMetaData.getType() == EndpointMetaData.Type.JAXRPC)
+ {
+ bindingProvider = new CommonBindingProvider(sepMetaData);
+ delegate = new HandlerDelegateJAXRPC(sepMetaData);
+ }
+ else
+ {
+ bindingProvider = new BindingProviderImpl(sepMetaData);
+ delegate = new HandlerDelegateJAXWS(sepMetaData);
+ }
+ }
+
+ public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
+ {
+ return delegate.callRequestHandlerChain(sepMetaData, type);
+ }
+
+ public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
+ {
+ return delegate.callResponseHandlerChain(sepMetaData, type);
+ }
+
+ public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
+ {
+ delegate.closeHandlerChain(sepMetaData, type);
+ }
+
+ public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type, Exception ex)
+ {
+ return delegate.callFaultHandlerChain(sepMetaData, type, ex);
+ }
+
+ /** Invoke the the service endpoint */
+ public void invoke(InvocationContext invContext) throws Exception
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)msgContext.getEndpointMetaData();
+ MessageAbstraction reqMessage = msgContext.getMessageAbstraction();
+
+ // The direction of the message
+ DirectionHolder direction = new DirectionHolder(Direction.InBound);
+
+ // Get the order of pre/post handlerchains
+ HandlerType[] handlerType = delegate.getHandlerTypeOrder();
+ HandlerType[] faultType = delegate.getHandlerTypeOrder();
+
+ // Set the required inbound context properties
+ setInboundContextProperties();
+
+ try
+ {
+ boolean oneway = false;
+ EndpointInvocation epInv = null;
+ OperationMetaData opMetaData = null;
+ CommonBinding binding = bindingProvider.getCommonBinding();
+ binding.setHeaderSource(delegate);
+
+ // call the request handler chain
+ boolean handlersPass = callRequestHandlerChain(sepMetaData, handlerType[0]);
+
+ // Unbind the request message
+ if (handlersPass)
+ {
+ // Get the operation meta data from the SOAP message
+ opMetaData = getDispatchDestination(sepMetaData, reqMessage);
+ msgContext.setOperationMetaData(opMetaData);
+ oneway = opMetaData.isOneWay();
+
+ /*
+ * From JAX-WS 10.2.1 - "7. If the node does not understand how to process
+ * the message, then neither handlers nor the endpoint
+ * are invoked and instead the binding generates a SOAP must
+ * understand exception"
+ *
+ * Therefore, this must precede the ENDPOINT chain; however, The PRE
+ * chain still must happen first since the message may be encrypted, in which
+ * case the operation is still not known. Without knowing the operation, it
+ * is not possible to determine what headers are understood by the endpoint.
+ */
+ if (binding instanceof CommonSOAPBinding)
+ ((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);
+
+ // Unbind the request message
+ epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
+ }
+
+ handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[1]);
+ handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[2]);
+
+ if (handlersPass)
+ {
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ try
+ {
+ // Check if protocol handlers modified the payload
+ if (msgContext.isModified())
+ {
+ log.debug("Handler modified payload, unbind message again");
+ reqMessage = msgContext.getMessageAbstraction();
+ epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ Object targetBean = getTargetBean(endpoint, invContext);
+ invokeTargetBean(endpoint, targetBean, epInv, invContext);
+ }
+ finally
+ {
+ msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ }
+
+ // Reverse the message direction
+ msgContext = processPivotInternal(msgContext, direction);
+
+ // Set the required outbound context properties
+ setOutboundContextProperties();
+
+ if (binding instanceof CommonSOAPBinding)
+ XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
+
+ // Bind the response message
+ MessageAbstraction resMessage = binding.bindResponseMessage(opMetaData, epInv);
+ msgContext.setMessageAbstraction(resMessage);
+ }
+ else
+ {
+ // Reverse the message direction without calling the endpoint
+ MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ msgContext = processPivotInternal(msgContext, direction);
+ msgContext.setMessageAbstraction(resMessage);
+ }
+
+ if (oneway == false)
+ {
+ // call the response handler chain, removing the fault type entry will not call handleFault for that chain
+ handlersPass = callResponseHandlerChain(sepMetaData, handlerType[2]);
+ faultType[2] = null;
+ handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, handlerType[1]);
+ faultType[1] = null;
+ handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, handlerType[0]);
+ faultType[0] = null;
+ }
+ }
+ catch (RuntimeException ex)
+ {
+ // Reverse the message direction
+ processPivotInternal(msgContext, direction);
+
+ try
+ {
+ CommonBinding binding = bindingProvider.getCommonBinding();
+ binding.bindFaultMessage(ex);
+
+ // call the fault handler chain
+ boolean handlersPass = true;
+ if (faultType[2] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[2], ex);
+ if (faultType[1] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[1], ex);
+ if (faultType[0] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[0], ex);
+ }
+ catch (RuntimeException subEx)
+ {
+ log.warn("Exception while processing handleFault: ", ex);
+ ex = subEx;
+ }
+ throw ex;
+ }
+ finally
+ {
+ closeHandlerChain(sepMetaData, handlerType[2]);
+ closeHandlerChain(sepMetaData, handlerType[1]);
+ closeHandlerChain(sepMetaData, handlerType[0]);
+ }
+ }
+
+ protected void invokeTargetBean(Endpoint endpoint, Object targetBean, EndpointInvocation epInv, InvocationContext invContext) throws Exception
+ {
+ // Set the the ServletEndpointContext on a JSE endpoint
+ if (targetBean instanceof ServiceLifecycle && invContext instanceof ServletRequestContext)
+ {
+ try
+ {
+ ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)targetBean);
+ ServletEndpointContext servletEndpointContext = new ServletEndpointContextImpl((ServletRequestContext)invContext);
+ serviceLifecycle.init(servletEndpointContext);
+ }
+ catch (ServiceException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+
+ try
+ {
+ Method implMethod = getImplMethod(endpoint, epInv);
+
+ Object[] args = epInv.getRequestPayload();
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext instanceof SOAPMessageContextJAXWS)
+ {
+ WebServiceContext wsContext = new WebServiceContextJSE((SOAPMessageContextJAXWS)msgContext);
+ invContext.addAttachment(WebServiceContext.class, wsContext);
+ }
+ if (msgContext instanceof SOAPMessageContextJAXRPC)
+ {
+ invContext.addAttachment(javax.xml.rpc.handler.MessageContext.class, msgContext);
+ }
+
+ InvocationHandler invHandler = endpoint.getInvocationHandler();
+ Object retObj = invHandler.invoke(endpoint, targetBean, implMethod, args, invContext);
+
+ epInv.setReturnValue(retObj);
+ }
+ finally
+ {
+ if (targetBean instanceof ServiceLifecycle)
+ {
+ ((ServiceLifecycle)targetBean).destroy();
+ }
+ }
+ }
+
+ protected Object getTargetBean(Endpoint endpoint, InvocationContext invContext) throws InstantiationException, IllegalAccessException
+ {
+ InvocationHandler invHandler = endpoint.getInvocationHandler();
+ Object targetBean = invHandler.getTargetBean(endpoint);
+ return targetBean;
+ }
+
+ protected void setInboundContextProperties()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext instanceof MessageContextJAXWS)
+ {
+ // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
+ msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+ }
+ }
+
+ protected void setOutboundContextProperties()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext instanceof MessageContextJAXWS)
+ {
+ // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
+ msgContext.put(MessageContextJAXWS.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+ }
+ }
+
+ private CommonMessageContext processPivotInternal(CommonMessageContext msgContext, DirectionHolder direction)
+ {
+ if (direction.getDirection() == Direction.InBound)
+ {
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ if (epMetaData.getType() == EndpointMetaData.Type.JAXRPC)
+ {
+ msgContext = MessageContextJAXRPC.processPivot(msgContext);
+ }
+ else
+ {
+ msgContext = MessageContextJAXWS.processPivot(msgContext);
+ }
+ direction.setDirection(Direction.OutBound);
+ }
+ return msgContext;
+ }
+
+ private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData, MessageAbstraction reqMessage) throws SOAPException
+ {
+ OperationMetaData opMetaData;
+
+ String bindingID = epMetaData.getBindingId();
+ if (HTTPBinding.HTTP_BINDING.equals(bindingID))
+ {
+ if (epMetaData.getOperations().size() != 1)
+ throw new IllegalStateException("Multiple operations not supported for HTTP binding");
+
+ opMetaData = epMetaData.getOperations().get(0);
+ }
+ else
+ {
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)reqMessage;
+
+ opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ SOAPHeader soapHeader = soapMessage.getSOAPHeader();
+
+ // Report a MustUnderstand fault
+ if (opMetaData == null)
+ {
+ String faultString;
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+ if (soapBody.getChildElements().hasNext())
+ {
+ SOAPBodyElement soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
+ Name soapName = soapBodyElement.getElementName();
+ faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for: " + soapName;
+ }
+ else
+ {
+ faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for empty soap body";
+ }
+
+ // R2724 If an INSTANCE receives a message that is inconsistent with its WSDL description, it SHOULD generate a soap:Fault
+ // with a faultcode of "Client", unless a "MustUnderstand" or "VersionMismatch" fault is generated.
+ if (soapHeader != null && soapHeader.examineMustUnderstandHeaderElements(Constants.URI_SOAP11_NEXT_ACTOR).hasNext())
+ {
+ QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
+ throw new SOAPFaultException(faultCode, faultString, null, null);
+ }
+ else
+ {
+ QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
+ throw new SOAPFaultException(faultCode, faultString, null, null);
+ }
+ }
+ }
+ return opMetaData;
+ }
+
+ protected Method getImplMethod(Endpoint endpoint, EndpointInvocation epInv) throws ClassNotFoundException, NoSuchMethodException
+ {
+ Class implClass = endpoint.getEndpointImpl();
+ Method seiMethod = epInv.getJavaMethod();
+
+ String methodName = seiMethod.getName();
+ Class[] paramTypes = seiMethod.getParameterTypes();
+ for (int i = 0; i < paramTypes.length; i++)
+ {
+ Class paramType = paramTypes[i];
+ if (JavaUtils.isPrimitive(paramType) == false)
+ {
+ String paramTypeName = paramType.getName();
+ paramType = JavaUtils.loadJavaType(paramTypeName);
+ paramTypes[i] = paramType;
+ }
+ }
+
+ Method implMethod = implClass.getMethod(methodName, paramTypes);
+ return implMethod;
+ }
+
+ /** handle invocation exceptions */
+ public void handleInvocationException(Throwable th) throws Exception
+ {
+ if (th instanceof InvocationTargetException)
+ {
+ // unwrap the throwable raised by the service endpoint implementation
+ Throwable targetEx = ((InvocationTargetException)th).getTargetException();
+ handleInvocationThrowable(targetEx);
+ }
+
+ if (th instanceof MBeanException)
+ {
+ throw ((MBeanException)th).getTargetException();
+ }
+
+ handleInvocationThrowable(th);
+ }
+
+ private void handleInvocationThrowable(Throwable th) throws Exception
+ {
+ if (th instanceof Exception)
+ {
+ throw (Exception)th;
+ }
+ else if (th instanceof Error)
+ {
+ throw (Error)th;
+ }
+ else
+ {
+ throw new UndeclaredThrowableException(th);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java (rev 0)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -0,0 +1,135 @@
+/*
+ * 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.core.server;
+
+// $Id$
+
+import java.lang.reflect.Method;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.invocation.HandlerCallback;
+import org.jboss.ws.integration.invocation.InvocationContext;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+
+/**
+ * Handles invocations on EJB21 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class ServiceEndpointInvokerEJB21 extends ServiceEndpointInvoker
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
+
+ @Override
+ protected void invokeTargetBean(Endpoint endpoint, Object targetBean, EndpointInvocation epInv, InvocationContext invContext) throws Exception
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+
+ try
+ {
+ // setup the invocation
+ Method method = getImplMethod(endpoint, epInv);
+ Object[] args = epInv.getRequestPayload();
+
+ // Set the handler callback and endpoint invocation
+ ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
+ endpoint.addAttachment(HandlerCallback.class, new HandlerCallbackImpl(sepMetaData));
+
+ InvocationHandler invHandler = endpoint.getInvocationHandler();
+ Object retObj = invHandler.invoke(endpoint, targetBean, method, args, invContext);
+
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ @Override
+ public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return delegate.callRequestHandlerChain(sepMetaData, type);
+ else return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ @Override
+ public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return delegate.callResponseHandlerChain(sepMetaData, type);
+ else return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ @Override
+ public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type, Exception ex)
+ {
+ if (type == HandlerType.PRE)
+ return delegate.callFaultHandlerChain(sepMetaData, type, ex);
+ else return true;
+ }
+
+ // The ServiceEndpointInterceptor calls the methods in this callback
+ public class HandlerCallbackImpl implements HandlerCallback
+ {
+ private ServerEndpointMetaData sepMetaData;
+
+ public HandlerCallbackImpl(ServerEndpointMetaData sepMetaData)
+ {
+ this.sepMetaData = sepMetaData;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callRequestHandlerChain(HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else return delegate.callRequestHandlerChain(sepMetaData, type);
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callResponseHandlerChain(HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else return delegate.callResponseHandlerChain(sepMetaData, type);
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callFaultHandlerChain(HandlerType type, Exception ex)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else return delegate.callFaultHandlerChain(sepMetaData, type, ex);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointServlet.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointServlet.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointServlet.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -51,7 +51,7 @@
String configFile = ctx.getInitParameter("jbossws-config-file");
if (configName != null || configFile != null)
{
- ServerEndpointMetaData epMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
+ ServerEndpointMetaData epMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
if (epMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServletRequestContext.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServletRequestContext.java 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServletRequestContext.java 2007-05-16 12:10:39 UTC (rev 3105)
@@ -27,17 +27,15 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javax.xml.rpc.handler.MessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.integration.invocation.InvocationContext;
+import org.jboss.ws.integration.invocation.BasicInvocationContext;
/**
* Implementation of ServletEndpointContext
*
* @author Thomas.Diesler(a)jboss.org
*/
-public class ServletRequestContext implements InvocationContext
+public class ServletRequestContext extends BasicInvocationContext
{
private ServletContext context;
private HttpServletRequest request;
@@ -55,11 +53,6 @@
return request.getSession(false);
}
- public MessageContext getMessageContext()
- {
- return (MessageContext)MessageContextAssociation.peekMessageContext();
- }
-
public ServletContext getServletContext()
{
return context;
Modified: branches/tdiesler/trunk/jbossws/version.properties
===================================================================
--- branches/tdiesler/trunk/jbossws/version.properties 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/jbossws/version.properties 2007-05-16 12:10:39 UTC (rev 3105)
@@ -27,7 +27,7 @@
jboss-remoting=2.0.0.GA
jboss-security=4.0.5.GA
jboss-vfs=2.0.0.Beta2
-jbossas-core-libs=4.0.5.GA
+jbossas-core-libs=4.2.0.GA
oswego-concurrent=1.3.4
qdox=1.4
sun-hudson=1.93
Modified: branches/tdiesler/trunk/testsuite/ant-import/build-testsuite.xml
===================================================================
--- branches/tdiesler/trunk/testsuite/ant-import/build-testsuite.xml 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/testsuite/ant-import/build-testsuite.xml 2007-05-16 12:10:39 UTC (rev 3105)
@@ -10,7 +10,7 @@
<!--
Init the various classpaths
-->
- <target name="tests-init" depends="tests-prepare,spi-thirdparty">
+ <target name="tests-init" depends="tests-prepare">
<!-- The combined compile classpath -->
<path id="javac.classpath">
@@ -44,8 +44,10 @@
<copy-test-resources srcdir="${basedir}/src"/>
</target>
- <target name="tests-main" depends="tests-compile,tests-copy-resources" description="Build the deployments.">
+ <target name="tests-jars" depends="tests-compile,tests-copy-resources" description="Build the deployments.">
<ant antfile="${testsuite.dir}/ant-import/build-jars-jaxws.xml" target="build-jars-jaxws" inheritall="true"/>
</target>
+ <target name="tests-main" depends="tests-jars" description="Build the deployments."/>
+
</project>
Modified: branches/tdiesler/trunk/testsuite/build.xml
===================================================================
--- branches/tdiesler/trunk/testsuite/build.xml 2007-05-16 11:58:54 UTC (rev 3104)
+++ branches/tdiesler/trunk/testsuite/build.xml 2007-05-16 12:10:39 UTC (rev 3105)
@@ -22,6 +22,9 @@
<delete dir="${testsuite.dir}/output-tests"/>
</target>
+ <target name="clobber" depends="clean" description="Cleans up all generated files.">
+ </target>
+
<target name="main" description="Builds almost everything." depends="tests-main"/>
<target name="most" description="Builds almost everything." depends="main"/>
17 years, 4 months
JBossWS SVN: r3104 - in branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer: domainAssertion and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: maeste
Date: 2007-05-16 07:58:54 -0400 (Wed, 16 May 2007)
New Revision: 3104
Added:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/AssertionDeployer.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java
Removed:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
Log:
Policy deployer adapted fpr tools
Deleted: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java 2007-05-16 09:00:55 UTC (rev 3103)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
@@ -1,56 +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.extensions.policy.deployer;
-
-import org.apache.ws.policy.PrimitiveAssertion;
-import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
-import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
-
-/**
- * Interface each policy domain should implement for policy deployment.
- *
- * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
- * @author Alessio Soldano <mailto:alessio.soldano@javalinux.it>
- *
- */
-public interface AssertionDeployer
-{
- /**
- * Server side deployment method; ExtensibleMetaData provided so
- * that the implementor to let it plugs its own handlers.
- *
- * @param assertion
- * @param extMetaData
- * @throws UnsupportedAssertion
- */
- public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
-
- /**
- * Client side deployment method; ExtensibleMetaData provided so
- * that the implementor to let it plugs its own handlers.
- *
- * @param assertion
- * @param extMetaData
- * @throws UnsupportedAssertion
- */
- public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
-}
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-05-16 09:00:55 UTC (rev 3103)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
@@ -32,6 +32,8 @@
import org.apache.ws.policy.PrimitiveAssertion;
import org.apache.ws.policy.XorCompositeAssertion;
import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer;
+import org.jboss.ws.extensions.policy.deployer.domainAssertion.WSSecurityAssertionDeployer;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAlternative;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
@@ -75,6 +77,15 @@
}
+// for tools
+ public static PolicyDeployer newInstanceForTools()
+ {
+ PolicyDeployer instance = new PolicyDeployer();
+ instance.domainDeployerMap.put("http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd",NopAssertionDeployer.class);
+ return instance;
+
+ }
+
@SuppressWarnings("unchecked")
public Policy deployServerside(Policy policy, ExtensibleMetaData extMetaData) throws UnsupportedPolicy
{
Deleted: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java 2007-05-16 09:00:55 UTC (rev 3103)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
@@ -1,87 +0,0 @@
-package org.jboss.ws.extensions.policy.deployer;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.StringReader;
-
-import org.apache.ws.policy.PrimitiveAssertion;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
-import org.jboss.ws.extensions.policy.deployer.util.PrimitiveAssertionWriter;
-import org.jboss.ws.integration.UnifiedVirtualFile;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
-
-public class WSSecurityAssertionDeployer implements AssertionDeployer
-{
- private final static Logger log = Logger.getLogger(PolicyDeployer.class);
-
- public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
- {
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- if (extMetaData instanceof EndpointMetaData)
- {
- EndpointMetaData ep = (EndpointMetaData) extMetaData;
-
- WSSecurityConfiguration securityConfiguration;
- try
- {
- //GET XML of security assertion
- PrimitiveAssertionWriter.newInstance().writePrimitiveAssertion(assertion, stream);
- StringReader reader = new StringReader(stream.toString());
-
- //Set security configuration
- securityConfiguration = WSSecurityOMFactory.newInstance().parse(reader);
- WSSecurityConfigFactory.newInstance().initKeystorePath(ep.getRootFile(), securityConfiguration);
- ep.getServiceMetaData().setSecurityConfiguration(securityConfiguration);
-
- //set up handler chain as defined in standard file
- ep.setConfigName("Standard WSSecurity Endpoint");
- ep.initEndpointConfig();
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- throw new UnsupportedAssertion();
- }
- }
- }
-
- public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
- {
- if (extMetaData instanceof EndpointMetaData)
- {
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- EndpointMetaData epMetaData = (EndpointMetaData) extMetaData;
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- if (serviceMetaData.getSecurityConfiguration() == null)
- {
- try
- {
- PrimitiveAssertionWriter.newInstance().writePrimitiveAssertion(assertion, stream);
- StringReader reader = new StringReader(stream.toString());
-
- WSSecurityConfiguration securityConfiguration = WSSecurityOMFactory.newInstance().parse(reader);
- serviceMetaData.setSecurityConfiguration(securityConfiguration);
-
- epMetaData.setConfigName("Standard WSSecurity Client");
- epMetaData.initEndpointConfig();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- throw new UnsupportedAssertion();
- }
- }
- }
-
- }
-
-}
Copied: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/AssertionDeployer.java (from rev 3103, branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java)
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/AssertionDeployer.java (rev 0)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/AssertionDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
@@ -0,0 +1,56 @@
+/*
+ * 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.extensions.policy.deployer.domainAssertion;
+
+import org.apache.ws.policy.PrimitiveAssertion;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+
+/**
+ * Interface each policy domain should implement for policy deployment.
+ *
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ * @author Alessio Soldano <mailto:alessio.soldano@javalinux.it>
+ *
+ */
+public interface AssertionDeployer
+{
+ /**
+ * Server side deployment method; ExtensibleMetaData provided so
+ * that the implementor to let it plugs its own handlers.
+ *
+ * @param assertion
+ * @param extMetaData
+ * @throws UnsupportedAssertion
+ */
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
+
+ /**
+ * Client side deployment method; ExtensibleMetaData provided so
+ * that the implementor to let it plugs its own handlers.
+ *
+ * @param assertion
+ * @param extMetaData
+ * @throws UnsupportedAssertion
+ */
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
+}
Copied: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java (from rev 3103, branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java)
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java (rev 0)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java 2007-05-16 11:58:54 UTC (rev 3104)
@@ -0,0 +1,88 @@
+package org.jboss.ws.extensions.policy.deployer.domainAssertion;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.StringReader;
+
+import org.apache.ws.policy.PrimitiveAssertion;
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.policy.deployer.PolicyDeployer;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
+import org.jboss.ws.extensions.policy.deployer.util.PrimitiveAssertionWriter;
+import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
+
+public class WSSecurityAssertionDeployer implements AssertionDeployer
+{
+ private final static Logger log = Logger.getLogger(PolicyDeployer.class);
+
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ if (extMetaData instanceof EndpointMetaData)
+ {
+ EndpointMetaData ep = (EndpointMetaData) extMetaData;
+
+ WSSecurityConfiguration securityConfiguration;
+ try
+ {
+ //GET XML of security assertion
+ PrimitiveAssertionWriter.newInstance().writePrimitiveAssertion(assertion, stream);
+ StringReader reader = new StringReader(stream.toString());
+
+ //Set security configuration
+ securityConfiguration = WSSecurityOMFactory.newInstance().parse(reader);
+ WSSecurityConfigFactory.newInstance().initKeystorePath(ep.getRootFile(), securityConfiguration);
+ ep.getServiceMetaData().setSecurityConfiguration(securityConfiguration);
+
+ //set up handler chain as defined in standard file
+ ep.setConfigName("Standard WSSecurity Endpoint");
+ ep.initEndpointConfig();
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new UnsupportedAssertion();
+ }
+ }
+ }
+
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ if (extMetaData instanceof EndpointMetaData)
+ {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ EndpointMetaData epMetaData = (EndpointMetaData) extMetaData;
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+ if (serviceMetaData.getSecurityConfiguration() == null)
+ {
+ try
+ {
+ PrimitiveAssertionWriter.newInstance().writePrimitiveAssertion(assertion, stream);
+ StringReader reader = new StringReader(stream.toString());
+
+ WSSecurityConfiguration securityConfiguration = WSSecurityOMFactory.newInstance().parse(reader);
+ serviceMetaData.setSecurityConfiguration(securityConfiguration);
+
+ epMetaData.setConfigName("Standard WSSecurity Client");
+ epMetaData.initEndpointConfig();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new UnsupportedAssertion();
+ }
+ }
+ }
+
+ }
+
+}
17 years, 4 months
JBossWS SVN: r3103 - branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-05-16 05:00:55 -0400 (Wed, 16 May 2007)
New Revision: 3103
Removed:
branches/dlofthouse/archive/
Log:
No longer required.
17 years, 4 months
JBossWS SVN: r3102 - in branches/JBWS-856: jbossws-core/src/java/org/jboss/ws/metadata/builder and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: palin
Date: 2007-05-16 04:32:28 -0400 (Wed, 16 May 2007)
New Revision: 3102
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/JBWS-856/jbossws-tests/build.xml
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java
Log:
Partial commit:
- working on client side policy deployment
- refactoring of policy related methods in metadata builders
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/AssertionDeployer.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -1,3 +1,24 @@
+/*
+ * 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.extensions.policy.deployer;
import org.apache.ws.policy.PrimitiveAssertion;
@@ -4,7 +25,32 @@
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+/**
+ * Interface each policy domain should implement for policy deployment.
+ *
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ * @author Alessio Soldano <mailto:alessio.soldano@javalinux.it>
+ *
+ */
public interface AssertionDeployer
{
- public void deploy(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
+ /**
+ * Server side deployment method; ExtensibleMetaData provided so
+ * that the implementor to let it plugs its own handlers.
+ *
+ * @param assertion
+ * @param extMetaData
+ * @throws UnsupportedAssertion
+ */
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
+
+ /**
+ * Client side deployment method; ExtensibleMetaData provided so
+ * that the implementor to let it plugs its own handlers.
+ *
+ * @param assertion
+ * @param extMetaData
+ * @throws UnsupportedAssertion
+ */
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
}
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -21,29 +21,20 @@
*/
package org.jboss.ws.extensions.policy.deployer;
-import java.io.ByteArrayOutputStream;
-import java.io.StringWriter;
-import java.nio.ByteOrder;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamWriter;
-
import org.apache.ws.policy.AndCompositeAssertion;
import org.apache.ws.policy.Assertion;
import org.apache.ws.policy.Policy;
import org.apache.ws.policy.PrimitiveAssertion;
import org.apache.ws.policy.XorCompositeAssertion;
-import org.apache.ws.policy.util.PolicyFactory;
-import org.apache.ws.policy.util.PolicyWriter;
import org.jboss.logging.Logger;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAlternative;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
-import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
@@ -63,8 +54,6 @@
static {
me = new PolicyDeployer();
me.domainDeployerMap.put("http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd",WSSecurityAssertionDeployer.class);
- me.domainDeployerMap.put("mynamespace",WSSecurityAssertionDeployer.class);
-
}
//hide constructor
@@ -86,7 +75,7 @@
}
-
+ @SuppressWarnings("unchecked")
public Policy deployServerside(Policy policy, ExtensibleMetaData extMetaData) throws UnsupportedPolicy
{
@@ -97,7 +86,7 @@
policy.normalize();
}
-// in normal form we have just one wsp:ExactlyOne elemnet containg unbounded wsp:All (alternative)
+ //in normal form we have just one wsp:ExactlyOne element containg unbounded wsp:All (alternative)
XorCompositeAssertion exactlyOne = (XorCompositeAssertion) policy.getTerms().get(0);
log.debug("####"+ exactlyOne.getClass());
log.debug("####"+ exactlyOne.getTerms());
@@ -129,11 +118,48 @@
return policy;
}
- public void deployClientSide(Policy policy)
+ /**
+ * Policy deployer method for client side: delegates to the right domain deployer
+ * and fails if one or more policy assertions are not supported.
+ *
+ * @param policy
+ * @param extMetaData
+ * @throws UnsupportedPolicy
+ */
+ @SuppressWarnings("unchecked")
+ public void deployClientSide(Policy policy, ExtensibleMetaData extMetaData) throws UnsupportedPolicy
{
-
+ if (! policy.isNormalized())
+ {
+ policy.normalize();
+ }
+ //in normal form we have just one wsp:ExactlyOne element containg unbounded wsp:All (alternative)
+ XorCompositeAssertion exactlyOne = (XorCompositeAssertion) policy.getTerms().get(0);
+ for (AndCompositeAssertion alternative: (List<AndCompositeAssertion>) exactlyOne.getTerms() )
+ {
+ for (Assertion assertion : (List<Assertion>) alternative.getTerms())
+ {
+ if (assertion instanceof PrimitiveAssertion)
+ {
+ try
+ {
+ deployAssertionClientSide((PrimitiveAssertion) assertion, extMetaData);
+ }
+ catch (UnsupportedAssertion e)
+ {
+ log.error("Unsupported assertion!");
+ throw new UnsupportedPolicy();
+ }
+ }
+ else if (assertion instanceof Policy) //inner policy to be verified
+ {
+ deployClientSide((Policy) assertion, extMetaData);
+ }
+ }
+ }
}
+ @SuppressWarnings("unchecked")
private void deployAlternativeServerSide(AndCompositeAssertion alternative, ExtensibleMetaData extMetaData) throws UnsupportedAlternative
{
for (Assertion assertion : (List<Assertion>) alternative.getTerms())
@@ -175,9 +201,14 @@
private void deployAssertionServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
{
AssertionDeployer deployer = getDomainDeployerInstance(assertion.getName().getNamespaceURI());
- deployer.deploy(assertion,extMetaData);
+ deployer.deployServerSide(assertion,extMetaData);
}
-
+
+ private void deployAssertionClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ AssertionDeployer deployer = getDomainDeployerInstance(assertion.getName().getNamespaceURI());
+ deployer.deployClientSide(assertion,extMetaData);
+ }
/**
*
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/deployer/WSSecurityAssertionDeployer.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -1,29 +1,28 @@
package org.jboss.ws.extensions.policy.deployer;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.io.StringReader;
-import java.io.StringWriter;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamWriter;
-
import org.apache.ws.policy.PrimitiveAssertion;
import org.jboss.logging.Logger;
-import org.jboss.ws.extensions.policy.PolicyAssertion;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.StubExt;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
import org.jboss.ws.extensions.policy.deployer.util.PrimitiveAssertionWriter;
+import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
-import org.jboss.xb.binding.JBossXBException;
public class WSSecurityAssertionDeployer implements AssertionDeployer
{
private final static Logger log = Logger.getLogger(PolicyDeployer.class);
- public void deploy(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
{
ByteArrayOutputStream stream = new ByteArrayOutputStream();
if (extMetaData instanceof EndpointMetaData)
@@ -52,12 +51,37 @@
e.printStackTrace();
throw new UnsupportedAssertion();
}
-
-
}
-
}
-
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ if (extMetaData instanceof EndpointMetaData)
+ {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ EndpointMetaData epMetaData = (EndpointMetaData) extMetaData;
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+ if (serviceMetaData.getSecurityConfiguration() == null)
+ {
+ try
+ {
+ PrimitiveAssertionWriter.newInstance().writePrimitiveAssertion(assertion, stream);
+ StringReader reader = new StringReader(stream.toString());
+
+ WSSecurityConfiguration securityConfiguration = WSSecurityOMFactory.newInstance().parse(reader);
+ serviceMetaData.setSecurityConfiguration(securityConfiguration);
+
+ epMetaData.setConfigName("Standard WSSecurity Client");
+ epMetaData.initEndpointConfig();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new UnsupportedAssertion();
+ }
+ }
+ }
+
+ }
}
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -23,9 +23,7 @@
// $Id$
-import java.io.FileInputStream;
import java.io.IOException;
-import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -45,11 +43,6 @@
import javax.xml.namespace.QName;
import javax.xml.ws.addressing.AddressingProperties;
-import org.apache.ws.policy.Policy;
-import org.apache.ws.policy.PolicyReference;
-import org.apache.ws.policy.util.DOMPolicyReader;
-import org.apache.ws.policy.util.PolicyFactory;
-import org.apache.ws.policy.util.PolicyRegistry;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -64,11 +57,6 @@
import org.jboss.ws.extensions.eventing.EventingUtils;
import org.jboss.ws.extensions.eventing.deployment.EventingEndpoint;
import org.jboss.ws.extensions.eventing.metadata.EventingEpMetaExt;
-import org.jboss.ws.extensions.policy.PolicyScopeLevel;
-import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
-import org.jboss.ws.extensions.policy.deployer.PolicyDeployer;
-import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
-import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
@@ -78,14 +66,12 @@
import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
@@ -472,139 +458,7 @@
}
}
- protected void processPolicyAnnotation(EndpointMetaData epMetaData, Class<?> sepClass, UnifiedDeploymentInfo udi)
- {
- for (org.jboss.ws.extensions.policy.annotation.Policy policy : sepClass.getAnnotation(PolicyAttachment.class).value())
- {
- Policy normPolicy;
- InputStream is = null;
- try
- {
- DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
- is = udi.getMetaDataFileURL(policy.policyFileLocation()).openStream();
- Policy unnormalizedPolicy = reader.readPolicy(is);
- normPolicy = (Policy)unnormalizedPolicy.normalize();
- log.info("++++++++++++++ Deploying Annotated Policy="+policy.policyFileLocation());
- deployPolicy(normPolicy, policy.scope(), epMetaData);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- } finally
- {
- try
- {
- is.close();
- } catch (Exception e) {}
- }
-
- }
-
-
- }
- protected void processPolicyMetaDataExtension(EndpointMetaData epMetaData, WSDLDefinitions wsdlDefinitions)
- {
- //Collect all policies defined in our wsdl definitions
- DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
- PolicyRegistry localPolicyRegistry = new PolicyRegistry();
- for (WSDLExtensibilityElement policyElement : wsdlDefinitions.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY))
- {
- Policy policy = reader.readPolicy(policyElement.getElement());
- localPolicyRegistry.register(policy.getPolicyURI(), policy);
- }
-
- //Port scope
- WSDLService wsdlService = wsdlDefinitions.getService(epMetaData.getServiceMetaData().getServiceName());
- if (wsdlService != null)
- {
- WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getPortName());
- if (wsdlEndpoint != null)
- {
- List<WSDLExtensibilityElement> portPolicyRefList = wsdlEndpoint.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
- deployPolicies(portPolicyRefList, PolicyScopeLevel.WSDL_PORT, localPolicyRegistry, epMetaData);
- }
- else
- {
- log.warn("Cannot get port '"+epMetaData.getPortName()+"' from the given wsdl definitions! Eventual policies attached to this port won't be considered.");
- }
- }
- else
- {
- log.warn("Cannot get service '"+epMetaData.getServiceMetaData().getServiceName()+"' from the given wsdl definitions! Eventual policies attached to this service won't be considered.");
- }
-
- //Binding scope
- WSDLBinding wsdlBinding = wsdlDefinitions.getBindingByInterfaceName(epMetaData.getPortTypeName());
- if (wsdlBinding != null)
- {
- List<WSDLExtensibilityElement> bindingPolicyRefList = wsdlBinding.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
- deployPolicies(bindingPolicyRefList, PolicyScopeLevel.WSDL_BINDING, localPolicyRegistry, epMetaData);
- }
- else
- {
- log.warn("Cannot get binding for portType '"+epMetaData.getPortTypeName()+"' from the given wsdl definitions! Eventual policies attached to this binding won't be considered.");
- }
-
- //PortType scope
- WSDLInterface wsdlInterface = wsdlDefinitions.getInterface(epMetaData.getPortTypeName());
- if (wsdlInterface != null)
- {
- List<WSDLExtensibilityElement> portTypePolicyRefList = wsdlInterface.getExtensibilityElements(Constants.WSDL_PROPERTY_POLICYURIS);
- deployPolicies(portTypePolicyRefList, PolicyScopeLevel.WSDL_PORT_TYPE, localPolicyRegistry, epMetaData);
- }
- else
- {
- log.warn("Cannot get portType '"+epMetaData.getPortTypeName()+"' from the given wsdl definitions! Eventual policies attached to this portType won't be considered.");
- }
- }
-
- private void deployPolicies(List<WSDLExtensibilityElement> policyReferences, PolicyScopeLevel scope, PolicyRegistry localPolicies, ExtensibleMetaData extMetaData)
- {
- if (policyReferences != null && policyReferences.size() != 0 && extMetaData instanceof ServerEndpointMetaData)
- {
- DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
- for (WSDLExtensibilityElement element : policyReferences)
- {
- PolicyReference policyRef = reader.readPolicyReference(element.getElement());
- Policy normPolicy;
- try
- {
- normPolicy = (Policy)policyRef.normalize(localPolicies);
- }
- catch (RuntimeException e)
- {
- //TODO!!! not a local policy: get the policy definition and create the policy
- normPolicy = null;
- }
- deployPolicy(normPolicy, scope, extMetaData);
- }
- }
- }
-
- private void deployPolicy(Policy policy, PolicyScopeLevel scope, ExtensibleMetaData extMetaData)
- {
- PolicyMetaExtension ext = (PolicyMetaExtension)extMetaData.getExtension(Constants.URI_WS_POLICY);
- if (ext == null)
- {
- ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
- extMetaData.addExtension(ext);
- }
- try
- {
- Policy deployedPolicy = PolicyDeployer.getInstance().deployServerside(policy, extMetaData);
- ext.addPolicy(scope,deployedPolicy);
- }
- catch (UnsupportedPolicy e)
- {
- if (log.isDebugEnabled())
- {
- log.debug("Policy Not supported:" + policy.getPolicyURI());
- }
- }
- }
-
-
protected void processEndpointMetaDataExtensions(EndpointMetaData epMetaData, WSDLDefinitions wsdlDefinitions)
{
for (WSDLInterface wsdlInterface : wsdlDefinitions.getInterfaces())
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -31,14 +31,20 @@
import javax.xml.namespace.QName;
import javax.xml.ws.BindingType;
+import org.apache.ws.policy.Policy;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.deployer.PolicyDeployer;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
@@ -83,7 +89,13 @@
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
buildMetaDataInternal(serviceMetaData, wsdlDefinitions);
-
+
+ // Setup policies for each endpoint
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ processPolicyMetaDataExtension(epMetaData, wsdlDefinitions);
+ }
+
// Read the WSDL and initialize the schema model
// This should only be needed for debuging purposes of the UMDM
JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
@@ -293,4 +305,27 @@
if(log.isDebugEnabled()) log.debug("END: rebuildMetaData\n" + epMetaData.getServiceMetaData());
}
+
+
+ protected void deployPolicy(Policy policy, PolicyScopeLevel scope, ExtensibleMetaData extMetaData)
+ {
+ PolicyMetaExtension ext = (PolicyMetaExtension)extMetaData.getExtension(Constants.URI_WS_POLICY);
+ if (ext == null)
+ {
+ ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
+ extMetaData.addExtension(ext);
+ }
+ try
+ {
+ PolicyDeployer.getInstance().deployClientSide(policy, extMetaData);
+ ext.addPolicy(scope, policy);
+ }
+ catch (UnsupportedPolicy e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Policy Not supported:" + policy.getPolicyURI());
+ }
+ }
+ }
}
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -55,6 +55,11 @@
import javax.xml.ws.addressing.Action;
import javax.xml.ws.addressing.AddressingProperties;
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.PolicyReference;
+import org.apache.ws.policy.util.DOMPolicyReader;
+import org.apache.ws.policy.util.PolicyFactory;
+import org.apache.ws.policy.util.PolicyRegistry;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -62,11 +67,14 @@
import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
import org.jboss.ws.core.jaxws.WrapperGenerator;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
import org.jboss.ws.metadata.acessor.JAXBAccessor;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.j2ee.serviceref.HandlerChainsObjectFactory;
@@ -74,9 +82,11 @@
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
import org.jboss.ws.metadata.umdm.FaultMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
import org.jboss.ws.metadata.umdm.TypesMetaData;
import org.jboss.ws.metadata.umdm.WrappedParameter;
@@ -85,7 +95,11 @@
import org.jboss.ws.metadata.wsdl.WSDLBindingMessageReference;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
+import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLMIMEPart;
+import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -100,7 +114,7 @@
* @author Thomas.Diesler(a)jboss.com
*/
@SuppressWarnings("deprecation")
-public class JAXWSMetaDataBuilder extends MetaDataBuilder
+public abstract class JAXWSMetaDataBuilder extends MetaDataBuilder
{
protected static final Logger log = Logger.getLogger(JAXWSWebServiceMetaDataBuilder.class);
@@ -958,4 +972,130 @@
{
this.wrapperGenerator = wrapperGenerator;
}
+
+
+ protected void processPolicyAnnotation(EndpointMetaData epMetaData, Class<?> sepClass, UnifiedDeploymentInfo udi)
+ {
+ for (org.jboss.ws.extensions.policy.annotation.Policy policy : sepClass.getAnnotation(PolicyAttachment.class).value())
+ {
+ InputStream is = null;
+ try
+ {
+ DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
+ is = udi.getMetaDataFileURL(policy.policyFileLocation()).openStream();
+ Policy unnormalizedPolicy = reader.readPolicy(is);
+ Policy normPolicy = (Policy)unnormalizedPolicy.normalize();
+ log.info("Deploying Annotated Policy = "+policy.policyFileLocation());
+ PolicyScopeLevel scope = policy.scope();
+ if (PolicyScopeLevel.WSDL_PORT.equals(scope) || PolicyScopeLevel.WSDL_PORT_TYPE.equals(scope) ||
+ PolicyScopeLevel.WSDL_BINDING.equals(scope))
+ {
+ deployPolicy(normPolicy, scope, epMetaData);
+ }
+ else
+ {
+ throw new WSException("Policy scope "+scope+" not supported yet!");
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ } finally
+ {
+ try
+ {
+ is.close();
+ } catch (Exception e) {}
+ }
+ }
+ }
+
+ protected void processPolicyMetaDataExtension(EndpointMetaData epMetaData, WSDLDefinitions wsdlDefinitions)
+ {
+ //Collect all policies defined in our wsdl definitions
+ DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
+ PolicyRegistry localPolicyRegistry = new PolicyRegistry();
+ for (WSDLExtensibilityElement policyElement : wsdlDefinitions.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY))
+ {
+ Policy policy = reader.readPolicy(policyElement.getElement());
+ localPolicyRegistry.register(policy.getPolicyURI(), policy);
+ }
+ //Port scope
+ WSDLService wsdlService = wsdlDefinitions.getService(epMetaData.getServiceMetaData().getServiceName());
+ if (wsdlService != null)
+ {
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getPortName());
+ if (wsdlEndpoint != null)
+ {
+ List<WSDLExtensibilityElement> portPolicyRefList = wsdlEndpoint.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ deployPolicies(portPolicyRefList, PolicyScopeLevel.WSDL_PORT, localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get port '"+epMetaData.getPortName()+"' from the given wsdl definitions! Eventual policies attached to this port won't be considered.");
+ }
+ }
+ else
+ {
+ log.warn("Cannot get service '"+epMetaData.getServiceMetaData().getServiceName()+"' from the given wsdl definitions! Eventual policies attached to this service won't be considered.");
+ }
+
+ //Binding scope
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBindingByInterfaceName(epMetaData.getPortTypeName());
+ if (wsdlBinding != null)
+ {
+ List<WSDLExtensibilityElement> bindingPolicyRefList = wsdlBinding.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ deployPolicies(bindingPolicyRefList, PolicyScopeLevel.WSDL_BINDING, localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get binding for portType '"+epMetaData.getPortTypeName()+"' from the given wsdl definitions! Eventual policies attached to this binding won't be considered.");
+ }
+
+ //PortType scope
+ WSDLInterface wsdlInterface = wsdlDefinitions.getInterface(epMetaData.getPortTypeName());
+ if (wsdlInterface != null)
+ {
+ List<WSDLExtensibilityElement> portTypePolicyRefList = wsdlInterface.getExtensibilityElements(Constants.WSDL_PROPERTY_POLICYURIS);
+ deployPolicies(portTypePolicyRefList, PolicyScopeLevel.WSDL_PORT_TYPE, localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get portType '"+epMetaData.getPortTypeName()+"' from the given wsdl definitions! Eventual policies attached to this portType won't be considered.");
+ }
+ }
+
+ private void deployPolicies(List<WSDLExtensibilityElement> policyReferences, PolicyScopeLevel scope, PolicyRegistry localPolicies, ExtensibleMetaData extMetaData)
+ {
+ if (policyReferences != null && policyReferences.size() != 0 && extMetaData instanceof ServerEndpointMetaData)
+ {
+ DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
+ for (WSDLExtensibilityElement element : policyReferences)
+ {
+ PolicyReference policyRef = reader.readPolicyReference(element.getElement());
+ Policy normPolicy;
+ try
+ {
+ normPolicy = (Policy)policyRef.normalize(localPolicies);
+ }
+ catch (RuntimeException e)
+ {
+ //TODO!!! not a local policy: get the policy definition and create the policy
+ normPolicy = null;
+ }
+ deployPolicy(normPolicy, scope, extMetaData);
+ }
+ }
+ }
+
+ /**
+ * Implementors should add PolicyMetaDataExt to the provided ExtensibleMetaData according
+ * to the specified policy and policy scope.
+ *
+ * @param policy
+ * @param scope
+ * @param extMetaData
+ */
+ protected abstract void deployPolicy(Policy policy, PolicyScopeLevel scope, ExtensibleMetaData extMetaData);
+
}
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -26,10 +26,17 @@
import javax.jws.WebService;
import javax.xml.ws.WebServiceProvider;
+import org.apache.ws.policy.Policy;
+import org.jboss.ws.Constants;
import org.jboss.ws.annotation.EndpointConfig;
import org.jboss.ws.annotation.WebContext;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.deployer.PolicyDeployer;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
@@ -153,4 +160,26 @@
sepMetaData.setVirtualHosts(virtualHosts);
}
}
+
+ protected void deployPolicy(Policy policy, PolicyScopeLevel scope, ExtensibleMetaData extMetaData)
+ {
+ PolicyMetaExtension ext = (PolicyMetaExtension)extMetaData.getExtension(Constants.URI_WS_POLICY);
+ if (ext == null)
+ {
+ ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
+ extMetaData.addExtension(ext);
+ }
+ try
+ {
+ Policy deployedPolicy = PolicyDeployer.getInstance().deployServerside(policy, extMetaData);
+ ext.addPolicy(scope,deployedPolicy);
+ }
+ catch (UnsupportedPolicy e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Policy Not supported:" + policy.getPolicyURI());
+ }
+ }
+ }
}
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -160,10 +160,9 @@
else if (seiClass.isAnnotationPresent(HandlerChain.class))
processHandlerChain(sepMetaData, seiClass);
-// Process an optional @PolicyAttachment annotation
+ //Process an optional @PolicyAttachment annotation
if (sepClass.isAnnotationPresent(PolicyAttachment.class))
processPolicyAnnotation(sepMetaData, sepClass, udi);
-
// process webservices.xml contributions
processWSDDContribution(sepMetaData);
@@ -341,9 +340,21 @@
if (anPolicy!=null)
{
String policyLocation = anPolicy.wsdlFragmentLocation();
+ System.out.println("Policy Location: ###"+policyLocation+"###");
if (policyLocation==null || policyLocation.length()==0)
throw new WSException("Missing wsdlFragmentLocation for @Policy on " + sepClass.getName());
result.policyLocation = udi.getMetaDataFileURL(policyLocation);
+// if (result.policyLocation==null) {
+// try
+// {
+// result.policyLocation = new File(policyLocation).toURL();
+// }
+// catch (Exception e)
+// {
+// e.printStackTrace();
+// }
+// }
+ System.out.println("Policy Location: ###"+result.policyLocation+"###");
}
return result;
Modified: branches/JBWS-856/jbossws-tests/build.xml
===================================================================
--- branches/JBWS-856/jbossws-tests/build.xml 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-tests/build.xml 2007-05-16 08:32:28 UTC (rev 3102)
@@ -352,6 +352,7 @@
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/concurrent.jar"/>
+ <classpath location="${thirdparty.dir}/commons-logging.jar"/>
<classpath location="${tests.output.dir}/classes"/>
</taskdef>
Modified: branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java
===================================================================
--- branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -31,7 +31,8 @@
import org.jboss.ws.annotation.PolicyWsdlFragment;
@WebService(name = "Hello", targetNamespace = "http://org.jboss.ws/samples/wssecuritypolicy")
-@PolicyWsdlFragment(wsdlFragmentLocation="WEB-INF/PolicyAttachmentFragment.wsdl")
+//@PolicyWsdlFragment(wsdlFragmentLocation="WEB-INF/PolicyAttachmentFragment.wsdl")
+@PolicyWsdlFragment(wsdlFragmentLocation="/dati/jbws_JBWS-856/jbossws-tests/output/resources/jaxws/samples/wssecuritypolicy/WEB-INF/PolicyAttachmentFragment.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class HelloJavaBean
{
Modified: branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java
===================================================================
--- branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java 2007-05-16 08:26:33 UTC (rev 3101)
+++ branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java 2007-05-16 08:32:28 UTC (rev 3102)
@@ -69,14 +69,14 @@
private Hello getPort() throws Exception
{
URL wsdlURL = new File("wsprovide/resources/jaxws/samples/wssecuritypolicy/HelloService.wsdl").toURL();
- URL securityURL = new File("resources/jaxws/samples/wssecuritypolicy/simple-encrypt/META-INF/jboss-wsse-client.xml").toURL();
+ //URL securityURL = new File("resources/jaxws/samples/wssecuritypolicy/simple-encrypt/META-INF/jboss-wsse-client.xml").toURL();
QName serviceName = new QName("http://org.jboss.ws/samples/wssecuritypolicy", "HelloService");
Service service = Service.create(wsdlURL, serviceName);
- ((ServiceExt)service).setSecurityConfig(securityURL.toExternalForm());
+ //((ServiceExt)service).setSecurityConfig(securityURL.toExternalForm());
Hello port = (Hello)service.getPort(Hello.class);
- ((StubExt)port).setConfigName("Standard WSSecurity Client");
+ //((StubExt)port).setConfigName("Standard WSSecurity Client");
Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxws-samples-wssecuritypolicy-encrypt");
17 years, 4 months
JBossWS SVN: r3101 - in branches/jbossws-2.0: build/ant-import and 16 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-16 04:26:33 -0400 (Wed, 16 May 2007)
New Revision: 3101
Added:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java
Removed:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java
Modified:
branches/jbossws-2.0/build/ant-import/build-deploy.xml
branches/jbossws-2.0/build/ant-import/build-release.xml
branches/jbossws-2.0/build/ant-import/build-thirdparty.xml
branches/jbossws-2.0/build/etc/component-info/jbossws.xml
branches/jbossws-2.0/build/etc/wsconsume.bat
branches/jbossws-2.0/build/etc/wsconsume.sh
branches/jbossws-2.0/build/etc/wsprovide.bat
branches/jbossws-2.0/build/etc/wsprovide.sh
branches/jbossws-2.0/build/etc/wspublish.sh
branches/jbossws-2.0/build/version.properties
branches/jbossws-2.0/jbossws-core/build.xml
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/jbossws-2.0/jbossws-core/src/resources/samples/build.xml
branches/jbossws-2.0/jbossws-tests/build.xml
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java
Log:
Drop the SUN tools fork. They are pulled from repository now
Modified: branches/jbossws-2.0/build/ant-import/build-deploy.xml
===================================================================
--- branches/jbossws-2.0/build/ant-import/build-deploy.xml 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/ant-import/build-deploy.xml 2007-05-16 08:26:33 UTC (rev 3101)
@@ -57,13 +57,15 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
</fileset>
<fileset dir="${thirdparty.dir}">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
- <include name="wsdl4j.jar"/>
- <include name="jbossws-wsconsume-impl.jar"/>
+ <include name="jaxws-rt.jar"/>
+ <include name="jaxws-tools.jar"/>
+ <include name="wsdl4j.jar"/>
</fileset>
</copy>
<copy todir="${jboss50.home}/server/${jboss.server.instance}/lib" overwrite="true">
@@ -106,12 +108,14 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
</fileset>
<fileset dir="${thirdparty.dir}">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
- <include name="jbossws-wsconsume-impl.jar"/>
+ <include name="jaxws-rt.jar"/>
+ <include name="jaxws-tools.jar"/>
</fileset>
</copy>
<copy todir="${jboss42.home}/server/${jboss.server.instance}/lib" overwrite="true">
@@ -153,13 +157,15 @@
<include name="jboss-jaxws.jar" />
<include name="jboss-saaj.jar" />
<include name="jbossws-client.jar" />
+ <include name="jbossws-integration-tools.jar"/>
</fileset>
<!-- Only available on jdk1.5 -->
<fileset dir="${thirdparty.dir}">
<include name="jaxb-api.jar" />
<include name="jaxb-impl.jar" />
<include name="jaxb-xjc.jar" />
- <include name="jbossws-wsconsume-impl.jar" />
+ <include name="jaxws-rt.jar"/>
+ <include name="jaxws-tools.jar"/>
<include name="stax-api.jar"/>
<include name="wstx.jar"/>
</fileset>
Modified: branches/jbossws-2.0/build/ant-import/build-release.xml
===================================================================
--- branches/jbossws-2.0/build/ant-import/build-release.xml 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/ant-import/build-release.xml 2007-05-16 08:26:33 UTC (rev 3101)
@@ -221,7 +221,7 @@
<copy todir="${install.thirdparty.dir}" overwrite="true">
<fileset dir="${thirdparty.dir}">
<include name="activation.jar"/>
- <include name="jbossws-wsconsume-impl.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
<include name="jboss-xml-binding.jar"/>
<include name="jaxb-*.jar"/>
<include name="juddi-service.sar"/>
Modified: branches/jbossws-2.0/build/ant-import/build-thirdparty.xml
===================================================================
--- branches/jbossws-2.0/build/ant-import/build-thirdparty.xml 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/ant-import/build-thirdparty.xml 2007-05-16 08:26:33 UTC (rev 3101)
@@ -35,8 +35,8 @@
<get src="${jboss.repository}/apache-xerces/${apache-xerces}/lib/xml-apis.jar" dest="${thirdparty.dir}/xml-apis.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/apache-xmlsec/${apache-xmlsec}/lib/xmlsec.jar" dest="${thirdparty.dir}/xmlsec.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/dom4j/${dom4j}/lib/dom4j.jar" dest="${thirdparty.dir}/dom4j.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/eclipse-compiler/${eclipse-compiler}/lib/jdtCompilerAdapter.jar" dest="${thirdparty.dir}/jdtCompilerAdapter.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/eclipse-compiler/${eclipse-compiler}/lib/org.eclipse.jdt.core.jar" dest="${thirdparty.dir}/org.eclipse.jdt.core.jar" usetimestamp="true" verbose="true"/>
+ <!--get src="${jboss.repository}/eclipse-compiler/${eclipse-compiler}/lib/jdtCompilerAdapter.jar" dest="${thirdparty.dir}/jdtCompilerAdapter.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/eclipse-compiler/${eclipse-compiler}/lib/org.eclipse.jdt.core.jar" dest="${thirdparty.dir}/org.eclipse.jdt.core.jar" usetimestamp="true" verbose="true"/-->
<get src="${jboss.repository}/gnu-getopt/${gnu-getopt}/lib/getopt.jar" dest="${thirdparty.dir}/getopt.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/hibernate/${hibernate}/lib/hibernate3.jar" dest="${thirdparty.dir}/hibernate3.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j.jar" dest="${thirdparty.dir}/wsdl4j.jar" usetimestamp="true" verbose="true"/>
@@ -53,8 +53,7 @@
<get src="${jboss.repository}/jboss/jboss-vfs/${jboss-vfs}/lib/jboss-vfs.jar" dest="${thirdparty.dir}/jboss-vfs.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jboss-vfs/${jboss-vfs}/lib/jboss-vfs-sources.jar" dest="${thirdparty.dir}/jboss-vfs-sources.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"/>
- <get src="${jboss.repository}/jboss/jbossretro/${jboss-jbossretro}/lib/jbossretro-rt.jar" dest="${thirdparty.dir}/jbossretro-rt.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jboss/jbossws-wsconsume-impl/${jbossws-wsconsume-impl}/lib/jbossws-wsconsume-impl.jar" dest="${thirdparty.dir}/jbossws-wsconsume-impl.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/jboss/jbossretro/${jboss-jbossretro}/lib/jbossretro-rt.jar" dest="${thirdparty.dir}/jbossretro-rt.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding.jar" dest="${thirdparty.dir}/jboss-xml-binding.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding-sources.jar" dest="${thirdparty.dir}/jboss-xml-binding-sources.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"/>
@@ -74,6 +73,10 @@
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar" dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-impl.jar" dest="${thirdparty.dir}/jaxb-impl.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-xjc.jar" dest="${thirdparty.dir}/jaxb-xjc.jar" usetimestamp="true" verbose="true"/>
+
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-rt.jar" dest="${thirdparty.dir}/jaxws-rt.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-tools.jar" dest="${thirdparty.dir}/jaxws-tools.jar" usetimestamp="true" verbose="true"/>
+
<get src="${jboss.repository}/sun-servlet/${sun-servlet}/lib/servlet-api.jar" dest="${thirdparty.dir}/servlet-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/xmlunit-xmlunit/${xmlunit}/lib/xmlunit1.0.jar" dest="${thirdparty.dir}/xmlunit1.0.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/wscommons-policy/${wscommons-policy}/lib/policy.jar" dest="${thirdparty.dir}/policy.jar" usetimestamp="true" verbose="true"/>
@@ -112,6 +115,9 @@
<pathelement location="${thirdparty.dir}/xmlsec.jar"/>
<pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
<pathelement location="${thirdparty.dir}/xalan.jar"/>
+
+ <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
</path>
<!-- The compile classpath for jboss50 integration -->
Modified: branches/jbossws-2.0/build/etc/component-info/jbossws.xml
===================================================================
--- branches/jbossws-2.0/build/etc/component-info/jbossws.xml 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/etc/component-info/jbossws.xml 2007-05-16 08:26:33 UTC (rev 3101)
@@ -28,8 +28,8 @@
<import componentref="jbpm/bpel">
<compatible version="@jbpm-bpel@"/>
</import>
- <import componentref="jboss/jbossws-wsconsume-impl">
- <compatible version="@jbossws-wsconsume-impl@"/>
+ <import componentref="sun-jaxws">
+ <compatible version="@sun-jaxws@"/>
</import>
<import componentref="stax-api">
<compatible version="@stax-api@"/>
Modified: branches/jbossws-2.0/build/etc/wsconsume.bat
===================================================================
--- branches/jbossws-2.0/build/etc/wsconsume.bat 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/etc/wsconsume.bat 2007-05-16 08:26:33 UTC (rev 3101)
@@ -40,7 +40,9 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar
-set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-wsconsume-impl.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-integration-tools.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar
@@ -50,4 +52,4 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
rem Execute the JVM
-"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.ws.tools.jaxws.command.wsconsume %*
+"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.ws.integration.tools.jaxws.command.wsconsume %*
Modified: branches/jbossws-2.0/build/etc/wsconsume.sh
===================================================================
--- branches/jbossws-2.0/build/etc/wsconsume.sh 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/etc/wsconsume.sh 2007-05-16 08:26:33 UTC (rev 3101)
@@ -50,7 +50,6 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JAVA_HOME/lib/tools.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-xml-binding.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/wstx.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-wsconsume-impl.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/activation.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/getopt.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/javassist.jar"
@@ -58,6 +57,8 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/stax-api.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-impl.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-xjc.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-rt.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-tools.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-client.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-jaxws.jar"
@@ -65,6 +66,7 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/mail.jar"
+WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jbossws-integration-tools.jar"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
@@ -79,4 +81,4 @@
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dlog4j.configuration=wstools-log4j.xml \
-classpath "$WSCONSUME_CLASSPATH" \
- org.jboss.ws.tools.jaxws.command.wsconsume "$@"
+ org.jboss.ws.integration.tools.jaxws.command.wsconsume "$@"
Modified: branches/jbossws-2.0/build/etc/wsprovide.bat
===================================================================
--- branches/jbossws-2.0/build/etc/wsprovide.bat 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/etc/wsprovide.bat 2007-05-16 08:26:33 UTC (rev 3101)
@@ -45,4 +45,4 @@
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
rem Execute the JVM
-"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.ws.tools.jaxws.command.wsprovide %*
+"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.ws.integration.tools.jaxws.command.wsprovide %*
Modified: branches/jbossws-2.0/build/etc/wsprovide.sh
===================================================================
--- branches/jbossws-2.0/build/etc/wsprovide.sh 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/etc/wsprovide.sh 2007-05-16 08:26:33 UTC (rev 3101)
@@ -60,6 +60,7 @@
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/mail.jar"
+WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jbossws-integration-tools.jar"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
@@ -74,4 +75,4 @@
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dlog4j.configuration=wstools-log4j.xml \
-classpath "$WSPROVIDE_CLASSPATH" \
- org.jboss.ws.tools.jaxws.command.wsprovide "$@"
+ org.jboss.ws.integration.tools.jaxws.command.wsprovide "$@"
Modified: branches/jbossws-2.0/build/etc/wspublish.sh
===================================================================
--- branches/jbossws-2.0/build/etc/wspublish.sh 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/etc/wspublish.sh 2007-05-16 08:26:33 UTC (rev 3101)
@@ -43,6 +43,7 @@
WSPUBLISH_CLASSPATH="$WSPUBLISH_CLASSPATH:$TOMCAT_HOME/common/lib/log4j.jar"
WSPUBLISH_CLASSPATH="$WSPUBLISH_CLASSPATH:$TOMCAT_HOME/common/lib/servlet-api.jar"
+
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
TOMCAT_HOME=`cygpath --path --windows "$TOMCAT_HOME"`
Modified: branches/jbossws-2.0/build/version.properties
===================================================================
--- branches/jbossws-2.0/build/version.properties 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/build/version.properties 2007-05-16 08:26:33 UTC (rev 3101)
@@ -17,7 +17,6 @@
apache-xmlsec=1.3.0
ibm-wsdl4j=1.6.2
javassist=3.5.0.CR1
-jbossws-wsconsume-impl=2.0.0
jbpm-bpel=1.1.0.Beta5
sun-jaxb=2.0.3jboss
stax-api=1.0
@@ -71,6 +70,7 @@
sun-hudson=1.93
sun-jaf=1.1
sun-javamail=1.4
+sun-jaxws=2.0.0
sun-servlet=2.4
woodstox=3.1.1
wscommons-policy=1.0
Modified: branches/jbossws-2.0/jbossws-core/build.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/build.xml 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/build.xml 2007-05-16 08:26:33 UTC (rev 3101)
@@ -146,13 +146,23 @@
<jar jarfile="${core.output.lib.dir}/jbossws-integration.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/ws/integration/**"/>
+ <exclude name="org/jboss/ws/integration/tools/**"/>
</fileset>
</jar>
+
+ <!-- Build jbossws-integration.jar -->
+ <mkdir dir="${core.output.lib.dir}"/>
+ <jar jarfile="${core.output.lib.dir}/jbossws-integration-tools.jar" manifest="${build.etc.dir}/default.mf">
+ <fileset dir="${core.output.classes.dir}">
+ <include name="org/jboss/ws/integration/tools/**"/>
+ </fileset>
+ </jar>
<!-- Build jbossws-client.jar -->
<jar jarfile="${core.output.lib.dir}/jbossws-client.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/ws/**"/>
+ <exclude name="org/jboss/ws/integration/tools/**"/>
</fileset>
<fileset dir="${core.resources.dir}/jbossws.sar">
<include name="META-INF/standard-jaxrpc-client-config.xml"/>
@@ -202,6 +212,7 @@
<group title="Core" packages="org.jboss.ws.core*"/>
<group title="Metadata" packages="org.jboss.ws.metadata*"/>
<group title="Integration" packages="org.jboss.ws.integration*"/>
+ <group title="JAXWS Tools" packages="org.jboss.ws.integration.tools*"/>
<group title="Extensions" packages="org.jboss.ws.extensions*"/>
<group title="Tools" packages="org.jboss.ws.tools*"/>
</javadoc>
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools)
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws)
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant)
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,308 +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.tools.jaxws.ant;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tools.ant.AntClassLoader;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.ExecuteJava;
-import org.apache.tools.ant.taskdefs.LogOutputStream;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.CommandlineJava;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.Path;
-import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
-
-/**
- * Ant task which consumes a Web Service contract.
- *
- * <table border="1">
- * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
- * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
- * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
- * <tr><td>catalog</td><td> Oasis XML Catalog file for entity resolution</td><td>none</td></tr>
- * <tr><td>package</td><td> The target Java package for generated code.</td><td>generated</td></tr>
- * <tr><td>binding</td><td>A JAX-WS or JAXB binding file</td><td>none</td></tr>
- * <tr><td>wsdlLocation</td><td>Value to use for @(a)WebService.wsdlLocation</td><td>generated</td></tr>
- * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
- * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
- * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
- * <tr><td>wsdl*</td><td>The WSDL file or URL</td><td>n/a</td><tr>
- * </table>
- * <b>* = required.</b>
- *
- * <p>Example:
- *
- * <pre>
- * <wsconsume
- * fork="true"
- * verbose="true"
- * destdir="output"
- * sourcedestdir="gen-src"
- * keep="true"
- * wsdllocation="handEdited.wsdl"
- * wsdl="foo.wsdl">
- * <binding dir="binding-files" includes="*.xml" excludes="bad.xml"/>
- * </wsimport>
- * </pre>
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class wsconsume extends Task
-{
- private CommandlineJava command = new CommandlineJava();
- private String wsdl = null;
- private File destdir = null;
- private File sourcedestdir = null;
- private List<File> bindingFiles = new ArrayList<File>();
- private File catalog = null;
- private String wsdlLocation = null;
- private String targetPackage = null;
- private boolean keep = false;
- private boolean verbose = false;
- private boolean fork = false;
- private boolean debug = false;
-
- // Not actually used right now
- public void setDebug(boolean debug)
- {
- this.debug = debug;
- }
-
- public Commandline.Argument createJvmarg()
- {
- return command.createVmArgument();
- }
-
- public void setBinding(File bindingFile)
- {
- bindingFiles.add(bindingFile);
- }
-
- public void setCatalog(File catalog)
- {
- this.catalog = catalog;
- }
-
- public void setDestdir(File destdir)
- {
- this.destdir = destdir;
- }
-
- public void setFork(boolean fork)
- {
- this.fork = fork;
- }
-
- public void setKeep(boolean keep)
- {
- this.keep = keep;
- }
-
- public void setSourcedestdir(File sourcedestdir)
- {
- this.sourcedestdir = sourcedestdir;
- }
-
- public void setPackage(String targetPackage)
- {
- this.targetPackage = targetPackage;
- }
-
- public void setVerbose(boolean verbose)
- {
- this.verbose = verbose;
- }
-
- public void setWsdl(String wsdl)
- {
- this.wsdl = wsdl;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- this.wsdlLocation = wsdlLocation;
- }
-
- public void addConfiguredBinding(FileSet fs)
- {
- DirectoryScanner ds = fs.getDirectoryScanner(getProject());
- File baseDir = ds.getBasedir();
- for (String file : ds.getIncludedFiles())
- {
- bindingFiles.add(new File(baseDir, file));
- }
- }
-
- public void executeNonForked()
- {
- ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
- ClassLoader antLoader = this.getClass().getClassLoader();
- Thread.currentThread().setContextClassLoader(antLoader);
- try
- {
- WSContractConsumer importer = WSContractConsumer.newInstance();
- importer.setGenerateSource(keep);
- if (destdir != null)
- importer.setOutputDirectory(destdir);
- if (sourcedestdir != null)
- importer.setSourceDirectory(sourcedestdir);
- if (targetPackage != null)
- importer.setTargetPackage(targetPackage);
- if (wsdlLocation != null)
- importer.setWsdlLocation(wsdlLocation);
- if (catalog != null)
- importer.setCatalog(catalog);
- if (bindingFiles != null && bindingFiles.size() > 0)
- importer.setBindingFiles(bindingFiles);
-
- if (verbose)
- {
- importer.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
- log("Generating from wsdl: " + wsdl, Project.MSG_INFO);
- }
-
- try
- {
- importer.setAdditionalCompilerClassPath(getTaskClassPathStrings());
- importer.consume(wsdl);
- }
- catch (MalformedURLException e)
- {
- throw new BuildException(e, getLocation());
- }
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevCL);
- }
- }
-
- public void execute() throws BuildException
- {
- if (wsdl == null)
- throw new BuildException("The wsdl attribute must be specified!", getLocation());
-
- if (fork)
- executeForked();
- else
- executeNonForked();
- }
-
- private Path getTaskClassPath()
- {
- // Why is everything in the Ant API a big hack???
- ClassLoader cl = this.getClass().getClassLoader();
- if (cl instanceof AntClassLoader)
- {
- return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
- }
-
- return new Path(getProject());
- }
-
- private List<String> getTaskClassPathStrings()
- {
- // Why is everything in the Ant API a big hack???
- List<String> strings = new ArrayList<String>();
- ClassLoader cl = this.getClass().getClassLoader();
- if (cl instanceof AntClassLoader)
- {
- for (String string : ((AntClassLoader)cl).getClasspath().split(File.pathSeparator))
- strings.add(string);
- }
-
- return strings;
- }
-
- private void executeForked() throws BuildException
- {
- command.setClassname(org.jboss.ws.integration.tools.jaxws.command.wsconsume.class.getName());
-
- Path path = command.createClasspath(getProject());
- path.append(getTaskClassPath());
-
- if (keep)
- command.createArgument().setValue("-k");
-
- for (File file : bindingFiles)
- {
- command.createArgument().setValue("-b");
- command.createArgument().setFile(file);
- }
-
- if (catalog != null)
- {
- command.createArgument().setValue("-c");
- command.createArgument().setFile(catalog);
- }
-
- if (targetPackage != null)
- {
- command.createArgument().setValue("-p");
- command.createArgument().setValue(targetPackage);
- }
-
- if (wsdlLocation != null)
- {
- command.createArgument().setValue("-w");
- command.createArgument().setValue(wsdlLocation);
- }
-
- if (destdir != null)
- {
- command.createArgument().setValue("-o");
- command.createArgument().setFile(destdir);
- }
-
- if (sourcedestdir != null)
- {
- command.createArgument().setValue("-s");
- command.createArgument().setFile(sourcedestdir);
- }
-
- if (!verbose)
- command.createArgument().setValue("-q");
-
- // Always dump traces
- command.createArgument().setValue("-t");
- command.createArgument().setValue(wsdl);
-
- if (verbose)
- log("Command invoked: " + command.getJavaCommand().toString());
-
- ExecuteJava execute = new ExecuteJava();
- execute.setClasspath(path);
- execute.setJavaCommand(command.getJavaCommand());
- if (execute.fork(this) != 0)
- throw new BuildException("Could not invoke wsconsume", getLocation());
- }
-}
\ No newline at end of file
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,308 @@
+/*
+* 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.tools.jaxws.ant;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+
+/**
+ * Ant task which consumes a Web Service contract.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
+ * <tr><td>catalog</td><td> Oasis XML Catalog file for entity resolution</td><td>none</td></tr>
+ * <tr><td>package</td><td> The target Java package for generated code.</td><td>generated</td></tr>
+ * <tr><td>binding</td><td>A JAX-WS or JAXB binding file</td><td>none</td></tr>
+ * <tr><td>wsdlLocation</td><td>Value to use for @(a)WebService.wsdlLocation</td><td>generated</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
+ * <tr><td>wsdl*</td><td>The WSDL file or URL</td><td>n/a</td><tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <wsconsume
+ * fork="true"
+ * verbose="true"
+ * destdir="output"
+ * sourcedestdir="gen-src"
+ * keep="true"
+ * wsdllocation="handEdited.wsdl"
+ * wsdl="foo.wsdl">
+ * <binding dir="binding-files" includes="*.xml" excludes="bad.xml"/>
+ * </wsimport>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsconsume extends Task
+{
+ private CommandlineJava command = new CommandlineJava();
+ private String wsdl = null;
+ private File destdir = null;
+ private File sourcedestdir = null;
+ private List<File> bindingFiles = new ArrayList<File>();
+ private File catalog = null;
+ private String wsdlLocation = null;
+ private String targetPackage = null;
+ private boolean keep = false;
+ private boolean verbose = false;
+ private boolean fork = false;
+ private boolean debug = false;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setBinding(File bindingFile)
+ {
+ bindingFiles.add(bindingFile);
+ }
+
+ public void setCatalog(File catalog)
+ {
+ this.catalog = catalog;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setPackage(String targetPackage)
+ {
+ this.targetPackage = targetPackage;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setWsdl(String wsdl)
+ {
+ this.wsdl = wsdl;
+ }
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void addConfiguredBinding(FileSet fs)
+ {
+ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+ File baseDir = ds.getBasedir();
+ for (String file : ds.getIncludedFiles())
+ {
+ bindingFiles.add(new File(baseDir, file));
+ }
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader antLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(antLoader);
+ try
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ importer.setGenerateSource(keep);
+ if (destdir != null)
+ importer.setOutputDirectory(destdir);
+ if (sourcedestdir != null)
+ importer.setSourceDirectory(sourcedestdir);
+ if (targetPackage != null)
+ importer.setTargetPackage(targetPackage);
+ if (wsdlLocation != null)
+ importer.setWsdlLocation(wsdlLocation);
+ if (catalog != null)
+ importer.setCatalog(catalog);
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ importer.setBindingFiles(bindingFiles);
+
+ if (verbose)
+ {
+ importer.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
+ log("Generating from wsdl: " + wsdl, Project.MSG_INFO);
+ }
+
+ try
+ {
+ importer.setAdditionalCompilerClassPath(getTaskClassPathStrings());
+ importer.consume(wsdl);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new BuildException(e, getLocation());
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (wsdl == null)
+ throw new BuildException("The wsdl attribute must be specified!", getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private List<String> getTaskClassPathStrings()
+ {
+ // Why is everything in the Ant API a big hack???
+ List<String> strings = new ArrayList<String>();
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ for (String string : ((AntClassLoader)cl).getClasspath().split(File.pathSeparator))
+ strings.add(string);
+ }
+
+ return strings;
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.ws.integration.tools.jaxws.command.wsconsume.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ for (File file : bindingFiles)
+ {
+ command.createArgument().setValue("-b");
+ command.createArgument().setFile(file);
+ }
+
+ if (catalog != null)
+ {
+ command.createArgument().setValue("-c");
+ command.createArgument().setFile(catalog);
+ }
+
+ if (targetPackage != null)
+ {
+ command.createArgument().setValue("-p");
+ command.createArgument().setValue(targetPackage);
+ }
+
+ if (wsdlLocation != null)
+ {
+ command.createArgument().setValue("-w");
+ command.createArgument().setValue(wsdlLocation);
+ }
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(wsdl);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke wsconsume", getLocation());
+ }
+}
\ No newline at end of file
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,266 +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.tools.jaxws.ant;
-
-import java.io.File;
-import java.io.PrintStream;
-
-import org.apache.tools.ant.AntClassLoader;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.ExecuteJava;
-import org.apache.tools.ant.taskdefs.LogOutputStream;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.CommandlineJava;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Reference;
-import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
-
-/**
- * Ant task which invokes provides a Web Service contract and portable JAX-WS wrapper classes.
- *
- * <table border="1">
- * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
- * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
- * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
- * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
- * <tr><td>resourcedestdir</td><td>The output directory for resource artifacts (WSDL/XSD).</td><td>value of destdir</td></tr>
- * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
- * <tr><td>genwsdl</td><td>Whether or not to generate WSDL.</td><td>false</td><tr>
- * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
- * <tr><td>sei*</td><td>Service Endpoint Implementation.</td><td></td><tr>
- * <tr><td>classpath</td><td>The classpath that contains the service endpoint implementation.</td><td>""</tr>
- * </table>
- * <b>* = required.</b>
- *
- * <p>Example:
- *
- * <pre>
- * <target name="test-wsproivde" depends="init">
- * <taskdef name="wsprovide" classname="org.jboss.ws.integration.tools.jaxws.ant.wsprovide">
- * <classpath refid="core.classpath"/>
- * </taskdef>
- * <wsprovide
- * fork="false"
- * keep="true"
- * destdir="out"
- * resourcedestdir="out-resource"
- * sourcedestdir="out-source"
- * genwsdl="true"
- * verbose="true"
- * sei="org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrappedServiceImpl">
- * <classpath>
- * <pathelement path="${tests.output.dir}/classes"/>
- * </classpath>
- * </wsprovide>
- * </target>
- * </pre>
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class wsprovide extends Task
-{
- private Path classpath = new Path(getProject());
- private CommandlineJava command = new CommandlineJava();
- private String sei = null;
- private File destdir = null;
- private File resourcedestdir = null;
- private File sourcedestdir = null;
- private boolean keep = false;
- private boolean genwsdl = false;
- private boolean verbose = false;
- private boolean fork = false;
- private boolean debug = false;
-
- // Not actually used right now
- public void setDebug(boolean debug)
- {
- this.debug = debug;
- }
-
- public Commandline.Argument createJvmarg()
- {
- return command.createVmArgument();
- }
-
- public void setClasspath(Path classpath)
- {
- this.classpath = classpath;
- }
-
- public void setClasspathRef(Reference ref)
- {
- createClasspath().setRefid(ref);
- }
-
- public Path createClasspath()
- {
- return classpath;
- }
-
- public void setDestdir(File destdir)
- {
- this.destdir = destdir;
- }
-
- public void setKeep(boolean keep)
- {
- this.keep = keep;
- }
-
- public void setSei(String sei)
- {
- this.sei = sei;
- }
-
- public void setFork(boolean fork)
- {
- this.fork = fork;
- }
-
- public void setResourcedestdir(File resourcedestdir)
- {
- this.resourcedestdir = resourcedestdir;
- }
-
- public void setSourcedestdir(File sourcedestdir)
- {
- this.sourcedestdir = sourcedestdir;
- }
-
- public void setVerbose(boolean verbose)
- {
- this.verbose = verbose;
- }
-
- public void setGenwsdl(boolean genwsdl)
- {
- this.genwsdl = genwsdl;
- }
-
- private ClassLoader getClasspathLoader(ClassLoader parent)
- {
- return new AntClassLoader(parent, getProject(), classpath, false);
- }
-
- public void executeNonForked()
- {
- ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
- ClassLoader antLoader = this.getClass().getClassLoader();
- Thread.currentThread().setContextClassLoader(antLoader);
- try
- {
- WSContractProvider gen = WSContractProvider.newInstance();
- gen.setClassLoader(getClasspathLoader(antLoader));
- if (verbose)
- gen.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
- gen.setGenerateSource(keep);
- gen.setGenerateWsdl(genwsdl);
- if (destdir != null)
- gen.setOutputDirectory(destdir);
- if (resourcedestdir != null)
- gen.setResourceDirectory(resourcedestdir);
- if (sourcedestdir != null)
- gen.setSourceDirectory(sourcedestdir);
- if (verbose)
- log("Generating from endpoint: " + sei, Project.MSG_INFO);
-
- gen.provide(sei);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevCL);
- }
- }
-
- public void execute() throws BuildException
- {
- if (sei == null)
- throw new BuildException("The sei attribute must be specified!", getLocation());
-
- if (fork)
- executeForked();
- else
- executeNonForked();
- }
-
- private Path getTaskClassPath()
- {
- // Why is everything in the Ant API a big hack???
- ClassLoader cl = this.getClass().getClassLoader();
- if (cl instanceof AntClassLoader)
- {
- return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
- }
-
- return new Path(getProject());
- }
-
- private void executeForked() throws BuildException
- {
- command.setClassname(org.jboss.ws.integration.tools.jaxws.command.wsprovide.class.getName());
-
- Path path = command.createClasspath(getProject());
- path.append(getTaskClassPath());
- path.append(classpath);
-
- if (keep)
- command.createArgument().setValue("-k");
-
- if (genwsdl)
- command.createArgument().setValue("-w");
-
- if (destdir != null)
- {
- command.createArgument().setValue("-o");
- command.createArgument().setFile(destdir);
- }
- if (resourcedestdir != null)
- {
- command.createArgument().setValue("-r");
- command.createArgument().setFile(resourcedestdir);
- }
- if (sourcedestdir != null)
- {
- command.createArgument().setValue("-s");
- command.createArgument().setFile(sourcedestdir);
- }
-
- if (!verbose)
- command.createArgument().setValue("-q");
-
- // Always dump traces
- command.createArgument().setValue("-t");
- command.createArgument().setValue(sei);
-
- if (verbose)
- log("Command invoked: " + command.getJavaCommand().toString());
-
- ExecuteJava execute = new ExecuteJava();
- execute.setClasspath(path);
- execute.setJavaCommand(command.getJavaCommand());
- if (execute.fork(this) != 0)
- throw new BuildException("Could not invoke wsprovide", getLocation());
- }
-}
\ No newline at end of file
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,266 @@
+/*
+* 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.tools.jaxws.ant;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+
+/**
+ * Ant task which invokes provides a Web Service contract and portable JAX-WS wrapper classes.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
+ * <tr><td>resourcedestdir</td><td>The output directory for resource artifacts (WSDL/XSD).</td><td>value of destdir</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ * <tr><td>genwsdl</td><td>Whether or not to generate WSDL.</td><td>false</td><tr>
+ * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
+ * <tr><td>sei*</td><td>Service Endpoint Implementation.</td><td></td><tr>
+ * <tr><td>classpath</td><td>The classpath that contains the service endpoint implementation.</td><td>""</tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <target name="test-wsproivde" depends="init">
+ * <taskdef name="wsprovide" classname="org.jboss.ws.integration.tools.jaxws.ant.wsprovide">
+ * <classpath refid="core.classpath"/>
+ * </taskdef>
+ * <wsprovide
+ * fork="false"
+ * keep="true"
+ * destdir="out"
+ * resourcedestdir="out-resource"
+ * sourcedestdir="out-source"
+ * genwsdl="true"
+ * verbose="true"
+ * sei="org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrappedServiceImpl">
+ * <classpath>
+ * <pathelement path="${tests.output.dir}/classes"/>
+ * </classpath>
+ * </wsprovide>
+ * </target>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsprovide extends Task
+{
+ private Path classpath = new Path(getProject());
+ private CommandlineJava command = new CommandlineJava();
+ private String sei = null;
+ private File destdir = null;
+ private File resourcedestdir = null;
+ private File sourcedestdir = null;
+ private boolean keep = false;
+ private boolean genwsdl = false;
+ private boolean verbose = false;
+ private boolean fork = false;
+ private boolean debug = false;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setClasspath(Path classpath)
+ {
+ this.classpath = classpath;
+ }
+
+ public void setClasspathRef(Reference ref)
+ {
+ createClasspath().setRefid(ref);
+ }
+
+ public Path createClasspath()
+ {
+ return classpath;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSei(String sei)
+ {
+ this.sei = sei;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setResourcedestdir(File resourcedestdir)
+ {
+ this.resourcedestdir = resourcedestdir;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setGenwsdl(boolean genwsdl)
+ {
+ this.genwsdl = genwsdl;
+ }
+
+ private ClassLoader getClasspathLoader(ClassLoader parent)
+ {
+ return new AntClassLoader(parent, getProject(), classpath, false);
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader antLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(antLoader);
+ try
+ {
+ WSContractProvider gen = WSContractProvider.newInstance();
+ gen.setClassLoader(getClasspathLoader(antLoader));
+ if (verbose)
+ gen.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
+ gen.setGenerateSource(keep);
+ gen.setGenerateWsdl(genwsdl);
+ if (destdir != null)
+ gen.setOutputDirectory(destdir);
+ if (resourcedestdir != null)
+ gen.setResourceDirectory(resourcedestdir);
+ if (sourcedestdir != null)
+ gen.setSourceDirectory(sourcedestdir);
+ if (verbose)
+ log("Generating from endpoint: " + sei, Project.MSG_INFO);
+
+ gen.provide(sei);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (sei == null)
+ throw new BuildException("The sei attribute must be specified!", getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.ws.integration.tools.jaxws.command.wsprovide.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+ path.append(classpath);
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ if (genwsdl)
+ command.createArgument().setValue("-w");
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+ if (resourcedestdir != null)
+ {
+ command.createArgument().setValue("-r");
+ command.createArgument().setFile(resourcedestdir);
+ }
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(sei);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke wsprovide", getLocation());
+ }
+}
\ No newline at end of file
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api)
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,75 +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.tools.jaxws.api;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * Locates a provider.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- *
- */
-class Locator
-{
- static <T> T locate(Class<T> providerType, String providerProperty, String defaultProvider, ClassLoader loader)
- {
- String provider = null;
-
- try
- {
-
- PrivilegedAction action = new PropertyAccessAction(providerProperty);
- provider = (String)AccessController.doPrivileged(action);
- if (provider == null)
- provider = defaultProvider;
-
- Class<?> clazz = loader.loadClass(provider);
- return (T) clazz.newInstance();
- }
- catch (Throwable t)
- {
- if (provider == null)
- throw new IllegalStateException("Failure reading system property: " + providerProperty);
-
- throw new IllegalStateException("Could not load provider:" + provider);
- }
-
- }
-
- private static class PropertyAccessAction implements PrivilegedAction
- {
- private String name;
-
- PropertyAccessAction(String name)
- {
- this.name = name;
- }
-
- public Object run()
- {
- return System.getProperty(name);
- }
- }
-
-}
\ No newline at end of file
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,75 @@
+/*
+* 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.tools.jaxws.api;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Locates a provider.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ *
+ */
+class Locator
+{
+ static <T> T locate(Class<T> providerType, String providerProperty, String defaultProvider, ClassLoader loader)
+ {
+ String provider = null;
+
+ try
+ {
+
+ PrivilegedAction action = new PropertyAccessAction(providerProperty);
+ provider = (String)AccessController.doPrivileged(action);
+ if (provider == null)
+ provider = defaultProvider;
+
+ Class<?> clazz = loader.loadClass(provider);
+ return (T) clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ if (provider == null)
+ throw new IllegalStateException("Failure reading system property: " + providerProperty);
+
+ throw new IllegalStateException("Could not load provider:" + provider);
+ }
+
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+}
\ No newline at end of file
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,178 +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.tools.jaxws.api;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.ws.integration.tools.jaxws.spi.WSContractConsumerFactory;
-
-/**
- * WSContractConsumer is responsible for generating JAX-WS client and server
- * artifacts from the specified WSDL file. To implement a client, one would use
- * the generated ___Service.java file. For a server, one only needs to provide
- * an implementation class that implements the generated service endpoint
- * interface.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public abstract class WSContractConsumer
-{
- private static String DEFAULT_PROVIDER = "org.jboss.ws.integration.tools.jaxws.impl.SunRIConsumerFactoryImpl";
- public static final String PROVIDER_PROPERTY = "org.jboss.ws.tools.jaxws.SunRIConsumerFactoryImpl";
-
- /**
- * Obtain a new instance of a WSContractProvider. This will use the current
- * thread's context class loader to locate the WSContractProviderFactory
- * implementation.
- *
- * @return a new WSContractProvider
- */
- public static WSContractConsumer newInstance()
- {
- return newInstance(Thread.currentThread().getContextClassLoader());
- }
-
- /**
- * Obtain a new instance of a WSContractConsumer. The specified ClassLoader will be used to
- * locate the WebServiceImporterProvide implementation
- *
- * @param loader the ClassLoader to use
- * @return a new WSContractConsumer
- */
- public static WSContractConsumer newInstance(ClassLoader loader)
- {
- WSContractConsumerFactory provider = Locator.locate(WSContractConsumerFactory.class, PROVIDER_PROPERTY, DEFAULT_PROVIDER, loader);
- return provider.createConsumer();
- }
-
- /**
- * Specifies the JAX-WS and JAXB binding files to use on import operations.
- *
- * @param bindingFiles list of JAX-WS or JAXB binding files
- */
- public abstract void setBindingFiles(List<File> bindingFiles);
-
- /**
- * Sets the OASIS XML Catalog file to use for entity resolution.
- *
- * @param catalog the OASIS XML Catalog file
- */
- public abstract void setCatalog(File catalog);
-
- /**
- * Sets the main output directory. If the directory does not exist, it will be created.
- *
- * @param directory the root directory for generated files
- */
- public abstract void setOutputDirectory(File directory);
-
- /**
- * Sets the source directory. This directory will contain any generated Java source.
- * If the directory does not exist, it will be created. If not specified,
- * the output directory will be used instead.
- *
- * @param directory the root directory for generated source code
- */
- public abstract void setSourceDirectory(File directory);
-
- /**
- * Enables/Disables Java source generation.
- *
- * @param generateSource whether or not to generate Java source.
- */
- public abstract void setGenerateSource(boolean generateSource);
-
-
- /**
- * Sets the target package for generated source. If not specified the default
- * is based off of the XML namespace.
- *
- * @param targetPackage the target package for generated source
- */
- public abstract void setTargetPackage(String targetPackage);
-
- /**
- * Sets the @(a)WebService.wsdlLocation and @(a)WebServiceClient.wsdlLocation attributes to a custom value.
- *
- * @param wsdlLocation the custom WSDL location to use in generated source
- */
- public abstract void setWsdlLocation(String wsdlLocation);
-
- /**
- * Sets the PrintStream to use for status feedback. The simplest example
- * would be to use System.out.
- *
- * @param messageStream the stream to use for status messages:
- */
- public abstract void setMessageStream(PrintStream messageStream);
-
-
- /**
- * Sets the additional classpath to use if/when invoking the Java compiler.
- * Typically an implementation will use the system <code>java.class.path</code>
- * property. So for most normal applications this method is not needed. However,
- * if this API is being used from an isolated classloader, then it needs to
- * be called in order to reference all jars that are required by the
- * implementation.
- *
- * @param classPath a list of strings where each entry references a
- * single jar or directory
- */
- public abstract void setAdditionalCompilerClassPath(List<String> classPath);
-
- /**
- * Generate the required artifacts using the specified WSDL URL. This method
- * may be called more than once, although this is probably not desireable
- *
- * @param wsdl the URL of the WSDL
- */
- public abstract void consume(URL wsdl);
-
- /**
- * Generate the required artifacts using the specified WSDL. This method
- * may be called more than once, although this is probably not desireable.
- * The passed string is expect to either be a valid URL, or a local file path.
- *
- * @param wsdl a URL or local file path
- * @throws MalformedURLException if wsdl is not a legal URL or local file
- */
- public void consume(String wsdl) throws MalformedURLException
- {
- URL url = null;
- try
- {
- url = new URL(wsdl);
- }
- catch (MalformedURLException e)
- {
- File file = new File(wsdl);
- url = file.toURL();
- }
-
- consume(url);
- }
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,178 @@
+/*
+* 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.tools.jaxws.api;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.ws.integration.tools.jaxws.spi.WSContractConsumerFactory;
+
+/**
+ * WSContractConsumer is responsible for generating JAX-WS client and server
+ * artifacts from the specified WSDL file. To implement a client, one would use
+ * the generated ___Service.java file. For a server, one only needs to provide
+ * an implementation class that implements the generated service endpoint
+ * interface.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public abstract class WSContractConsumer
+{
+ private static String DEFAULT_PROVIDER = "org.jboss.ws.integration.tools.jaxws.impl.SunRIConsumerFactoryImpl";
+ public static final String PROVIDER_PROPERTY = "org.jboss.ws.tools.jaxws.SunRIConsumerFactoryImpl";
+
+ /**
+ * Obtain a new instance of a WSContractProvider. This will use the current
+ * thread's context class loader to locate the WSContractProviderFactory
+ * implementation.
+ *
+ * @return a new WSContractProvider
+ */
+ public static WSContractConsumer newInstance()
+ {
+ return newInstance(Thread.currentThread().getContextClassLoader());
+ }
+
+ /**
+ * Obtain a new instance of a WSContractConsumer. The specified ClassLoader will be used to
+ * locate the WebServiceImporterProvide implementation
+ *
+ * @param loader the ClassLoader to use
+ * @return a new WSContractConsumer
+ */
+ public static WSContractConsumer newInstance(ClassLoader loader)
+ {
+ WSContractConsumerFactory provider = Locator.locate(WSContractConsumerFactory.class, PROVIDER_PROPERTY, DEFAULT_PROVIDER, loader);
+ return provider.createConsumer();
+ }
+
+ /**
+ * Specifies the JAX-WS and JAXB binding files to use on import operations.
+ *
+ * @param bindingFiles list of JAX-WS or JAXB binding files
+ */
+ public abstract void setBindingFiles(List<File> bindingFiles);
+
+ /**
+ * Sets the OASIS XML Catalog file to use for entity resolution.
+ *
+ * @param catalog the OASIS XML Catalog file
+ */
+ public abstract void setCatalog(File catalog);
+
+ /**
+ * Sets the main output directory. If the directory does not exist, it will be created.
+ *
+ * @param directory the root directory for generated files
+ */
+ public abstract void setOutputDirectory(File directory);
+
+ /**
+ * Sets the source directory. This directory will contain any generated Java source.
+ * If the directory does not exist, it will be created. If not specified,
+ * the output directory will be used instead.
+ *
+ * @param directory the root directory for generated source code
+ */
+ public abstract void setSourceDirectory(File directory);
+
+ /**
+ * Enables/Disables Java source generation.
+ *
+ * @param generateSource whether or not to generate Java source.
+ */
+ public abstract void setGenerateSource(boolean generateSource);
+
+
+ /**
+ * Sets the target package for generated source. If not specified the default
+ * is based off of the XML namespace.
+ *
+ * @param targetPackage the target package for generated source
+ */
+ public abstract void setTargetPackage(String targetPackage);
+
+ /**
+ * Sets the @(a)WebService.wsdlLocation and @(a)WebServiceClient.wsdlLocation attributes to a custom value.
+ *
+ * @param wsdlLocation the custom WSDL location to use in generated source
+ */
+ public abstract void setWsdlLocation(String wsdlLocation);
+
+ /**
+ * Sets the PrintStream to use for status feedback. The simplest example
+ * would be to use System.out.
+ *
+ * @param messageStream the stream to use for status messages:
+ */
+ public abstract void setMessageStream(PrintStream messageStream);
+
+
+ /**
+ * Sets the additional classpath to use if/when invoking the Java compiler.
+ * Typically an implementation will use the system <code>java.class.path</code>
+ * property. So for most normal applications this method is not needed. However,
+ * if this API is being used from an isolated classloader, then it needs to
+ * be called in order to reference all jars that are required by the
+ * implementation.
+ *
+ * @param classPath a list of strings where each entry references a
+ * single jar or directory
+ */
+ public abstract void setAdditionalCompilerClassPath(List<String> classPath);
+
+ /**
+ * Generate the required artifacts using the specified WSDL URL. This method
+ * may be called more than once, although this is probably not desireable
+ *
+ * @param wsdl the URL of the WSDL
+ */
+ public abstract void consume(URL wsdl);
+
+ /**
+ * Generate the required artifacts using the specified WSDL. This method
+ * may be called more than once, although this is probably not desireable.
+ * The passed string is expect to either be a valid URL, or a local file path.
+ *
+ * @param wsdl a URL or local file path
+ * @throws MalformedURLException if wsdl is not a legal URL or local file
+ */
+ public void consume(String wsdl) throws MalformedURLException
+ {
+ URL url = null;
+ try
+ {
+ url = new URL(wsdl);
+ }
+ catch (MalformedURLException e)
+ {
+ File file = new File(wsdl);
+ url = file.toURL();
+ }
+
+ consume(url);
+ }
+}
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,150 +0,0 @@
-package org.jboss.ws.integration.tools.jaxws.api;
-
-import java.io.File;
-import java.io.PrintStream;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.integration.tools.jaxws.spi.WSContractProviderFactory;
-
-
-/**
- * WSContractProvider is responsible for generating the required portable
- * JAX-WS artifacts for a service endpoint implementation. This includes class
- * files for wrapper types and fault beans. WSDL may be optionally generated as
- * well using this API.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- *
- * <p>The following example generates class files, source files and WSDL for an
- * endpoint:</p>
- * <pre>
- * WSContractProvider provider = WSContractProvider.newInstance();
- * provider.setGenerateSource(true);
- * provider.setGenerateWsdl(true);
- * provider.setOutputDirectory(new File("output"));
- * provider.setMessageStream(System.out);
- * provider.provide(TestMe.class);
- * </pre>
- *
- * <p>Thread-Safety:</p>
- * This class expects to be thread-confined, so it can not be shared between threads.
- */
-public abstract class WSContractProvider
-{
- private static String DEFAULT_PROVIDER = "org.jboss.ws.integration.tools.jaxws.impl.JBossWSProviderFactoryImpl";
- public static final String PROVIDER_PROPERTY = "org.jboss.ws.tools.jaxws.JBossWSProviderFactoryImpl";
-
- protected WSContractProvider()
- {
-
- }
-
- /**
- * Obtain a new instance of a WSContractProvider. This will use the current
- * thread's context class loader to locate the WSContractProviderFactory
- * implementation.
- *
- * @return a new WSContractProvider
- */
- public static WSContractProvider newInstance()
- {
- return newInstance(Thread.currentThread().getContextClassLoader());
- }
-
- /**
- * Obtain a new instance of a WSContractProvider. The specified ClassLoader will be used to
- * locate the WSContractProviderFactory implementation
- *
- * @param loader the ClassLoader to use
- * @return a new WSContractProvider
- */
- public static WSContractProvider newInstance(ClassLoader loader)
- {
- WSContractProviderFactory provider = Locator.locate(WSContractProviderFactory.class, PROVIDER_PROPERTY, DEFAULT_PROVIDER, loader);
- return provider.createProvider(loader);
- }
-
- /**
- * Enables/Disables WSDL generation.
- *
- * @param generateWsdl whether or not to generate WSDL
- */
- public abstract void setGenerateWsdl(boolean generateWsdl);
-
- /**
- * Enables/Disables Java source generation.
- *
- * @param generateSource whether or not to generate Java source.
- */
- public abstract void setGenerateSource(boolean generateSource);
-
- /**
- * Sets the main output directory. If the directory does not exist, it will be created.
- *
- * @param directory the root directory for generated files
- */
- public abstract void setOutputDirectory(File directory);
-
- /**
- * Sets the resource directory. This directory will contain any generated
- * WSDL and XSD files. If the directory does not exist, it will be created.
- * If not specified, the output directory will be used instead.
- *
- * @param directory the root directory for generated resource files
- */
- public abstract void setResourceDirectory(File directory);
-
- /**
- * Sets the source directory. This directory will contain any generated Java source.
- * If the directory does not exist, it will be created. If not specified,
- * the output directory will be used instead.
- *
- * @param directory the root directory for generated source code
- */
- public abstract void setSourceDirectory(File directory);
-
- /**
- * Sets the ClassLoader used to discover types. This defaults to the one used
- * in instantiation.
- *
- * @param loader the ClassLoader to use
- */
- public abstract void setClassLoader(ClassLoader loader);
-
- /**
- * Generates artifacts using the current settings. This method may be invoked
- * more than once (e.g. multiple endpoints).
- *
- * @param endpointClass the name of the endpoint implementation bean
- * @throws WSException if any error occurs during processing, or the class is not found
- */
- public abstract void provide(String endpointClass);
-
- /**
- * Generates artifacts using the current settings. This method may be invoked
- * more than once (e.g. multiple endpoints).
- *
- * @param endpointClass the endpoint implementation bean
- * @throws WSException if any error occurs during processing
- */
- public abstract void provide(Class<?> endpointClass);
-
- /**
- * Sets the PrintStream to use for status feedback. The simplest example
- * would be to use System.out.
- *
- * <p>Example output:</p>
- * <pre>
- * Generating WSDL:
- * TestMeService.wsdl
- * Writing Source:
- * org/jboss/ws/tools/jaxws/TestMe.java
- * org/jboss/ws/tools/jaxws/TestMeResponse.java
- * Writing Classes:
- * org/jboss/ws/tools/jaxws/TestMe.class
- * org/jboss/ws/tools/jaxws/TestMeResponse.class
- * </pre>
- * @param messageStream the stream to use for status messages:
- */
- public abstract void setMessageStream(PrintStream messageStream);
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,150 @@
+package org.jboss.ws.integration.tools.jaxws.api;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.integration.tools.jaxws.spi.WSContractProviderFactory;
+
+
+/**
+ * WSContractProvider is responsible for generating the required portable
+ * JAX-WS artifacts for a service endpoint implementation. This includes class
+ * files for wrapper types and fault beans. WSDL may be optionally generated as
+ * well using this API.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ *
+ * <p>The following example generates class files, source files and WSDL for an
+ * endpoint:</p>
+ * <pre>
+ * WSContractProvider provider = WSContractProvider.newInstance();
+ * provider.setGenerateSource(true);
+ * provider.setGenerateWsdl(true);
+ * provider.setOutputDirectory(new File("output"));
+ * provider.setMessageStream(System.out);
+ * provider.provide(TestMe.class);
+ * </pre>
+ *
+ * <p>Thread-Safety:</p>
+ * This class expects to be thread-confined, so it can not be shared between threads.
+ */
+public abstract class WSContractProvider
+{
+ private static String DEFAULT_PROVIDER = "org.jboss.ws.integration.tools.jaxws.impl.JBossWSProviderFactoryImpl";
+ public static final String PROVIDER_PROPERTY = "org.jboss.ws.tools.jaxws.JBossWSProviderFactoryImpl";
+
+ protected WSContractProvider()
+ {
+
+ }
+
+ /**
+ * Obtain a new instance of a WSContractProvider. This will use the current
+ * thread's context class loader to locate the WSContractProviderFactory
+ * implementation.
+ *
+ * @return a new WSContractProvider
+ */
+ public static WSContractProvider newInstance()
+ {
+ return newInstance(Thread.currentThread().getContextClassLoader());
+ }
+
+ /**
+ * Obtain a new instance of a WSContractProvider. The specified ClassLoader will be used to
+ * locate the WSContractProviderFactory implementation
+ *
+ * @param loader the ClassLoader to use
+ * @return a new WSContractProvider
+ */
+ public static WSContractProvider newInstance(ClassLoader loader)
+ {
+ WSContractProviderFactory provider = Locator.locate(WSContractProviderFactory.class, PROVIDER_PROPERTY, DEFAULT_PROVIDER, loader);
+ return provider.createProvider(loader);
+ }
+
+ /**
+ * Enables/Disables WSDL generation.
+ *
+ * @param generateWsdl whether or not to generate WSDL
+ */
+ public abstract void setGenerateWsdl(boolean generateWsdl);
+
+ /**
+ * Enables/Disables Java source generation.
+ *
+ * @param generateSource whether or not to generate Java source.
+ */
+ public abstract void setGenerateSource(boolean generateSource);
+
+ /**
+ * Sets the main output directory. If the directory does not exist, it will be created.
+ *
+ * @param directory the root directory for generated files
+ */
+ public abstract void setOutputDirectory(File directory);
+
+ /**
+ * Sets the resource directory. This directory will contain any generated
+ * WSDL and XSD files. If the directory does not exist, it will be created.
+ * If not specified, the output directory will be used instead.
+ *
+ * @param directory the root directory for generated resource files
+ */
+ public abstract void setResourceDirectory(File directory);
+
+ /**
+ * Sets the source directory. This directory will contain any generated Java source.
+ * If the directory does not exist, it will be created. If not specified,
+ * the output directory will be used instead.
+ *
+ * @param directory the root directory for generated source code
+ */
+ public abstract void setSourceDirectory(File directory);
+
+ /**
+ * Sets the ClassLoader used to discover types. This defaults to the one used
+ * in instantiation.
+ *
+ * @param loader the ClassLoader to use
+ */
+ public abstract void setClassLoader(ClassLoader loader);
+
+ /**
+ * Generates artifacts using the current settings. This method may be invoked
+ * more than once (e.g. multiple endpoints).
+ *
+ * @param endpointClass the name of the endpoint implementation bean
+ * @throws WSException if any error occurs during processing, or the class is not found
+ */
+ public abstract void provide(String endpointClass);
+
+ /**
+ * Generates artifacts using the current settings. This method may be invoked
+ * more than once (e.g. multiple endpoints).
+ *
+ * @param endpointClass the endpoint implementation bean
+ * @throws WSException if any error occurs during processing
+ */
+ public abstract void provide(Class<?> endpointClass);
+
+ /**
+ * Sets the PrintStream to use for status feedback. The simplest example
+ * would be to use System.out.
+ *
+ * <p>Example output:</p>
+ * <pre>
+ * Generating WSDL:
+ * TestMeService.wsdl
+ * Writing Source:
+ * org/jboss/ws/tools/jaxws/TestMe.java
+ * org/jboss/ws/tools/jaxws/TestMeResponse.java
+ * Writing Classes:
+ * org/jboss/ws/tools/jaxws/TestMe.class
+ * org/jboss/ws/tools/jaxws/TestMeResponse.class
+ * </pre>
+ * @param messageStream the stream to use for status messages:
+ */
+ public abstract void setMessageStream(PrintStream messageStream);
+}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command)
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,234 +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.tools.jaxws.command;
-
-import gnu.getopt.Getopt;
-import gnu.getopt.LongOpt;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
-
-/**
- * wsconsume is a command line tool that generates portable JAX-WS artifacts
- * from a WSDL file.
- *
- * <pre>
- * usage: wsconsume [options] <wsdl-url>
- * options:
- * -h, --help Show this help message
- * -b, --binding=<file> One or more JAX-WS or JAXB binding files
- * -k, --keep Keep/Generate Java source
- * -c --catalog=<file> Oasis XML Catalog file for entity resolution
- * -p --package=<name> The target package for generated source
- * -w --wsdlLocation=<loc> Value to use for @(a)WebService.wsdlLocation
- * -o, --output=<directory> The directory to put generated artifacts
- * -s, --source=<directory> The directory to put Java source
- * -q, --quiet Be somewhat more quiet
- * -t, --show-traces Show full exception stack traces
- * </pre>
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class wsconsume
-{
- private List<File> bindingFiles = new ArrayList<File>();
- private boolean generateSource = false;
- private File catalog = null;
- private String targetPackage = null;
- private String wsdlLocation = null;
- private boolean quiet = false;
- private boolean showTraces = false;
- private File outputDir = new File("output");
- private File sourceDir = null;
-
- public static String PROGRAM_NAME = System.getProperty("program.name", wsconsume.class.getName());
-
- public static void main(String[] args)
- {
- wsconsume importer = new wsconsume();
- URL wsdl = importer.parseArguments(args);
- System.exit(importer.importServices(wsdl));
- }
-
- private URL parseArguments(String[] args)
- {
- String shortOpts = "hb:kc:p:w:o:s:qt";
- LongOpt[] longOpts =
- {
- new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
- new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
- new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
- new LongOpt("catalog", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
- new LongOpt("package", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
- new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
- new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
- new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
- new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
- new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
- };
-
- Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
- int c;
- while ((c = getopt.getopt()) != -1)
- {
- switch (c)
- {
- case 'b':
- bindingFiles.add(new File(getopt.getOptarg()));
- break;
- case 'k':
- generateSource = true;
- break;
- case 'c':
- catalog = new File(getopt.getOptarg());
- break;
- case 'p':
- targetPackage = getopt.getOptarg();
- break;
- case 'w':
- wsdlLocation = getopt.getOptarg();
- break;
- case 'o':
- outputDir = new File(getopt.getOptarg());
- break;
- case 's':
- sourceDir = new File(getopt.getOptarg());
- break;
- case 'q':
- quiet = true;
- break;
- case 't':
- showTraces = true;
- break;
- case 'h':
- printHelp();
- System.exit(0);
- case '?':
- System.exit(1);
- }
- }
-
- int wsdlPos = getopt.getOptind();
- if (wsdlPos >= args.length)
- {
- System.err.println("Error: WSDL URL was not specified!");
- printHelp();
- System.exit(1);
- }
-
- URL url = null;
- try
- {
- try
- {
- url = new URL(args[wsdlPos]);
- }
- catch (MalformedURLException e)
- {
- File file = new File(args[wsdlPos]);
- url = file.toURL();
- }
- }
- catch (MalformedURLException e)
- {
- System.err.println("Error: Invalid URI: " + args[wsdlPos]);
- System.exit(1);
- }
-
- return url;
- }
-
-
- private int importServices(URL wsdl)
- {
- WSContractConsumer importer = WSContractConsumer.newInstance();
- importer.setGenerateSource(generateSource);
- importer.setOutputDirectory(outputDir);
- if (sourceDir != null)
- importer.setSourceDirectory(sourceDir);
-
- if (! quiet)
- importer.setMessageStream(System.out);
-
- if (catalog != null)
- importer.setCatalog(catalog);
-
- if (targetPackage != null)
- importer.setTargetPackage(targetPackage);
-
- if (wsdlLocation != null)
- importer.setWsdlLocation(wsdlLocation);
-
- if (bindingFiles != null && bindingFiles.size() > 0)
- importer.setBindingFiles(bindingFiles);
-
- try
- {
- importer.consume(wsdl);
- return 0;
- }
- catch (Throwable t)
- {
- System.err.println("Error: Could not import. (use --show-traces to see full traces)");
- if (!showTraces)
- {
- String message = t.getMessage();
- if (message == null)
- message = t.getClass().getSimpleName();
- System.err.println("Error: " + message);
- }
- else
- {
- t.printStackTrace(System.err);
- }
-
- }
-
- return 1;
- }
-
- private static void printHelp()
- {
- PrintStream out = System.out;
- out.println("wsconsume is a command line tool that generates portable JAX-WS artifacts from a WSDL file.\n");
- out.println("usage: " + PROGRAM_NAME + " [options] <wsdl-url>\n");
- out.println("options: ");
- out.println(" -h, --help Show this help message");
- out.println(" -b, --binding=<file> One or more JAX-WS or JAXB binding files ");
- out.println(" -k, --keep Keep/Generate Java source");
- out.println(" -c --catalog=<file> Oasis XML Catalog file for entity resolution");
- out.println(" -p --package=<name> The target package for generated source");
- out.println(" -w --wsdlLocation=<loc> Value to use for @WebService.wsdlLocation");
- out.println(" -o, --output=<directory> The directory to put generated artifacts");
- out.println(" -s, --source=<directory> The directory to put Java source");
- out.println(" -q, --quiet Be somewhat more quiet");
- out.println(" -t, --show-traces Show full exception stack traces");
- out.flush();
- }
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,234 @@
+/*
+ * 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.tools.jaxws.command;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+
+/**
+ * wsconsume is a command line tool that generates portable JAX-WS artifacts
+ * from a WSDL file.
+ *
+ * <pre>
+ * usage: wsconsume [options] <wsdl-url>
+ * options:
+ * -h, --help Show this help message
+ * -b, --binding=<file> One or more JAX-WS or JAXB binding files
+ * -k, --keep Keep/Generate Java source
+ * -c --catalog=<file> Oasis XML Catalog file for entity resolution
+ * -p --package=<name> The target package for generated source
+ * -w --wsdlLocation=<loc> Value to use for @(a)WebService.wsdlLocation
+ * -o, --output=<directory> The directory to put generated artifacts
+ * -s, --source=<directory> The directory to put Java source
+ * -q, --quiet Be somewhat more quiet
+ * -t, --show-traces Show full exception stack traces
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsconsume
+{
+ private List<File> bindingFiles = new ArrayList<File>();
+ private boolean generateSource = false;
+ private File catalog = null;
+ private String targetPackage = null;
+ private String wsdlLocation = null;
+ private boolean quiet = false;
+ private boolean showTraces = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+
+ public static String PROGRAM_NAME = System.getProperty("program.name", wsconsume.class.getName());
+
+ public static void main(String[] args)
+ {
+ wsconsume importer = new wsconsume();
+ URL wsdl = importer.parseArguments(args);
+ System.exit(importer.importServices(wsdl));
+ }
+
+ private URL parseArguments(String[] args)
+ {
+ String shortOpts = "hb:kc:p:w:o:s:qt";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("catalog", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("package", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
+ new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'b':
+ bindingFiles.add(new File(getopt.getOptarg()));
+ break;
+ case 'k':
+ generateSource = true;
+ break;
+ case 'c':
+ catalog = new File(getopt.getOptarg());
+ break;
+ case 'p':
+ targetPackage = getopt.getOptarg();
+ break;
+ case 'w':
+ wsdlLocation = getopt.getOptarg();
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ int wsdlPos = getopt.getOptind();
+ if (wsdlPos >= args.length)
+ {
+ System.err.println("Error: WSDL URL was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ URL url = null;
+ try
+ {
+ try
+ {
+ url = new URL(args[wsdlPos]);
+ }
+ catch (MalformedURLException e)
+ {
+ File file = new File(args[wsdlPos]);
+ url = file.toURL();
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: Invalid URI: " + args[wsdlPos]);
+ System.exit(1);
+ }
+
+ return url;
+ }
+
+
+ private int importServices(URL wsdl)
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ importer.setGenerateSource(generateSource);
+ importer.setOutputDirectory(outputDir);
+ if (sourceDir != null)
+ importer.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ importer.setMessageStream(System.out);
+
+ if (catalog != null)
+ importer.setCatalog(catalog);
+
+ if (targetPackage != null)
+ importer.setTargetPackage(targetPackage);
+
+ if (wsdlLocation != null)
+ importer.setWsdlLocation(wsdlLocation);
+
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ importer.setBindingFiles(bindingFiles);
+
+ try
+ {
+ importer.consume(wsdl);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not import. (use --show-traces to see full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("wsconsume is a command line tool that generates portable JAX-WS artifacts from a WSDL file.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <wsdl-url>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -b, --binding=<file> One or more JAX-WS or JAXB binding files ");
+ out.println(" -k, --keep Keep/Generate Java source");
+ out.println(" -c --catalog=<file> Oasis XML Catalog file for entity resolution");
+ out.println(" -p --package=<name> The target package for generated source");
+ out.println(" -w --wsdlLocation=<loc> Value to use for @WebService.wsdlLocation");
+ out.println(" -o, --output=<directory> The directory to put generated artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java source");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack traces");
+ out.flush();
+ }
+}
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,225 +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.tools.jaxws.command;
-
-import gnu.getopt.Getopt;
-import gnu.getopt.LongOpt;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
-
-/**
- * wsprovide is a command line tool that generates portable JAX-WS artifacts
- * for a service endpoint implementation.
- *
- * <pre>
- * usage: wsprovide [options] <endpoint class name>
- * options:
- * -h, --help Show this help message
- * -k, --keep Keep/Generate Java source
- * -w, --wsdl Enable WSDL file generation
- * -c. --classpath=<path< The classpath that contains the endpoint
- * -o, --output=<directory> The directory to put generated artifacts
- * -r, --resource=<directory> The directory to put resource artifacts
- * -s, --source=<directory> The directory to put Java source
- * -q, --quiet Be somewhat more quiet
- * -t, --show-traces Show full exception stack traces
- * </pre>
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class wsprovide
-{
- private boolean generateSource = false;
- private boolean generateWsdl = false;
- private boolean quiet = false;
- private boolean showTraces = false;
- private ClassLoader loader = Thread.currentThread().getContextClassLoader();
- private File outputDir = new File("output");
- private File resourceDir = null;
- private File sourceDir = null;
-
- public static String PROGRAM_NAME = System.getProperty("program.name", wsprovide.class.getSimpleName());
-
- public static void main(String[] args)
- {
- wsprovide generate = new wsprovide();
- String endpoint = generate.parseArguments(args);
- System.exit(generate.generate(endpoint));
- }
-
- private String parseArguments(String[] args)
- {
- String shortOpts = "hwko:r:s:c:qt";
- LongOpt[] longOpts =
- {
- new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
- new LongOpt("wsdl", LongOpt.NO_ARGUMENT, null, 'w'),
- new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
- new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
- new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
- new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
- new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
- new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
- new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
- };
-
- Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
- int c;
- while ((c = getopt.getopt()) != -1)
- {
- switch (c)
- {
- case 'k':
- generateSource = true;
- break;
- case 's':
- sourceDir = new File(getopt.getOptarg());
- break;
- case 'r':
- resourceDir = new File(getopt.getOptarg());
- break;
- case 'w':
- generateWsdl = true;
- break;
- case 't':
- showTraces = true;
- break;
- case 'o':
- outputDir = new File(getopt.getOptarg());
- break;
- case 'q':
- quiet = true;
- break;
- case 'c':
- processClassPath(getopt.getOptarg());
- break;
- case 'h':
- printHelp();
- System.exit(0);
- case '?':
- System.exit(1);
- }
- }
-
- int endpointPos = getopt.getOptind();
- if (endpointPos >= args.length)
- {
- System.err.println("Error: endpoint implementation was not specified!");
- printHelp();
- System.exit(1);
- }
-
- return args[endpointPos];
- }
-
-
- private int generate(String endpoint)
- {
- if (!JavaUtils.isLoaded(endpoint, loader))
- {
- System.err.println("Error: Could not load class [" + endpoint + "]. Did you specify a valid --classpath?");
- return 1;
- }
-
- WSContractProvider gen = WSContractProvider.newInstance(loader);
- gen.setGenerateWsdl(generateWsdl);
- gen.setGenerateSource(generateSource);
- gen.setOutputDirectory(outputDir);
- if (resourceDir != null)
- gen.setResourceDirectory(resourceDir);
- if (sourceDir != null)
- gen.setSourceDirectory(sourceDir);
-
- if (! quiet)
- gen.setMessageStream(System.out);
-
- try
- {
- gen.provide(endpoint);
- return 0;
- }
- catch (Throwable t)
- {
- System.err.println("Error: Could not generate. (use --show-traces to see full traces)");
- if (!showTraces)
- {
- String message = t.getMessage();
- if (message == null)
- message = t.getClass().getSimpleName();
- System.err.println("Error: " + message);
- }
- else
- {
- t.printStackTrace(System.err);
- }
-
- }
-
- return 1;
- }
-
- private void processClassPath(String classPath)
- {
- String[] entries = classPath.split(File.pathSeparator);
- List<URL> urls= new ArrayList<URL>(entries.length);
- for (String entry : entries)
- {
- try
- {
- urls.add(new File(entry).toURL());
- }
- catch (MalformedURLException e)
- {
- System.err.println("Error: a classpath entry was malformed: " + entry);
- }
- }
- loader = new URLClassLoader(urls.toArray(new URL[0]), loader);
- }
-
- private static void printHelp()
- {
- PrintStream out = System.out;
- out.println("wsprovide generates portable JAX-WS artifacts for an endpoint implementation.\n");
- out.println("usage: " + PROGRAM_NAME + " [options] <endpoint class name>\n");
- out.println("options: ");
- out.println(" -h, --help Show this help message");
- out.println(" -k, --keep Keep/Generate Java source");
- out.println(" -w, --wsdl Enable WSDL file generation");
- out.println(" -c. --classpath=<path> The classpath that contains the endpoint");
- out.println(" -o, --output=<directory> The directory to put generated artifacts");
- out.println(" -r, --resource=<directory> The directory to put resource artifacts");
- out.println(" -s, --source=<directory> The directory to put Java source");
- out.println(" -q, --quiet Be somewhat more quiet");
- out.println(" -t, --show-traces Show full exception stack traces");
- out.flush();
- }
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,225 @@
+/*
+ * 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.tools.jaxws.command;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+
+/**
+ * wsprovide is a command line tool that generates portable JAX-WS artifacts
+ * for a service endpoint implementation.
+ *
+ * <pre>
+ * usage: wsprovide [options] <endpoint class name>
+ * options:
+ * -h, --help Show this help message
+ * -k, --keep Keep/Generate Java source
+ * -w, --wsdl Enable WSDL file generation
+ * -c. --classpath=<path< The classpath that contains the endpoint
+ * -o, --output=<directory> The directory to put generated artifacts
+ * -r, --resource=<directory> The directory to put resource artifacts
+ * -s, --source=<directory> The directory to put Java source
+ * -q, --quiet Be somewhat more quiet
+ * -t, --show-traces Show full exception stack traces
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsprovide
+{
+ private boolean generateSource = false;
+ private boolean generateWsdl = false;
+ private boolean quiet = false;
+ private boolean showTraces = false;
+ private ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ private File outputDir = new File("output");
+ private File resourceDir = null;
+ private File sourceDir = null;
+
+ public static String PROGRAM_NAME = System.getProperty("program.name", wsprovide.class.getSimpleName());
+
+ public static void main(String[] args)
+ {
+ wsprovide generate = new wsprovide();
+ String endpoint = generate.parseArguments(args);
+ System.exit(generate.generate(endpoint));
+ }
+
+ private String parseArguments(String[] args)
+ {
+ String shortOpts = "hwko:r:s:c:qt";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("wsdl", LongOpt.NO_ARGUMENT, null, 'w'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'k':
+ generateSource = true;
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'r':
+ resourceDir = new File(getopt.getOptarg());
+ break;
+ case 'w':
+ generateWsdl = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 'c':
+ processClassPath(getopt.getOptarg());
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ int endpointPos = getopt.getOptind();
+ if (endpointPos >= args.length)
+ {
+ System.err.println("Error: endpoint implementation was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ return args[endpointPos];
+ }
+
+
+ private int generate(String endpoint)
+ {
+ if (!JavaUtils.isLoaded(endpoint, loader))
+ {
+ System.err.println("Error: Could not load class [" + endpoint + "]. Did you specify a valid --classpath?");
+ return 1;
+ }
+
+ WSContractProvider gen = WSContractProvider.newInstance(loader);
+ gen.setGenerateWsdl(generateWsdl);
+ gen.setGenerateSource(generateSource);
+ gen.setOutputDirectory(outputDir);
+ if (resourceDir != null)
+ gen.setResourceDirectory(resourceDir);
+ if (sourceDir != null)
+ gen.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ gen.setMessageStream(System.out);
+
+ try
+ {
+ gen.provide(endpoint);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not generate. (use --show-traces to see full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private void processClassPath(String classPath)
+ {
+ String[] entries = classPath.split(File.pathSeparator);
+ List<URL> urls= new ArrayList<URL>(entries.length);
+ for (String entry : entries)
+ {
+ try
+ {
+ urls.add(new File(entry).toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: a classpath entry was malformed: " + entry);
+ }
+ }
+ loader = new URLClassLoader(urls.toArray(new URL[0]), loader);
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("wsprovide generates portable JAX-WS artifacts for an endpoint implementation.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <endpoint class name>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -k, --keep Keep/Generate Java source");
+ out.println(" -w, --wsdl Enable WSDL file generation");
+ out.println(" -c. --classpath=<path> The classpath that contains the endpoint");
+ out.println(" -o, --output=<directory> The directory to put generated artifacts");
+ out.println(" -r, --resource=<directory> The directory to put resource artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java source");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack traces");
+ out.flush();
+ }
+}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl)
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -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.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javassist.CannotCompileException;
-import javassist.NotFoundException;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-
-public class BytecodeWrapperGenerator extends DynamicWrapperGenerator implements WritableWrapperGenerator
-{
- private List<String> typeNames = new ArrayList<String>();
- PrintStream stream;
-
- public BytecodeWrapperGenerator(ClassLoader loader, PrintStream stream)
- {
- super(loader);
- this.stream = stream;
- prune = false;
- }
-
- @Override
- public void reset(ClassLoader loader)
- {
- super.reset(loader);
- typeNames.clear();
- }
-
- @Override
- public void generate(FaultMetaData fmd)
- {
- super.generate(fmd);
-
- typeNames.add(fmd.getFaultBeanName());
- }
-
- @Override
- public void generate(ParameterMetaData pmd)
- {
- super.generate(pmd);
-
- typeNames.add(pmd.getJavaTypeName());
- }
-
- public void write(File directory) throws IOException
- {
- stream.println("Writing Classes:");
- for (String name : typeNames)
- {
- try
- {
- stream.println(name.replace('.', '/') + ".class");
- pool.get(name).writeFile(directory.getAbsolutePath());
- }
- catch (CannotCompileException e)
- {
- throw new WSException(e);
- }
- catch (NotFoundException e)
- {
- throw new WSException(e);
- }
- }
- }
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javassist.CannotCompileException;
+import javassist.NotFoundException;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+public class BytecodeWrapperGenerator extends DynamicWrapperGenerator implements WritableWrapperGenerator
+{
+ private List<String> typeNames = new ArrayList<String>();
+ PrintStream stream;
+
+ public BytecodeWrapperGenerator(ClassLoader loader, PrintStream stream)
+ {
+ super(loader);
+ this.stream = stream;
+ prune = false;
+ }
+
+ @Override
+ public void reset(ClassLoader loader)
+ {
+ super.reset(loader);
+ typeNames.clear();
+ }
+
+ @Override
+ public void generate(FaultMetaData fmd)
+ {
+ super.generate(fmd);
+
+ typeNames.add(fmd.getFaultBeanName());
+ }
+
+ @Override
+ public void generate(ParameterMetaData pmd)
+ {
+ super.generate(pmd);
+
+ typeNames.add(pmd.getJavaTypeName());
+ }
+
+ public void write(File directory) throws IOException
+ {
+ stream.println("Writing Classes:");
+ for (String name : typeNames)
+ {
+ try
+ {
+ stream.println(name.replace('.', '/') + ".class");
+ pool.get(name).writeFile(directory.getAbsolutePath());
+ }
+ catch (CannotCompileException e)
+ {
+ throw new WSException(e);
+ }
+ catch (NotFoundException e)
+ {
+ throw new WSException(e);
+ }
+ }
+ }
+}
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,81 +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.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.core.jaxws.WrapperGenerator;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-
-public class ChainedWritableWrapperGenerator implements WrapperGenerator
-{
- private List<Entry> chain = new ArrayList<Entry>();
-
- static class Entry
- {
- Entry(WritableWrapperGenerator generator, File directory)
- {
- this.generator = generator;
- this.directory = directory;
- }
-
- WritableWrapperGenerator generator;
- File directory;
- }
-
- public ChainedWritableWrapperGenerator()
- {
- }
-
- public void reset(ClassLoader loader)
- {
- for (Entry entry : chain)
- entry.generator.reset(loader);
- }
-
- public void write() throws IOException
- {
- for (Entry entry : chain)
- entry.generator.write(entry.directory);
- }
-
- public void generate(FaultMetaData fmd)
- {
- for (Entry entry : chain)
- entry.generator.generate(fmd);
- }
-
- public void generate(ParameterMetaData pmd)
- {
- for (Entry entry : chain)
- entry.generator.generate(pmd);
- }
-
- public void add(WritableWrapperGenerator generator, File directory)
- {
- chain.add(new Entry(generator, directory));
- }
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,81 @@
+/*
+ * 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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+public class ChainedWritableWrapperGenerator implements WrapperGenerator
+{
+ private List<Entry> chain = new ArrayList<Entry>();
+
+ static class Entry
+ {
+ Entry(WritableWrapperGenerator generator, File directory)
+ {
+ this.generator = generator;
+ this.directory = directory;
+ }
+
+ WritableWrapperGenerator generator;
+ File directory;
+ }
+
+ public ChainedWritableWrapperGenerator()
+ {
+ }
+
+ public void reset(ClassLoader loader)
+ {
+ for (Entry entry : chain)
+ entry.generator.reset(loader);
+ }
+
+ public void write() throws IOException
+ {
+ for (Entry entry : chain)
+ entry.generator.write(entry.directory);
+ }
+
+ public void generate(FaultMetaData fmd)
+ {
+ for (Entry entry : chain)
+ entry.generator.generate(fmd);
+ }
+
+ public void generate(ParameterMetaData pmd)
+ {
+ for (Entry entry : chain)
+ entry.generator.generate(pmd);
+ }
+
+ public void add(WritableWrapperGenerator generator, File directory)
+ {
+ chain.add(new Entry(generator, directory));
+ }
+}
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,39 +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.tools.jaxws.impl;
-
-import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
-import org.jboss.ws.integration.tools.jaxws.spi.WSContractProviderFactory;
-
-/**
- * Creates a JBossWS WSContractProvider implementation.
- * @see org.jboss.ws.integration.tools.jaxws.impl.JBossWSProviderImpl
- */
-public class JBossWSProviderFactoryImpl implements WSContractProviderFactory
-{
- public WSContractProvider createProvider(ClassLoader loader)
- {
- JBossWSProviderImpl impl = new JBossWSProviderImpl();
- impl.setClassLoader(loader);
- return impl;
- }
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,39 @@
+/*
+ * 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.tools.jaxws.impl;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+import org.jboss.ws.integration.tools.jaxws.spi.WSContractProviderFactory;
+
+/**
+ * Creates a JBossWS WSContractProvider implementation.
+ * @see org.jboss.ws.integration.tools.jaxws.impl.JBossWSProviderImpl
+ */
+public class JBossWSProviderFactoryImpl implements WSContractProviderFactory
+{
+ public WSContractProvider createProvider(ClassLoader loader)
+ {
+ JBossWSProviderImpl impl = new JBossWSProviderImpl();
+ impl.setClassLoader(loader);
+ return impl;
+ }
+}
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,183 +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.tools.jaxws.impl;
-
-import static org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB3;
-import static org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-
-import javax.ejb.Stateless;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.integration.ResourceLoaderAdapter;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
-
-/**
- * The default WSContractProvider implementation.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- */
-final class JBossWSProviderImpl extends WSContractProvider
-{
- private ClassLoader loader;
- private boolean generateWsdl = false;
- private boolean generateSource = false;
- private File outputDir = new File("output");
- private File resourceDir = null;
- private File sourceDir = null;
- private PrintStream messageStream = new NullPrintStream();
-
- private void createDirectories(File resourceDir, File sourceDir)
- {
- if (!outputDir.exists())
- if (!outputDir.mkdirs())
- throw new WSException("Could not create directory: " + outputDir);
-
- if (generateWsdl && !resourceDir.exists())
- if (!resourceDir.mkdirs())
- throw new WSException("Could not create directory: " + resourceDir);
-
- if (generateSource && !sourceDir.exists())
- if (!sourceDir.mkdirs())
- throw new WSException("Could not create directory: " + sourceDir);
- }
-
- private UnifiedDeploymentInfo createUDI(Class<?> endpointClass, ClassLoader loader)
- {
- DeploymentType type = (endpointClass.isAnnotationPresent(Stateless.class)) ? JAXWS_EJB3 : JAXWS_JSE;
- UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo(type)
- {
- @Override
- public URL getMetaDataFileURL(String resourcePath) throws IOException
- {
- return null;
- }
- };
- udi.classLoader = loader;
- return udi;
- }
-
- @Override
- public void provide(Class<?> endpointClass)
- {
- // Use the output directory as the default
- File resourceDir = (this.resourceDir != null) ? this.resourceDir : outputDir;
- File sourceDir = (this.sourceDir != null) ? this.sourceDir : outputDir;
-
- createDirectories(resourceDir, sourceDir);
-
- // Create a dummy classloader to catch generated classes
- ClassLoader loader = new URLClassLoader(new URL[0], this.loader);
- UnifiedMetaData umd = new UnifiedMetaData(new ResourceLoaderAdapter(loader));
- umd.setClassLoader(loader);
-
- ChainedWritableWrapperGenerator generator = new ChainedWritableWrapperGenerator();
- if (generateSource)
- generator.add(new SourceWrapperGenerator(loader, messageStream), sourceDir);
- generator.add(new BytecodeWrapperGenerator(loader, messageStream), outputDir);
-
- JAXWSWebServiceMetaDataBuilder builder = new JAXWSWebServiceMetaDataBuilder();
- builder.setWrapperGenerator(generator);
- builder.setGenerateWsdl(generateWsdl);
- builder.setToolMode(true);
- builder.setWsdlDirectory(resourceDir);
- builder.setMessageStream(messageStream);
-
- if (generateWsdl)
- messageStream.println("Generating WSDL:");
-
- UnifiedDeploymentInfo udi = createUDI(endpointClass, loader);
- builder.buildWebServiceMetaData(umd, udi, endpointClass, null);
- try
- {
- generator.write();
- }
- catch (IOException io)
- {
- throw new WSException("Could not write output files:", io);
- }
- }
-
- @Override
- public void provide(String endpointClass)
- {
- try
- {
- provide(loader.loadClass(endpointClass));
- }
- catch (ClassNotFoundException e)
- {
- throw new WSException("Class not found: " + endpointClass);
- }
- }
-
- @Override
- public void setClassLoader(ClassLoader loader)
- {
- this.loader = loader;
- }
-
- @Override
- public void setGenerateWsdl(boolean generateWsdl)
- {
- this.generateWsdl = generateWsdl;
- }
-
- @Override
- public void setOutputDirectory(File directory)
- {
- outputDir = directory;
- }
-
- @Override
- public void setGenerateSource(boolean generateSource)
- {
- this.generateSource = generateSource;
- }
-
- @Override
- public void setResourceDirectory(File directory)
- {
- resourceDir = directory;
- }
-
- @Override
- public void setSourceDirectory(File directory)
- {
- sourceDir = directory;
- }
-
- @Override
- public void setMessageStream(PrintStream messageStream)
- {
- this.messageStream = messageStream;
- }
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,183 @@
+/*
+* 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.tools.jaxws.impl;
+
+import static org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB3;
+import static org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import javax.ejb.Stateless;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.integration.ResourceLoaderAdapter;
+import org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+
+/**
+ * The default WSContractProvider implementation.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+final class JBossWSProviderImpl extends WSContractProvider
+{
+ private ClassLoader loader;
+ private boolean generateWsdl = false;
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File resourceDir = null;
+ private File sourceDir = null;
+ private PrintStream messageStream = new NullPrintStream();
+
+ private void createDirectories(File resourceDir, File sourceDir)
+ {
+ if (!outputDir.exists())
+ if (!outputDir.mkdirs())
+ throw new WSException("Could not create directory: " + outputDir);
+
+ if (generateWsdl && !resourceDir.exists())
+ if (!resourceDir.mkdirs())
+ throw new WSException("Could not create directory: " + resourceDir);
+
+ if (generateSource && !sourceDir.exists())
+ if (!sourceDir.mkdirs())
+ throw new WSException("Could not create directory: " + sourceDir);
+ }
+
+ private UnifiedDeploymentInfo createUDI(Class<?> endpointClass, ClassLoader loader)
+ {
+ DeploymentType type = (endpointClass.isAnnotationPresent(Stateless.class)) ? JAXWS_EJB3 : JAXWS_JSE;
+ UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo(type)
+ {
+ @Override
+ public URL getMetaDataFileURL(String resourcePath) throws IOException
+ {
+ return null;
+ }
+ };
+ udi.classLoader = loader;
+ return udi;
+ }
+
+ @Override
+ public void provide(Class<?> endpointClass)
+ {
+ // Use the output directory as the default
+ File resourceDir = (this.resourceDir != null) ? this.resourceDir : outputDir;
+ File sourceDir = (this.sourceDir != null) ? this.sourceDir : outputDir;
+
+ createDirectories(resourceDir, sourceDir);
+
+ // Create a dummy classloader to catch generated classes
+ ClassLoader loader = new URLClassLoader(new URL[0], this.loader);
+ UnifiedMetaData umd = new UnifiedMetaData(new ResourceLoaderAdapter(loader));
+ umd.setClassLoader(loader);
+
+ ChainedWritableWrapperGenerator generator = new ChainedWritableWrapperGenerator();
+ if (generateSource)
+ generator.add(new SourceWrapperGenerator(loader, messageStream), sourceDir);
+ generator.add(new BytecodeWrapperGenerator(loader, messageStream), outputDir);
+
+ JAXWSWebServiceMetaDataBuilder builder = new JAXWSWebServiceMetaDataBuilder();
+ builder.setWrapperGenerator(generator);
+ builder.setGenerateWsdl(generateWsdl);
+ builder.setToolMode(true);
+ builder.setWsdlDirectory(resourceDir);
+ builder.setMessageStream(messageStream);
+
+ if (generateWsdl)
+ messageStream.println("Generating WSDL:");
+
+ UnifiedDeploymentInfo udi = createUDI(endpointClass, loader);
+ builder.buildWebServiceMetaData(umd, udi, endpointClass, null);
+ try
+ {
+ generator.write();
+ }
+ catch (IOException io)
+ {
+ throw new WSException("Could not write output files:", io);
+ }
+ }
+
+ @Override
+ public void provide(String endpointClass)
+ {
+ try
+ {
+ provide(loader.loadClass(endpointClass));
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new WSException("Class not found: " + endpointClass);
+ }
+ }
+
+ @Override
+ public void setClassLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ }
+
+ @Override
+ public void setGenerateWsdl(boolean generateWsdl)
+ {
+ this.generateWsdl = generateWsdl;
+ }
+
+ @Override
+ public void setOutputDirectory(File directory)
+ {
+ outputDir = directory;
+ }
+
+ @Override
+ public void setGenerateSource(boolean generateSource)
+ {
+ this.generateSource = generateSource;
+ }
+
+ @Override
+ public void setResourceDirectory(File directory)
+ {
+ resourceDir = directory;
+ }
+
+ @Override
+ public void setSourceDirectory(File directory)
+ {
+ sourceDir = directory;
+ }
+
+ @Override
+ public void setMessageStream(PrintStream messageStream)
+ {
+ this.messageStream = messageStream;
+ }
+}
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,209 +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.tools.jaxws.impl;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.Locale;
-
-class NullPrintStream extends PrintStream
-{
- NullPrintStream()
- {
- // Doesn't actually do anything
- super(new ByteArrayOutputStream());
- }
-
- @Override
- public PrintStream append(char c)
- {
- return this;
- }
-
- @Override
- public PrintStream append(CharSequence csq, int start, int end)
- {
- return this;
- }
-
- @Override
- public PrintStream append(CharSequence csq)
- {
- return this;
- }
-
- @Override
- public boolean checkError()
- {
- return false;
- }
-
- @Override
- public void close()
- {
- }
-
- @Override
- public void flush()
- {
- }
-
- @Override
- public PrintStream format(Locale l, String format, Object... args)
- {
- return this;
- }
-
- @Override
- public PrintStream format(String format, Object... args)
- {
- return this;
- }
-
- @Override
- public void print(boolean b)
- {
- }
-
- @Override
- public void print(char c)
- {
- }
-
- @Override
- public void print(char[] s)
- {
- }
-
- @Override
- public void print(double d)
- {
- }
-
- @Override
- public void print(float f)
- {
- }
-
- @Override
- public void print(int i)
- {
- }
-
- @Override
- public void print(long l)
- {
- }
-
- @Override
- public void print(Object obj)
- {
- }
-
- @Override
- public void print(String s)
- {
- }
-
- @Override
- public PrintStream printf(Locale l, String format, Object... args)
- {
- return this;
- }
-
- @Override
- public PrintStream printf(String format, Object... args)
- {
- return this;
- }
-
- @Override
- public void println()
- {
- }
-
- @Override
- public void println(boolean x)
- {
- }
-
- @Override
- public void println(char x)
- {
- }
-
- @Override
- public void println(char[] x)
- {
- }
-
- @Override
- public void println(double x)
- {
- }
-
- @Override
- public void println(float x)
- {
- }
-
- @Override
- public void println(int x)
- {
- }
-
- @Override
- public void println(long x)
- {
- }
-
- @Override
- public void println(Object x)
- {
- }
-
- @Override
- public void println(String x)
- {
- }
-
- @Override
- protected void setError()
- {
- }
-
- @Override
- public void write(byte[] buf, int off, int len)
- {
- }
-
- @Override
- public void write(int b)
- {
- }
-
- @Override
- public void write(byte[] b) throws IOException
- {
- }
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,209 @@
+/*
+ * 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.tools.jaxws.impl;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Locale;
+
+class NullPrintStream extends PrintStream
+{
+ NullPrintStream()
+ {
+ // Doesn't actually do anything
+ super(new ByteArrayOutputStream());
+ }
+
+ @Override
+ public PrintStream append(char c)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq, int start, int end)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq)
+ {
+ return this;
+ }
+
+ @Override
+ public boolean checkError()
+ {
+ return false;
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ @Override
+ public void flush()
+ {
+ }
+
+ @Override
+ public PrintStream format(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream format(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void print(boolean b)
+ {
+ }
+
+ @Override
+ public void print(char c)
+ {
+ }
+
+ @Override
+ public void print(char[] s)
+ {
+ }
+
+ @Override
+ public void print(double d)
+ {
+ }
+
+ @Override
+ public void print(float f)
+ {
+ }
+
+ @Override
+ public void print(int i)
+ {
+ }
+
+ @Override
+ public void print(long l)
+ {
+ }
+
+ @Override
+ public void print(Object obj)
+ {
+ }
+
+ @Override
+ public void print(String s)
+ {
+ }
+
+ @Override
+ public PrintStream printf(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream printf(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void println()
+ {
+ }
+
+ @Override
+ public void println(boolean x)
+ {
+ }
+
+ @Override
+ public void println(char x)
+ {
+ }
+
+ @Override
+ public void println(char[] x)
+ {
+ }
+
+ @Override
+ public void println(double x)
+ {
+ }
+
+ @Override
+ public void println(float x)
+ {
+ }
+
+ @Override
+ public void println(int x)
+ {
+ }
+
+ @Override
+ public void println(long x)
+ {
+ }
+
+ @Override
+ public void println(Object x)
+ {
+ }
+
+ @Override
+ public void println(String x)
+ {
+ }
+
+ @Override
+ protected void setError()
+ {
+ }
+
+ @Override
+ public void write(byte[] buf, int off, int len)
+ {
+ }
+
+ @Override
+ public void write(int b)
+ {
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException
+ {
+ }
+}
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -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.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.List;
-import java.util.SortedMap;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.AbstractWrapperGenerator;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-
-import com.sun.codemodel.JAnnotationArrayMember;
-import com.sun.codemodel.JAnnotationUse;
-import com.sun.codemodel.JCodeModel;
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JExpr;
-import com.sun.codemodel.JFieldVar;
-import com.sun.codemodel.JMethod;
-import com.sun.codemodel.JMod;
-
-/**
- * Generates source for wrapper beans
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class SourceWrapperGenerator extends AbstractWrapperGenerator implements WritableWrapperGenerator
-{
- private static Logger log = Logger.getLogger(SourceWrapperGenerator.class);
- private PrintStream stream;
- private JCodeModel codeModel;
-
-
- public SourceWrapperGenerator(ClassLoader loader, PrintStream stream)
- {
- super(loader);
- this.stream = stream;
- codeModel = new JCodeModel();
- }
-
- @Override
- public void reset(ClassLoader loader)
- {
- super.reset(loader);
- codeModel = new JCodeModel();
- }
-
- public void write(File directory) throws IOException
- {
- stream.println("Writing Source:");
- codeModel.build(directory, stream);
- }
-
- public void generate(ParameterMetaData pmd)
- {
- List<WrappedParameter> wrappedParameters = pmd.getWrappedParameters();
- OperationMetaData operationMetaData = pmd.getOperationMetaData();
-
- if (operationMetaData.isDocumentWrapped() == false)
- throw new WSException("Operation is not document/literal (wrapped)");
-
- if (wrappedParameters == null)
- throw new WSException("Cannot generate a type when their is no type information");
-
- String wrapperName = pmd.getJavaTypeName();
- if (log.isDebugEnabled())
- if(log.isDebugEnabled()) log.debug("Generating wrapper: " + wrapperName);
-
- try
- {
-
- JDefinedClass clazz = codeModel._class(wrapperName);
- addClassAnnotations(clazz, pmd.getXmlName(), pmd.getXmlType(), null);
- for (WrappedParameter wrapped : wrappedParameters)
- {
- addProperty(clazz, wrapped.getType(), wrapped.getName(), wrapped.getVariable());
- }
- }
- catch (Exception e)
- {
- throw new WSException("Could not generate wrapper type: " + wrapperName, e);
- }
- }
- public void generate(FaultMetaData fmd)
- {
- String faultBeanName = fmd.getFaultBeanName();
- Class exception = fmd.getJavaType();
-
- try
- {
- SortedMap<String, Class<?>> properties = getExceptionProperties(exception);
- String[] propertyOrder = properties.keySet().toArray(new String[0]);
-
- JDefinedClass clazz = codeModel._class(faultBeanName);
- addClassAnnotations(clazz, fmd.getXmlName(), fmd.getXmlType(), propertyOrder);
-
- for (String property : propertyOrder)
- addProperty(clazz, properties.get(property).getName(), new QName(property), property);
- }
- catch (Exception e)
- {
- throw new WSException("Could not generate wrapper type: " + faultBeanName, e);
- }
- }
-
- private static String getterPrefix(Class type)
- {
- return Boolean.TYPE == type || Boolean.class == type ? "is" : "get";
- }
-
- private void addProperty(JDefinedClass clazz, String typeName, QName name, String variable)
- throws ClassNotFoundException
- {
- Class type = JavaUtils.loadJavaType(typeName, loader);
- JFieldVar field = clazz.field(JMod.PRIVATE, type, variable);
- JAnnotationUse annotation = field.annotate(XmlElement.class);
- if (name.getNamespaceURI() != null)
- annotation.param("namespace", name.getNamespaceURI());
- annotation.param("name", name.getLocalPart());
-
- // Add acessor methods
- JMethod method = clazz.method(JMod.PUBLIC, type, getterPrefix(type) + JavaUtils.capitalize(variable));
- method.body()._return(JExpr._this().ref(variable));
-
- method = clazz.method(JMod.PUBLIC, type, "set" + JavaUtils.capitalize(variable));
- method.body().assign(JExpr._this().ref(variable), method.param(type, variable));
- }
-
- private static void addClassAnnotations(JDefinedClass clazz, QName xmlName, QName xmlType, String[] propertyOrder)
- {
- JAnnotationUse annotation = clazz.annotate(XmlRootElement.class);
- if (xmlName.getNamespaceURI() != null && xmlName.getNamespaceURI().length() > 0)
- annotation.param("namespace", xmlName.getNamespaceURI());
- annotation.param("name", xmlName.getLocalPart());
-
- annotation = clazz.annotate(XmlType.class);
- if (xmlType.getNamespaceURI() != null & xmlType.getNamespaceURI().length() > 0)
- annotation.param("namespace", xmlType.getNamespaceURI());
- annotation.param("name", xmlType.getLocalPart());
- if (propertyOrder != null)
- {
- JAnnotationArrayMember paramArray = annotation.paramArray("propOrder");
- for (String property : propertyOrder)
- paramArray.param(property);
- }
-
- annotation = clazz.annotate(XmlAccessorType.class);
- annotation.param("value", XmlAccessType.FIELD);
- }
-}
\ No newline at end of file
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.List;
+import java.util.SortedMap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.AbstractWrapperGenerator;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+
+import com.sun.codemodel.JAnnotationArrayMember;
+import com.sun.codemodel.JAnnotationUse;
+import com.sun.codemodel.JCodeModel;
+import com.sun.codemodel.JDefinedClass;
+import com.sun.codemodel.JExpr;
+import com.sun.codemodel.JFieldVar;
+import com.sun.codemodel.JMethod;
+import com.sun.codemodel.JMod;
+
+/**
+ * Generates source for wrapper beans
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class SourceWrapperGenerator extends AbstractWrapperGenerator implements WritableWrapperGenerator
+{
+ private static Logger log = Logger.getLogger(SourceWrapperGenerator.class);
+ private PrintStream stream;
+ private JCodeModel codeModel;
+
+
+ public SourceWrapperGenerator(ClassLoader loader, PrintStream stream)
+ {
+ super(loader);
+ this.stream = stream;
+ codeModel = new JCodeModel();
+ }
+
+ @Override
+ public void reset(ClassLoader loader)
+ {
+ super.reset(loader);
+ codeModel = new JCodeModel();
+ }
+
+ public void write(File directory) throws IOException
+ {
+ stream.println("Writing Source:");
+ codeModel.build(directory, stream);
+ }
+
+ public void generate(ParameterMetaData pmd)
+ {
+ List<WrappedParameter> wrappedParameters = pmd.getWrappedParameters();
+ OperationMetaData operationMetaData = pmd.getOperationMetaData();
+
+ if (operationMetaData.isDocumentWrapped() == false)
+ throw new WSException("Operation is not document/literal (wrapped)");
+
+ if (wrappedParameters == null)
+ throw new WSException("Cannot generate a type when their is no type information");
+
+ String wrapperName = pmd.getJavaTypeName();
+ if (log.isDebugEnabled())
+ if(log.isDebugEnabled()) log.debug("Generating wrapper: " + wrapperName);
+
+ try
+ {
+
+ JDefinedClass clazz = codeModel._class(wrapperName);
+ addClassAnnotations(clazz, pmd.getXmlName(), pmd.getXmlType(), null);
+ for (WrappedParameter wrapped : wrappedParameters)
+ {
+ addProperty(clazz, wrapped.getType(), wrapped.getName(), wrapped.getVariable());
+ }
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not generate wrapper type: " + wrapperName, e);
+ }
+ }
+ public void generate(FaultMetaData fmd)
+ {
+ String faultBeanName = fmd.getFaultBeanName();
+ Class exception = fmd.getJavaType();
+
+ try
+ {
+ SortedMap<String, Class<?>> properties = getExceptionProperties(exception);
+ String[] propertyOrder = properties.keySet().toArray(new String[0]);
+
+ JDefinedClass clazz = codeModel._class(faultBeanName);
+ addClassAnnotations(clazz, fmd.getXmlName(), fmd.getXmlType(), propertyOrder);
+
+ for (String property : propertyOrder)
+ addProperty(clazz, properties.get(property).getName(), new QName(property), property);
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not generate wrapper type: " + faultBeanName, e);
+ }
+ }
+
+ private static String getterPrefix(Class type)
+ {
+ return Boolean.TYPE == type || Boolean.class == type ? "is" : "get";
+ }
+
+ private void addProperty(JDefinedClass clazz, String typeName, QName name, String variable)
+ throws ClassNotFoundException
+ {
+ Class type = JavaUtils.loadJavaType(typeName, loader);
+ JFieldVar field = clazz.field(JMod.PRIVATE, type, variable);
+ JAnnotationUse annotation = field.annotate(XmlElement.class);
+ if (name.getNamespaceURI() != null)
+ annotation.param("namespace", name.getNamespaceURI());
+ annotation.param("name", name.getLocalPart());
+
+ // Add acessor methods
+ JMethod method = clazz.method(JMod.PUBLIC, type, getterPrefix(type) + JavaUtils.capitalize(variable));
+ method.body()._return(JExpr._this().ref(variable));
+
+ method = clazz.method(JMod.PUBLIC, type, "set" + JavaUtils.capitalize(variable));
+ method.body().assign(JExpr._this().ref(variable), method.param(type, variable));
+ }
+
+ private static void addClassAnnotations(JDefinedClass clazz, QName xmlName, QName xmlType, String[] propertyOrder)
+ {
+ JAnnotationUse annotation = clazz.annotate(XmlRootElement.class);
+ if (xmlName.getNamespaceURI() != null && xmlName.getNamespaceURI().length() > 0)
+ annotation.param("namespace", xmlName.getNamespaceURI());
+ annotation.param("name", xmlName.getLocalPart());
+
+ annotation = clazz.annotate(XmlType.class);
+ if (xmlType.getNamespaceURI() != null & xmlType.getNamespaceURI().length() > 0)
+ annotation.param("namespace", xmlType.getNamespaceURI());
+ annotation.param("name", xmlType.getLocalPart());
+ if (propertyOrder != null)
+ {
+ JAnnotationArrayMember paramArray = annotation.paramArray("propOrder");
+ for (String property : propertyOrder)
+ paramArray.param(property);
+ }
+
+ annotation = clazz.annotate(XmlAccessorType.class);
+ annotation.param("value", XmlAccessType.FIELD);
+ }
+}
\ No newline at end of file
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,39 +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.tools.jaxws.impl;
-
-import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
-import org.jboss.ws.integration.tools.jaxws.spi.WSContractConsumerFactory;
-
-/**
- * Creates a WSContractConsumer that delegates to the Sun RI.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision:2311 $
- */
-public class SunRIConsumerFactoryImpl implements WSContractConsumerFactory
-{
- public WSContractConsumer createConsumer() {
- return new SunRIConsumerImpl();
- }
-}
-
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,39 @@
+/*
+* 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.tools.jaxws.impl;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+import org.jboss.ws.integration.tools.jaxws.spi.WSContractConsumerFactory;
+
+/**
+ * Creates a WSContractConsumer that delegates to the Sun RI.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision:2311 $
+ */
+public class SunRIConsumerFactoryImpl implements WSContractConsumerFactory
+{
+ public WSContractConsumer createConsumer() {
+ return new SunRIConsumerImpl();
+ }
+}
+
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,170 +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.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.sun.tools.ws.wscompile.CompileTool;
-import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
-
-/**
- * WSContractConsumer that delegates to the Sun CompileTool.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class SunRIConsumerImpl extends WSContractConsumer
-{
- private List<File> bindingFiles = null;
- private File catalog = null;
- private boolean generateSource = false;
- private File outputDir = new File("output");
- private File sourceDir = null;
- private String targetPackage = null;
- private PrintStream messageStream = null;
- private String wsdlLocation = null;
- private List<String> additionalCompilerClassPath = null;
-
- @Override
- public void setBindingFiles(List<File> bindingFiles) {
- this.bindingFiles = bindingFiles;
- }
-
- @Override
- public void setCatalog(File catalog) {
- this.catalog = catalog;
- }
-
- @Override
- public void setGenerateSource(boolean generateSource) {
- this.generateSource = generateSource;
- }
-
- @Override
- public void setMessageStream(PrintStream messageStream) {
- // TODO Auto-generated method stub
- this.messageStream = messageStream;
- }
-
- @Override
- public void setOutputDirectory(File directory) {
- // TODO Auto-generated method stub
- outputDir = directory;
- }
-
- @Override
- public void setSourceDirectory(File directory) {
- sourceDir = directory;
- }
-
- @Override
- public void setTargetPackage(String targetPackage) {
- this.targetPackage = targetPackage;
- }
-
- @Override
- public void setWsdlLocation(String wsdlLocation) {
- this.wsdlLocation = wsdlLocation;
- }
-
- public void setAdditionalCompilerClassPath(List<String> additionalCompilerClassPath) {
- this.additionalCompilerClassPath = additionalCompilerClassPath;
- }
-
- @Override
- public void consume(URL wsdl) {
- List<String> args = new ArrayList<String>();
- if (bindingFiles != null) {
- for (File file : bindingFiles) {
- args.add("-b");
- args.add(file.getAbsolutePath());
-
- }
- }
-
- if (catalog != null) {
- args.add("-catalog");
- args.add(catalog.getAbsolutePath());
- }
-
- if (generateSource) {
- args.add("-keep");
- if (sourceDir != null) {
- if (!sourceDir.exists() && !sourceDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
-
- args.add("-s");
- args.add(sourceDir.getAbsolutePath());
- }
- }
-
- if (targetPackage != null) {
- args.add("-p");
- args.add(targetPackage);
- }
-
- if (wsdlLocation != null) {
- args.add("-wsdllocation");
- args.add(wsdlLocation);
- }
-
- PrintStream stream = messageStream;
- if (stream != null) {
- args.add("-verbose");
- } else {
- stream = new NullPrintStream();
- }
-
- if (!outputDir.exists() && !outputDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " + outputDir.getName());
-
- // Always add the output directory and the wsdl location
- args.add("-d");
- args.add(outputDir.getAbsolutePath());
- args.add(wsdl.toString());
-
- // WSToolsObjectFactory tools = WSToolsObjectFactory.newInstance();
- // tools.wsimport(stream, args.toArray(new String[0]));
-
- // We have to manipulate internals since they don't expose a way to set
- // the classpath that is used for compilation
- CompileTool tool = new CompileTool(stream, "wsimport") {
- @Override
- public boolean run(String[] args) {
- StringBuilder builder = new StringBuilder();
- if (additionalCompilerClassPath != null && additionalCompilerClassPath.size() > 0) {
- for (String entry : additionalCompilerClassPath)
- builder.append(entry).append(File.pathSeparatorChar);
- builder.setLength(builder.length() - 1);
- }
- userClasspath = builder.toString();
- return super.run(args);
- }
- };
- tool.run(args.toArray(new String[0]));
- }
-}
-
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.sun.tools.ws.wscompile.CompileTool;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+
+/**
+ * WSContractConsumer that delegates to the Sun CompileTool.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class SunRIConsumerImpl extends WSContractConsumer
+{
+ private List<File> bindingFiles = null;
+ private File catalog = null;
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+ private String targetPackage = null;
+ private PrintStream messageStream = null;
+ private String wsdlLocation = null;
+ private List<String> additionalCompilerClassPath = null;
+
+ @Override
+ public void setBindingFiles(List<File> bindingFiles) {
+ this.bindingFiles = bindingFiles;
+ }
+
+ @Override
+ public void setCatalog(File catalog) {
+ this.catalog = catalog;
+ }
+
+ @Override
+ public void setGenerateSource(boolean generateSource) {
+ this.generateSource = generateSource;
+ }
+
+ @Override
+ public void setMessageStream(PrintStream messageStream) {
+ // TODO Auto-generated method stub
+ this.messageStream = messageStream;
+ }
+
+ @Override
+ public void setOutputDirectory(File directory) {
+ // TODO Auto-generated method stub
+ outputDir = directory;
+ }
+
+ @Override
+ public void setSourceDirectory(File directory) {
+ sourceDir = directory;
+ }
+
+ @Override
+ public void setTargetPackage(String targetPackage) {
+ this.targetPackage = targetPackage;
+ }
+
+ @Override
+ public void setWsdlLocation(String wsdlLocation) {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void setAdditionalCompilerClassPath(List<String> additionalCompilerClassPath) {
+ this.additionalCompilerClassPath = additionalCompilerClassPath;
+ }
+
+ @Override
+ public void consume(URL wsdl) {
+ List<String> args = new ArrayList<String>();
+ if (bindingFiles != null) {
+ for (File file : bindingFiles) {
+ args.add("-b");
+ args.add(file.getAbsolutePath());
+
+ }
+ }
+
+ if (catalog != null) {
+ args.add("-catalog");
+ args.add(catalog.getAbsolutePath());
+ }
+
+ if (generateSource) {
+ args.add("-keep");
+ if (sourceDir != null) {
+ if (!sourceDir.exists() && !sourceDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
+
+ args.add("-s");
+ args.add(sourceDir.getAbsolutePath());
+ }
+ }
+
+ if (targetPackage != null) {
+ args.add("-p");
+ args.add(targetPackage);
+ }
+
+ if (wsdlLocation != null) {
+ args.add("-wsdllocation");
+ args.add(wsdlLocation);
+ }
+
+ PrintStream stream = messageStream;
+ if (stream != null) {
+ args.add("-verbose");
+ } else {
+ stream = new NullPrintStream();
+ }
+
+ if (!outputDir.exists() && !outputDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + outputDir.getName());
+
+ // Always add the output directory and the wsdl location
+ args.add("-d");
+ args.add(outputDir.getAbsolutePath());
+ args.add(wsdl.toString());
+
+ // WSToolsObjectFactory tools = WSToolsObjectFactory.newInstance();
+ // tools.wsimport(stream, args.toArray(new String[0]));
+
+ // We have to manipulate internals since they don't expose a way to set
+ // the classpath that is used for compilation
+ CompileTool tool = new CompileTool(stream, "wsimport") {
+ @Override
+ public boolean run(String[] args) {
+ StringBuilder builder = new StringBuilder();
+ if (additionalCompilerClassPath != null && additionalCompilerClassPath.size() > 0) {
+ for (String entry : additionalCompilerClassPath)
+ builder.append(entry).append(File.pathSeparatorChar);
+ builder.setLength(builder.length() - 1);
+ }
+ userClasspath = builder.toString();
+ return super.run(args);
+ }
+ };
+ tool.run(args.toArray(new String[0]));
+ }
+}
+
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,32 +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.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.jboss.ws.core.jaxws.WrapperGenerator;
-
-public interface WritableWrapperGenerator extends WrapperGenerator
-{
- public void write(File directory) throws IOException;
-}
\ No newline at end of file
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,32 @@
+/*
+ * 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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+
+public interface WritableWrapperGenerator extends WrapperGenerator
+{
+ public void write(File directory) throws IOException;
+}
\ No newline at end of file
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi)
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,40 +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.tools.jaxws.spi;
-
-import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
-
-/**
- * WSContractConsumerFactory defines the contract for a WSContractConsumer factory.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- */
-public interface WSContractConsumerFactory
-{
- /**
- * Create a new WSContractConsumer. There are no restrictions on how this
- * should be performed.
- *
- * @return a new WSContractConsumer
- */
- public WSContractConsumer createConsumer();
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,40 @@
+/*
+ * 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.tools.jaxws.spi;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+
+/**
+ * WSContractConsumerFactory defines the contract for a WSContractConsumer factory.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public interface WSContractConsumerFactory
+{
+ /**
+ * Create a new WSContractConsumer. There are no restrictions on how this
+ * should be performed.
+ *
+ * @return a new WSContractConsumer
+ */
+ public WSContractConsumer createConsumer();
+}
Deleted: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -1,43 +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.tools.jaxws.spi;
-
-import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
-
-/**
- * WSContractProviderFactory defines the contract for a WSContractProvider factory.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- */
-public interface WSContractProviderFactory
-{
- /**
- * Create a new WSContractProvider. There are no restrictions on how this
- * should be performed. The passed ClassLoader is the one used in
- * {@link WSContractProvider#newInstance(ClassLoader)}. This loader
- * should be made available to the generated WSContractProvider.
- *
- * @param loader the ClassLoader for type discovery
- * @return a new WSContractProvider
- */
- public WSContractProvider createProvider(ClassLoader loader);
-}
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -0,0 +1,43 @@
+/*
+ * 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.tools.jaxws.spi;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+
+/**
+ * WSContractProviderFactory defines the contract for a WSContractProvider factory.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public interface WSContractProviderFactory
+{
+ /**
+ * Create a new WSContractProvider. There are no restrictions on how this
+ * should be performed. The passed ClassLoader is the one used in
+ * {@link WSContractProvider#newInstance(ClassLoader)}. This loader
+ * should be made available to the generated WSContractProvider.
+ *
+ * @param loader the ClassLoader for type discovery
+ * @return a new WSContractProvider
+ */
+ public WSContractProvider createProvider(ClassLoader loader);
+}
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -52,7 +52,7 @@
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.ws.tools.ToolsUtils;
-import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
+import org.jboss.ws.tools.wsdl.JAXBWSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
Copied: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java (from rev 3100, branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -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.tools.wsdl;
+
+import java.io.IOException;
+
+import javax.xml.bind.SchemaOutputResolver;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.dom.DOMResult;
+
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.metadata.wsdl.DOMTypes;
+import org.jboss.ws.tools.wsdl.WSDLGenerator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+
+/**
+ * JAXBWSDLGenerator provides a JAXB based WSDLGenerator.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public class JAXBWSDLGenerator extends WSDLGenerator
+{
+ private JAXBRIContext ctx;
+
+ public JAXBWSDLGenerator(JAXBRIContext ctx)
+ {
+ super();
+ this.ctx = ctx;
+ }
+
+ protected void processTypes()
+ {
+ // Register namespaces
+ for (String ns : ctx.getKnownNamespaceURIs())
+ if (ns.length() > 0)
+ wsdl.registerNamespaceURI(ns, null);
+
+ try
+ {
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document doc = builder.newDocument();
+ DOMTypes types = new DOMTypes(doc);
+ final Element element = types.getElement();
+ final Element throwAway = doc.createElement("throw-away");
+
+ ctx.generateSchema(new SchemaOutputResolver()
+ {
+ @Override
+ public Result createOutput(String namespace, String file) throws IOException
+ {
+ // JBWS-1295, getKnownNamespaceURIs is not accurate
+ if (namespace.length() > 0 && wsdl.getPrefix(namespace) == null)
+ wsdl.registerNamespaceURI(namespace, null);
+
+ // JAXB creates an empty namespace due to type references, ignore it
+ DOMResult result = new DOMResult((namespace == null || namespace.length() == 0) ? throwAway : element);
+ result.setSystemId("replace-me");
+ return result;
+ }
+ });
+
+ // Until we stop inlining schema, we will need to filter schemaLocations since JAXB requires them
+ removeSchemaLocations(element);
+
+ wsdl.setWsdlTypes(types);
+ }
+ catch (Exception exception)
+ {
+ throw new WSException("Could not generate schema: " + exception.getMessage(), exception);
+ }
+ }
+
+ private void removeSchemaLocations(Element element)
+ {
+ for (Element child = Util.getFirstChildElement(element); child != null; child = Util.getNextSiblingElement(child))
+ {
+ if ("import".equals(child.getLocalName()) && Constants.NS_SCHEMA_XSD.equals(child.getNamespaceURI()) && "replace-me".equals(child.getAttribute("schemaLocation")))
+ {
+ child.removeAttribute("schemaLocation");
+ }
+ else
+ {
+ removeSchemaLocations(child);
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: branches/jbossws-2.0/jbossws-core/src/resources/samples/build.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/resources/samples/build.xml 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-core/src/resources/samples/build.xml 2007-05-16 08:26:33 UTC (rev 3101)
@@ -239,7 +239,7 @@
<target name="wsconsume" depends="init" description="Consume JAX-WS contracts" if="HAVE_JDK_1.5">
<!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsconsume" classname="org.jboss.ws.tools.jaxws.ant.wsconsume">
+ <taskdef name="wsconsume" classname="org.jboss.ws.integration.tools.jaxws.ant.wsconsume">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/jbossws-wsconsume-impl.jar"/>
@@ -331,7 +331,7 @@
<target name="wsprovide" depends="compile" description="Provide the JAX-WS contracts." if="HAVE_JDK_1.5">
<!-- Define the JAX-WS wsprovide task -->
- <taskdef name="wsprovide" classname="org.jboss.ws.tools.jaxws.ant.wsprovide">
+ <taskdef name="wsprovide" classname="org.jboss.ws.integration.tools.jaxws.ant.wsprovide">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/concurrent.jar"/>
Modified: branches/jbossws-2.0/jbossws-tests/build.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/build.xml 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-tests/build.xml 2007-05-16 08:26:33 UTC (rev 3101)
@@ -246,14 +246,14 @@
<target name="wsconsume" depends="init" description="Consume JAX-WS contracts" if="HAVE_JDK_1.5">
<!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsconsume" classname="org.jboss.ws.tools.jaxws.ant.wsconsume">
+ <taskdef name="wsconsume" classname="org.jboss.ws.integration.tools.jaxws.ant.wsconsume">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/jbossws-wsconsume-impl.jar"/>
<classpath location="${thirdparty.dir}/jaxb-xjc.jar"/>
</taskdef>
- <wsconsume wsdl="${tests.resources.dir}/benchmark/jaxws/doclit/WEB-INF/wsdl/BenchmarkWebService.wsdl" package="org.jboss.test.ws.benchmark.jaxws.doclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/benchmark/jaxws/doclit/WEB-INF/wsdl/BenchmarkWebService.wsdl" package="org.jboss.test.ws.benchmark.jaxws.doclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="true"/>
<wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitB/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitb" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitW/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitw" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesRpcLit/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.baserpclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
@@ -344,7 +344,7 @@
<target name="wsprovide" depends="compile" description="Provide the JAX-WS contracts." if="HAVE_JDK_1.5">
<!-- Define the JAX-WS wsprovide task -->
- <taskdef name="wsprovide" classname="org.jboss.ws.tools.jaxws.ant.wsprovide">
+ <taskdef name="wsprovide" classname="org.jboss.ws.integration.tools.jaxws.ant.wsprovide">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/concurrent.jar"/>
Modified: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java 2007-05-15 15:38:54 UTC (rev 3100)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java 2007-05-16 08:26:33 UTC (rev 3101)
@@ -31,7 +31,7 @@
import org.jboss.test.ws.jaxws.samples.soapbinding.PurchaseOrder;
import org.jboss.test.ws.jaxws.samples.soapbinding.PurchaseOrderAck;
import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.tools.jaxws.api.WSContractProvider;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
17 years, 4 months
JBossWS SVN: r3100 - in branches/hbraun/trunk: build/ant-import and 16 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-15 11:38:54 -0400 (Tue, 15 May 2007)
New Revision: 3100
Added:
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java
Modified:
branches/hbraun/trunk/build/ant-import/build-deploy.xml
branches/hbraun/trunk/build/ant-import/build-release.xml
branches/hbraun/trunk/build/ant-import/build-thirdparty.xml
branches/hbraun/trunk/build/etc/component-info/jbossws.xml
branches/hbraun/trunk/build/etc/wsconsume.bat
branches/hbraun/trunk/build/etc/wsconsume.sh
branches/hbraun/trunk/build/etc/wsprovide.bat
branches/hbraun/trunk/build/etc/wsprovide.sh
branches/hbraun/trunk/build/etc/wspublish.sh
branches/hbraun/trunk/build/version.properties
branches/hbraun/trunk/jbossws-core/build.xml
branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/hbraun/trunk/jbossws-core/src/resources/samples/build.xml
branches/hbraun/trunk/jbossws-tests/build.xml
branches/hbraun/trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java
Log:
Fetch binaries from repository. Consolidate package structure
Modified: branches/hbraun/trunk/build/ant-import/build-deploy.xml
===================================================================
--- branches/hbraun/trunk/build/ant-import/build-deploy.xml 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/ant-import/build-deploy.xml 2007-05-15 15:38:54 UTC (rev 3100)
@@ -57,13 +57,15 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
</fileset>
<fileset dir="${thirdparty.dir}">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
- <include name="wsdl4j.jar"/>
- <include name="jbossws-wsconsume-impl.jar"/>
+ <include name="jaxws-rt.jar"/>
+ <include name="jaxws-tools.jar"/>
+ <include name="wsdl4j.jar"/>
</fileset>
</copy>
<copy todir="${jboss50.home}/server/${jboss.server.instance}/lib" overwrite="true">
@@ -106,12 +108,14 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
</fileset>
<fileset dir="${thirdparty.dir}">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
- <include name="jbossws-wsconsume-impl.jar"/>
+ <include name="jaxws-rt.jar"/>
+ <include name="jaxws-tools.jar"/>
</fileset>
</copy>
<copy todir="${jboss42.home}/server/${jboss.server.instance}/lib" overwrite="true">
@@ -153,13 +157,15 @@
<include name="jboss-jaxws.jar" />
<include name="jboss-saaj.jar" />
<include name="jbossws-client.jar" />
+ <include name="jbossws-integration-tools.jar"/>
</fileset>
<!-- Only available on jdk1.5 -->
<fileset dir="${thirdparty.dir}">
<include name="jaxb-api.jar" />
<include name="jaxb-impl.jar" />
<include name="jaxb-xjc.jar" />
- <include name="jbossws-wsconsume-impl.jar" />
+ <include name="jaxws-rt.jar"/>
+ <include name="jaxws-tools.jar"/>
<include name="stax-api.jar"/>
<include name="wstx.jar"/>
</fileset>
Modified: branches/hbraun/trunk/build/ant-import/build-release.xml
===================================================================
--- branches/hbraun/trunk/build/ant-import/build-release.xml 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/ant-import/build-release.xml 2007-05-15 15:38:54 UTC (rev 3100)
@@ -221,7 +221,7 @@
<copy todir="${install.thirdparty.dir}" overwrite="true">
<fileset dir="${thirdparty.dir}">
<include name="activation.jar"/>
- <include name="jbossws-wsconsume-impl.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
<include name="jboss-xml-binding.jar"/>
<include name="jaxb-*.jar"/>
<include name="juddi-service.sar"/>
Modified: branches/hbraun/trunk/build/ant-import/build-thirdparty.xml
===================================================================
--- branches/hbraun/trunk/build/ant-import/build-thirdparty.xml 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/ant-import/build-thirdparty.xml 2007-05-15 15:38:54 UTC (rev 3100)
@@ -35,8 +35,8 @@
<get src="${jboss.repository}/apache-xerces/${apache-xerces}/lib/xml-apis.jar" dest="${thirdparty.dir}/xml-apis.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/apache-xmlsec/${apache-xmlsec}/lib/xmlsec.jar" dest="${thirdparty.dir}/xmlsec.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/dom4j/${dom4j}/lib/dom4j.jar" dest="${thirdparty.dir}/dom4j.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/eclipse-compiler/${eclipse-compiler}/lib/jdtCompilerAdapter.jar" dest="${thirdparty.dir}/jdtCompilerAdapter.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/eclipse-compiler/${eclipse-compiler}/lib/org.eclipse.jdt.core.jar" dest="${thirdparty.dir}/org.eclipse.jdt.core.jar" usetimestamp="true" verbose="true"/>
+ <!--get src="${jboss.repository}/eclipse-compiler/${eclipse-compiler}/lib/jdtCompilerAdapter.jar" dest="${thirdparty.dir}/jdtCompilerAdapter.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/eclipse-compiler/${eclipse-compiler}/lib/org.eclipse.jdt.core.jar" dest="${thirdparty.dir}/org.eclipse.jdt.core.jar" usetimestamp="true" verbose="true"/-->
<get src="${jboss.repository}/gnu-getopt/${gnu-getopt}/lib/getopt.jar" dest="${thirdparty.dir}/getopt.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/hibernate/${hibernate}/lib/hibernate3.jar" dest="${thirdparty.dir}/hibernate3.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j.jar" dest="${thirdparty.dir}/wsdl4j.jar" usetimestamp="true" verbose="true"/>
@@ -53,8 +53,7 @@
<get src="${jboss.repository}/jboss/jboss-vfs/${jboss-vfs}/lib/jboss-vfs.jar" dest="${thirdparty.dir}/jboss-vfs.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jboss-vfs/${jboss-vfs}/lib/jboss-vfs-sources.jar" dest="${thirdparty.dir}/jboss-vfs-sources.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"/>
- <get src="${jboss.repository}/jboss/jbossretro/${jboss-jbossretro}/lib/jbossretro-rt.jar" dest="${thirdparty.dir}/jbossretro-rt.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jboss/jbossws-wsconsume-impl/${jbossws-wsconsume-impl}/lib/jbossws-wsconsume-impl.jar" dest="${thirdparty.dir}/jbossws-wsconsume-impl.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/jboss/jbossretro/${jboss-jbossretro}/lib/jbossretro-rt.jar" dest="${thirdparty.dir}/jbossretro-rt.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding.jar" dest="${thirdparty.dir}/jboss-xml-binding.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding-sources.jar" dest="${thirdparty.dir}/jboss-xml-binding-sources.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"/>
@@ -74,6 +73,10 @@
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar" dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-impl.jar" dest="${thirdparty.dir}/jaxb-impl.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-xjc.jar" dest="${thirdparty.dir}/jaxb-xjc.jar" usetimestamp="true" verbose="true"/>
+
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-rt.jar" dest="${thirdparty.dir}/jaxws-rt.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-tools.jar" dest="${thirdparty.dir}/jaxws-tools.jar" usetimestamp="true" verbose="true"/>
+
<get src="${jboss.repository}/sun-servlet/${sun-servlet}/lib/servlet-api.jar" dest="${thirdparty.dir}/servlet-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/xmlunit-xmlunit/${xmlunit}/lib/xmlunit1.0.jar" dest="${thirdparty.dir}/xmlunit1.0.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/wscommons-policy/${wscommons-policy}/lib/policy.jar" dest="${thirdparty.dir}/policy.jar" usetimestamp="true" verbose="true"/>
@@ -112,6 +115,9 @@
<pathelement location="${thirdparty.dir}/xmlsec.jar"/>
<pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
<pathelement location="${thirdparty.dir}/xalan.jar"/>
+
+ <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
</path>
<!-- The compile classpath for jboss50 integration -->
Modified: branches/hbraun/trunk/build/etc/component-info/jbossws.xml
===================================================================
--- branches/hbraun/trunk/build/etc/component-info/jbossws.xml 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/etc/component-info/jbossws.xml 2007-05-15 15:38:54 UTC (rev 3100)
@@ -28,8 +28,8 @@
<import componentref="jbpm/bpel">
<compatible version="@jbpm-bpel@"/>
</import>
- <import componentref="jboss/jbossws-wsconsume-impl">
- <compatible version="@jbossws-wsconsume-impl@"/>
+ <import componentref="sun-jaxws">
+ <compatible version="@sun-jaxws@"/>
</import>
<import componentref="stax-api">
<compatible version="@stax-api@"/>
Modified: branches/hbraun/trunk/build/etc/wsconsume.bat
===================================================================
--- branches/hbraun/trunk/build/etc/wsconsume.bat 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/etc/wsconsume.bat 2007-05-15 15:38:54 UTC (rev 3100)
@@ -40,7 +40,9 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar
-set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-wsconsume-impl.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-integration-tools.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar
@@ -50,4 +52,4 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
rem Execute the JVM
-"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.ws.tools.jaxws.command.wsconsume %*
+"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.ws.integration.tools.jaxws.command.wsconsume %*
Modified: branches/hbraun/trunk/build/etc/wsconsume.sh
===================================================================
--- branches/hbraun/trunk/build/etc/wsconsume.sh 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/etc/wsconsume.sh 2007-05-15 15:38:54 UTC (rev 3100)
@@ -50,7 +50,6 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JAVA_HOME/lib/tools.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-xml-binding.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/wstx.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-wsconsume-impl.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/activation.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/getopt.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/javassist.jar"
@@ -58,6 +57,8 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/stax-api.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-impl.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-xjc.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-rt.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-tools.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-client.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-jaxws.jar"
@@ -65,6 +66,7 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/mail.jar"
+WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jbossws-integration-tools.jar"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
@@ -79,4 +81,4 @@
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dlog4j.configuration=wstools-log4j.xml \
-classpath "$WSCONSUME_CLASSPATH" \
- org.jboss.ws.tools.jaxws.command.wsconsume "$@"
+ org.jboss.ws.integration.tools.jaxws.command.wsconsume "$@"
Modified: branches/hbraun/trunk/build/etc/wsprovide.bat
===================================================================
--- branches/hbraun/trunk/build/etc/wsprovide.bat 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/etc/wsprovide.bat 2007-05-15 15:38:54 UTC (rev 3100)
@@ -45,4 +45,4 @@
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
rem Execute the JVM
-"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.ws.tools.jaxws.command.wsprovide %*
+"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.ws.integration.tools.jaxws.command.wsprovide %*
Modified: branches/hbraun/trunk/build/etc/wsprovide.sh
===================================================================
--- branches/hbraun/trunk/build/etc/wsprovide.sh 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/etc/wsprovide.sh 2007-05-15 15:38:54 UTC (rev 3100)
@@ -60,6 +60,7 @@
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/mail.jar"
+WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jbossws-integration-tools.jar"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
@@ -74,4 +75,4 @@
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dlog4j.configuration=wstools-log4j.xml \
-classpath "$WSPROVIDE_CLASSPATH" \
- org.jboss.ws.tools.jaxws.command.wsprovide "$@"
+ org.jboss.ws.integration.tools.jaxws.command.wsprovide "$@"
Modified: branches/hbraun/trunk/build/etc/wspublish.sh
===================================================================
--- branches/hbraun/trunk/build/etc/wspublish.sh 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/etc/wspublish.sh 2007-05-15 15:38:54 UTC (rev 3100)
@@ -43,6 +43,7 @@
WSPUBLISH_CLASSPATH="$WSPUBLISH_CLASSPATH:$TOMCAT_HOME/common/lib/log4j.jar"
WSPUBLISH_CLASSPATH="$WSPUBLISH_CLASSPATH:$TOMCAT_HOME/common/lib/servlet-api.jar"
+
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
TOMCAT_HOME=`cygpath --path --windows "$TOMCAT_HOME"`
Modified: branches/hbraun/trunk/build/version.properties
===================================================================
--- branches/hbraun/trunk/build/version.properties 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/build/version.properties 2007-05-15 15:38:54 UTC (rev 3100)
@@ -17,7 +17,6 @@
apache-xmlsec=1.3.0
ibm-wsdl4j=1.6.2
javassist=3.5.0.CR1
-jbossws-wsconsume-impl=2.0.0
jbpm-bpel=1.1.0.Beta5
sun-jaxb=2.0.3jboss
stax-api=1.0
@@ -71,6 +70,7 @@
sun-hudson=1.93
sun-jaf=1.1
sun-javamail=1.4
+sun-jaxws=2.0.0
sun-servlet=2.4
woodstox=3.1.1
wscommons-policy=1.0
Modified: branches/hbraun/trunk/jbossws-core/build.xml
===================================================================
--- branches/hbraun/trunk/jbossws-core/build.xml 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/jbossws-core/build.xml 2007-05-15 15:38:54 UTC (rev 3100)
@@ -146,13 +146,23 @@
<jar jarfile="${core.output.lib.dir}/jbossws-integration.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/ws/integration/**"/>
+ <exclude name="org/jboss/ws/integration/tools/**"/>
</fileset>
</jar>
+
+ <!-- Build jbossws-integration.jar -->
+ <mkdir dir="${core.output.lib.dir}"/>
+ <jar jarfile="${core.output.lib.dir}/jbossws-integration-tools.jar" manifest="${build.etc.dir}/default.mf">
+ <fileset dir="${core.output.classes.dir}">
+ <include name="org/jboss/ws/integration/tools/**"/>
+ </fileset>
+ </jar>
<!-- Build jbossws-client.jar -->
<jar jarfile="${core.output.lib.dir}/jbossws-client.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/ws/**"/>
+ <exclude name="org/jboss/ws/integration/tools/**"/>
</fileset>
<fileset dir="${core.resources.dir}/jbossws.sar">
<include name="META-INF/standard-jaxrpc-client-config.xml"/>
@@ -202,6 +212,7 @@
<group title="Core" packages="org.jboss.ws.core*"/>
<group title="Metadata" packages="org.jboss.ws.metadata*"/>
<group title="Integration" packages="org.jboss.ws.integration*"/>
+ <group title="JAXWS Tools" packages="org.jboss.ws.integration.tools*"/>
<group title="Extensions" packages="org.jboss.ws.extensions*"/>
<group title="Tools" packages="org.jboss.ws.tools*"/>
</javadoc>
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,308 @@
+/*
+* 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.tools.jaxws.ant;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+
+/**
+ * Ant task which consumes a Web Service contract.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
+ * <tr><td>catalog</td><td> Oasis XML Catalog file for entity resolution</td><td>none</td></tr>
+ * <tr><td>package</td><td> The target Java package for generated code.</td><td>generated</td></tr>
+ * <tr><td>binding</td><td>A JAX-WS or JAXB binding file</td><td>none</td></tr>
+ * <tr><td>wsdlLocation</td><td>Value to use for @(a)WebService.wsdlLocation</td><td>generated</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
+ * <tr><td>wsdl*</td><td>The WSDL file or URL</td><td>n/a</td><tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <wsconsume
+ * fork="true"
+ * verbose="true"
+ * destdir="output"
+ * sourcedestdir="gen-src"
+ * keep="true"
+ * wsdllocation="handEdited.wsdl"
+ * wsdl="foo.wsdl">
+ * <binding dir="binding-files" includes="*.xml" excludes="bad.xml"/>
+ * </wsimport>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsconsume extends Task
+{
+ private CommandlineJava command = new CommandlineJava();
+ private String wsdl = null;
+ private File destdir = null;
+ private File sourcedestdir = null;
+ private List<File> bindingFiles = new ArrayList<File>();
+ private File catalog = null;
+ private String wsdlLocation = null;
+ private String targetPackage = null;
+ private boolean keep = false;
+ private boolean verbose = false;
+ private boolean fork = false;
+ private boolean debug = false;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setBinding(File bindingFile)
+ {
+ bindingFiles.add(bindingFile);
+ }
+
+ public void setCatalog(File catalog)
+ {
+ this.catalog = catalog;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setPackage(String targetPackage)
+ {
+ this.targetPackage = targetPackage;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setWsdl(String wsdl)
+ {
+ this.wsdl = wsdl;
+ }
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void addConfiguredBinding(FileSet fs)
+ {
+ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+ File baseDir = ds.getBasedir();
+ for (String file : ds.getIncludedFiles())
+ {
+ bindingFiles.add(new File(baseDir, file));
+ }
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader antLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(antLoader);
+ try
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ importer.setGenerateSource(keep);
+ if (destdir != null)
+ importer.setOutputDirectory(destdir);
+ if (sourcedestdir != null)
+ importer.setSourceDirectory(sourcedestdir);
+ if (targetPackage != null)
+ importer.setTargetPackage(targetPackage);
+ if (wsdlLocation != null)
+ importer.setWsdlLocation(wsdlLocation);
+ if (catalog != null)
+ importer.setCatalog(catalog);
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ importer.setBindingFiles(bindingFiles);
+
+ if (verbose)
+ {
+ importer.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
+ log("Generating from wsdl: " + wsdl, Project.MSG_INFO);
+ }
+
+ try
+ {
+ importer.setAdditionalCompilerClassPath(getTaskClassPathStrings());
+ importer.consume(wsdl);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new BuildException(e, getLocation());
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (wsdl == null)
+ throw new BuildException("The wsdl attribute must be specified!", getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private List<String> getTaskClassPathStrings()
+ {
+ // Why is everything in the Ant API a big hack???
+ List<String> strings = new ArrayList<String>();
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ for (String string : ((AntClassLoader)cl).getClasspath().split(File.pathSeparator))
+ strings.add(string);
+ }
+
+ return strings;
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.ws.integration.tools.jaxws.command.wsconsume.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ for (File file : bindingFiles)
+ {
+ command.createArgument().setValue("-b");
+ command.createArgument().setFile(file);
+ }
+
+ if (catalog != null)
+ {
+ command.createArgument().setValue("-c");
+ command.createArgument().setFile(catalog);
+ }
+
+ if (targetPackage != null)
+ {
+ command.createArgument().setValue("-p");
+ command.createArgument().setValue(targetPackage);
+ }
+
+ if (wsdlLocation != null)
+ {
+ command.createArgument().setValue("-w");
+ command.createArgument().setValue(wsdlLocation);
+ }
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(wsdl);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke wsconsume", getLocation());
+ }
+}
\ No newline at end of file
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsconsume.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,266 @@
+/*
+* 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.tools.jaxws.ant;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+
+/**
+ * Ant task which invokes provides a Web Service contract and portable JAX-WS wrapper classes.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
+ * <tr><td>resourcedestdir</td><td>The output directory for resource artifacts (WSDL/XSD).</td><td>value of destdir</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ * <tr><td>genwsdl</td><td>Whether or not to generate WSDL.</td><td>false</td><tr>
+ * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
+ * <tr><td>sei*</td><td>Service Endpoint Implementation.</td><td></td><tr>
+ * <tr><td>classpath</td><td>The classpath that contains the service endpoint implementation.</td><td>""</tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <target name="test-wsproivde" depends="init">
+ * <taskdef name="wsprovide" classname="org.jboss.ws.integration.tools.jaxws.ant.wsprovide">
+ * <classpath refid="core.classpath"/>
+ * </taskdef>
+ * <wsprovide
+ * fork="false"
+ * keep="true"
+ * destdir="out"
+ * resourcedestdir="out-resource"
+ * sourcedestdir="out-source"
+ * genwsdl="true"
+ * verbose="true"
+ * sei="org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrappedServiceImpl">
+ * <classpath>
+ * <pathelement path="${tests.output.dir}/classes"/>
+ * </classpath>
+ * </wsprovide>
+ * </target>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsprovide extends Task
+{
+ private Path classpath = new Path(getProject());
+ private CommandlineJava command = new CommandlineJava();
+ private String sei = null;
+ private File destdir = null;
+ private File resourcedestdir = null;
+ private File sourcedestdir = null;
+ private boolean keep = false;
+ private boolean genwsdl = false;
+ private boolean verbose = false;
+ private boolean fork = false;
+ private boolean debug = false;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setClasspath(Path classpath)
+ {
+ this.classpath = classpath;
+ }
+
+ public void setClasspathRef(Reference ref)
+ {
+ createClasspath().setRefid(ref);
+ }
+
+ public Path createClasspath()
+ {
+ return classpath;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSei(String sei)
+ {
+ this.sei = sei;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setResourcedestdir(File resourcedestdir)
+ {
+ this.resourcedestdir = resourcedestdir;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setGenwsdl(boolean genwsdl)
+ {
+ this.genwsdl = genwsdl;
+ }
+
+ private ClassLoader getClasspathLoader(ClassLoader parent)
+ {
+ return new AntClassLoader(parent, getProject(), classpath, false);
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader antLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(antLoader);
+ try
+ {
+ WSContractProvider gen = WSContractProvider.newInstance();
+ gen.setClassLoader(getClasspathLoader(antLoader));
+ if (verbose)
+ gen.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
+ gen.setGenerateSource(keep);
+ gen.setGenerateWsdl(genwsdl);
+ if (destdir != null)
+ gen.setOutputDirectory(destdir);
+ if (resourcedestdir != null)
+ gen.setResourceDirectory(resourcedestdir);
+ if (sourcedestdir != null)
+ gen.setSourceDirectory(sourcedestdir);
+ if (verbose)
+ log("Generating from endpoint: " + sei, Project.MSG_INFO);
+
+ gen.provide(sei);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (sei == null)
+ throw new BuildException("The sei attribute must be specified!", getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.ws.integration.tools.jaxws.command.wsprovide.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+ path.append(classpath);
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ if (genwsdl)
+ command.createArgument().setValue("-w");
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+ if (resourcedestdir != null)
+ {
+ command.createArgument().setValue("-r");
+ command.createArgument().setFile(resourcedestdir);
+ }
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(sei);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke wsprovide", getLocation());
+ }
+}
\ No newline at end of file
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/ant/wsprovide.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,75 @@
+/*
+* 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.tools.jaxws.api;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Locates a provider.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ *
+ */
+class Locator
+{
+ static <T> T locate(Class<T> providerType, String providerProperty, String defaultProvider, ClassLoader loader)
+ {
+ String provider = null;
+
+ try
+ {
+
+ PrivilegedAction action = new PropertyAccessAction(providerProperty);
+ provider = (String)AccessController.doPrivileged(action);
+ if (provider == null)
+ provider = defaultProvider;
+
+ Class<?> clazz = loader.loadClass(provider);
+ return (T) clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ if (provider == null)
+ throw new IllegalStateException("Failure reading system property: " + providerProperty);
+
+ throw new IllegalStateException("Could not load provider:" + provider);
+ }
+
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/Locator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,178 @@
+/*
+* 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.tools.jaxws.api;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.ws.integration.tools.jaxws.spi.WSContractConsumerFactory;
+
+/**
+ * WSContractConsumer is responsible for generating JAX-WS client and server
+ * artifacts from the specified WSDL file. To implement a client, one would use
+ * the generated ___Service.java file. For a server, one only needs to provide
+ * an implementation class that implements the generated service endpoint
+ * interface.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public abstract class WSContractConsumer
+{
+ private static String DEFAULT_PROVIDER = "org.jboss.ws.integration.tools.jaxws.impl.SunRIConsumerFactoryImpl";
+ public static final String PROVIDER_PROPERTY = "org.jboss.ws.tools.jaxws.SunRIConsumerFactoryImpl";
+
+ /**
+ * Obtain a new instance of a WSContractProvider. This will use the current
+ * thread's context class loader to locate the WSContractProviderFactory
+ * implementation.
+ *
+ * @return a new WSContractProvider
+ */
+ public static WSContractConsumer newInstance()
+ {
+ return newInstance(Thread.currentThread().getContextClassLoader());
+ }
+
+ /**
+ * Obtain a new instance of a WSContractConsumer. The specified ClassLoader will be used to
+ * locate the WebServiceImporterProvide implementation
+ *
+ * @param loader the ClassLoader to use
+ * @return a new WSContractConsumer
+ */
+ public static WSContractConsumer newInstance(ClassLoader loader)
+ {
+ WSContractConsumerFactory provider = Locator.locate(WSContractConsumerFactory.class, PROVIDER_PROPERTY, DEFAULT_PROVIDER, loader);
+ return provider.createConsumer();
+ }
+
+ /**
+ * Specifies the JAX-WS and JAXB binding files to use on import operations.
+ *
+ * @param bindingFiles list of JAX-WS or JAXB binding files
+ */
+ public abstract void setBindingFiles(List<File> bindingFiles);
+
+ /**
+ * Sets the OASIS XML Catalog file to use for entity resolution.
+ *
+ * @param catalog the OASIS XML Catalog file
+ */
+ public abstract void setCatalog(File catalog);
+
+ /**
+ * Sets the main output directory. If the directory does not exist, it will be created.
+ *
+ * @param directory the root directory for generated files
+ */
+ public abstract void setOutputDirectory(File directory);
+
+ /**
+ * Sets the source directory. This directory will contain any generated Java source.
+ * If the directory does not exist, it will be created. If not specified,
+ * the output directory will be used instead.
+ *
+ * @param directory the root directory for generated source code
+ */
+ public abstract void setSourceDirectory(File directory);
+
+ /**
+ * Enables/Disables Java source generation.
+ *
+ * @param generateSource whether or not to generate Java source.
+ */
+ public abstract void setGenerateSource(boolean generateSource);
+
+
+ /**
+ * Sets the target package for generated source. If not specified the default
+ * is based off of the XML namespace.
+ *
+ * @param targetPackage the target package for generated source
+ */
+ public abstract void setTargetPackage(String targetPackage);
+
+ /**
+ * Sets the @(a)WebService.wsdlLocation and @(a)WebServiceClient.wsdlLocation attributes to a custom value.
+ *
+ * @param wsdlLocation the custom WSDL location to use in generated source
+ */
+ public abstract void setWsdlLocation(String wsdlLocation);
+
+ /**
+ * Sets the PrintStream to use for status feedback. The simplest example
+ * would be to use System.out.
+ *
+ * @param messageStream the stream to use for status messages:
+ */
+ public abstract void setMessageStream(PrintStream messageStream);
+
+
+ /**
+ * Sets the additional classpath to use if/when invoking the Java compiler.
+ * Typically an implementation will use the system <code>java.class.path</code>
+ * property. So for most normal applications this method is not needed. However,
+ * if this API is being used from an isolated classloader, then it needs to
+ * be called in order to reference all jars that are required by the
+ * implementation.
+ *
+ * @param classPath a list of strings where each entry references a
+ * single jar or directory
+ */
+ public abstract void setAdditionalCompilerClassPath(List<String> classPath);
+
+ /**
+ * Generate the required artifacts using the specified WSDL URL. This method
+ * may be called more than once, although this is probably not desireable
+ *
+ * @param wsdl the URL of the WSDL
+ */
+ public abstract void consume(URL wsdl);
+
+ /**
+ * Generate the required artifacts using the specified WSDL. This method
+ * may be called more than once, although this is probably not desireable.
+ * The passed string is expect to either be a valid URL, or a local file path.
+ *
+ * @param wsdl a URL or local file path
+ * @throws MalformedURLException if wsdl is not a legal URL or local file
+ */
+ public void consume(String wsdl) throws MalformedURLException
+ {
+ URL url = null;
+ try
+ {
+ url = new URL(wsdl);
+ }
+ catch (MalformedURLException e)
+ {
+ File file = new File(wsdl);
+ url = file.toURL();
+ }
+
+ consume(url);
+ }
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractConsumer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,150 @@
+package org.jboss.ws.integration.tools.jaxws.api;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.integration.tools.jaxws.spi.WSContractProviderFactory;
+
+
+/**
+ * WSContractProvider is responsible for generating the required portable
+ * JAX-WS artifacts for a service endpoint implementation. This includes class
+ * files for wrapper types and fault beans. WSDL may be optionally generated as
+ * well using this API.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ *
+ * <p>The following example generates class files, source files and WSDL for an
+ * endpoint:</p>
+ * <pre>
+ * WSContractProvider provider = WSContractProvider.newInstance();
+ * provider.setGenerateSource(true);
+ * provider.setGenerateWsdl(true);
+ * provider.setOutputDirectory(new File("output"));
+ * provider.setMessageStream(System.out);
+ * provider.provide(TestMe.class);
+ * </pre>
+ *
+ * <p>Thread-Safety:</p>
+ * This class expects to be thread-confined, so it can not be shared between threads.
+ */
+public abstract class WSContractProvider
+{
+ private static String DEFAULT_PROVIDER = "org.jboss.ws.integration.tools.jaxws.impl.JBossWSProviderFactoryImpl";
+ public static final String PROVIDER_PROPERTY = "org.jboss.ws.tools.jaxws.JBossWSProviderFactoryImpl";
+
+ protected WSContractProvider()
+ {
+
+ }
+
+ /**
+ * Obtain a new instance of a WSContractProvider. This will use the current
+ * thread's context class loader to locate the WSContractProviderFactory
+ * implementation.
+ *
+ * @return a new WSContractProvider
+ */
+ public static WSContractProvider newInstance()
+ {
+ return newInstance(Thread.currentThread().getContextClassLoader());
+ }
+
+ /**
+ * Obtain a new instance of a WSContractProvider. The specified ClassLoader will be used to
+ * locate the WSContractProviderFactory implementation
+ *
+ * @param loader the ClassLoader to use
+ * @return a new WSContractProvider
+ */
+ public static WSContractProvider newInstance(ClassLoader loader)
+ {
+ WSContractProviderFactory provider = Locator.locate(WSContractProviderFactory.class, PROVIDER_PROPERTY, DEFAULT_PROVIDER, loader);
+ return provider.createProvider(loader);
+ }
+
+ /**
+ * Enables/Disables WSDL generation.
+ *
+ * @param generateWsdl whether or not to generate WSDL
+ */
+ public abstract void setGenerateWsdl(boolean generateWsdl);
+
+ /**
+ * Enables/Disables Java source generation.
+ *
+ * @param generateSource whether or not to generate Java source.
+ */
+ public abstract void setGenerateSource(boolean generateSource);
+
+ /**
+ * Sets the main output directory. If the directory does not exist, it will be created.
+ *
+ * @param directory the root directory for generated files
+ */
+ public abstract void setOutputDirectory(File directory);
+
+ /**
+ * Sets the resource directory. This directory will contain any generated
+ * WSDL and XSD files. If the directory does not exist, it will be created.
+ * If not specified, the output directory will be used instead.
+ *
+ * @param directory the root directory for generated resource files
+ */
+ public abstract void setResourceDirectory(File directory);
+
+ /**
+ * Sets the source directory. This directory will contain any generated Java source.
+ * If the directory does not exist, it will be created. If not specified,
+ * the output directory will be used instead.
+ *
+ * @param directory the root directory for generated source code
+ */
+ public abstract void setSourceDirectory(File directory);
+
+ /**
+ * Sets the ClassLoader used to discover types. This defaults to the one used
+ * in instantiation.
+ *
+ * @param loader the ClassLoader to use
+ */
+ public abstract void setClassLoader(ClassLoader loader);
+
+ /**
+ * Generates artifacts using the current settings. This method may be invoked
+ * more than once (e.g. multiple endpoints).
+ *
+ * @param endpointClass the name of the endpoint implementation bean
+ * @throws WSException if any error occurs during processing, or the class is not found
+ */
+ public abstract void provide(String endpointClass);
+
+ /**
+ * Generates artifacts using the current settings. This method may be invoked
+ * more than once (e.g. multiple endpoints).
+ *
+ * @param endpointClass the endpoint implementation bean
+ * @throws WSException if any error occurs during processing
+ */
+ public abstract void provide(Class<?> endpointClass);
+
+ /**
+ * Sets the PrintStream to use for status feedback. The simplest example
+ * would be to use System.out.
+ *
+ * <p>Example output:</p>
+ * <pre>
+ * Generating WSDL:
+ * TestMeService.wsdl
+ * Writing Source:
+ * org/jboss/ws/tools/jaxws/TestMe.java
+ * org/jboss/ws/tools/jaxws/TestMeResponse.java
+ * Writing Classes:
+ * org/jboss/ws/tools/jaxws/TestMe.class
+ * org/jboss/ws/tools/jaxws/TestMeResponse.class
+ * </pre>
+ * @param messageStream the stream to use for status messages:
+ */
+ public abstract void setMessageStream(PrintStream messageStream);
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/api/WSContractProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,234 @@
+/*
+ * 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.tools.jaxws.command;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+
+/**
+ * wsconsume is a command line tool that generates portable JAX-WS artifacts
+ * from a WSDL file.
+ *
+ * <pre>
+ * usage: wsconsume [options] <wsdl-url>
+ * options:
+ * -h, --help Show this help message
+ * -b, --binding=<file> One or more JAX-WS or JAXB binding files
+ * -k, --keep Keep/Generate Java source
+ * -c --catalog=<file> Oasis XML Catalog file for entity resolution
+ * -p --package=<name> The target package for generated source
+ * -w --wsdlLocation=<loc> Value to use for @(a)WebService.wsdlLocation
+ * -o, --output=<directory> The directory to put generated artifacts
+ * -s, --source=<directory> The directory to put Java source
+ * -q, --quiet Be somewhat more quiet
+ * -t, --show-traces Show full exception stack traces
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsconsume
+{
+ private List<File> bindingFiles = new ArrayList<File>();
+ private boolean generateSource = false;
+ private File catalog = null;
+ private String targetPackage = null;
+ private String wsdlLocation = null;
+ private boolean quiet = false;
+ private boolean showTraces = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+
+ public static String PROGRAM_NAME = System.getProperty("program.name", wsconsume.class.getName());
+
+ public static void main(String[] args)
+ {
+ wsconsume importer = new wsconsume();
+ URL wsdl = importer.parseArguments(args);
+ System.exit(importer.importServices(wsdl));
+ }
+
+ private URL parseArguments(String[] args)
+ {
+ String shortOpts = "hb:kc:p:w:o:s:qt";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("catalog", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("package", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
+ new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'b':
+ bindingFiles.add(new File(getopt.getOptarg()));
+ break;
+ case 'k':
+ generateSource = true;
+ break;
+ case 'c':
+ catalog = new File(getopt.getOptarg());
+ break;
+ case 'p':
+ targetPackage = getopt.getOptarg();
+ break;
+ case 'w':
+ wsdlLocation = getopt.getOptarg();
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ int wsdlPos = getopt.getOptind();
+ if (wsdlPos >= args.length)
+ {
+ System.err.println("Error: WSDL URL was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ URL url = null;
+ try
+ {
+ try
+ {
+ url = new URL(args[wsdlPos]);
+ }
+ catch (MalformedURLException e)
+ {
+ File file = new File(args[wsdlPos]);
+ url = file.toURL();
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: Invalid URI: " + args[wsdlPos]);
+ System.exit(1);
+ }
+
+ return url;
+ }
+
+
+ private int importServices(URL wsdl)
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ importer.setGenerateSource(generateSource);
+ importer.setOutputDirectory(outputDir);
+ if (sourceDir != null)
+ importer.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ importer.setMessageStream(System.out);
+
+ if (catalog != null)
+ importer.setCatalog(catalog);
+
+ if (targetPackage != null)
+ importer.setTargetPackage(targetPackage);
+
+ if (wsdlLocation != null)
+ importer.setWsdlLocation(wsdlLocation);
+
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ importer.setBindingFiles(bindingFiles);
+
+ try
+ {
+ importer.consume(wsdl);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not import. (use --show-traces to see full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("wsconsume is a command line tool that generates portable JAX-WS artifacts from a WSDL file.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <wsdl-url>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -b, --binding=<file> One or more JAX-WS or JAXB binding files ");
+ out.println(" -k, --keep Keep/Generate Java source");
+ out.println(" -c --catalog=<file> Oasis XML Catalog file for entity resolution");
+ out.println(" -p --package=<name> The target package for generated source");
+ out.println(" -w --wsdlLocation=<loc> Value to use for @WebService.wsdlLocation");
+ out.println(" -o, --output=<directory> The directory to put generated artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java source");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack traces");
+ out.flush();
+ }
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsconsume.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,225 @@
+/*
+ * 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.tools.jaxws.command;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+
+/**
+ * wsprovide is a command line tool that generates portable JAX-WS artifacts
+ * for a service endpoint implementation.
+ *
+ * <pre>
+ * usage: wsprovide [options] <endpoint class name>
+ * options:
+ * -h, --help Show this help message
+ * -k, --keep Keep/Generate Java source
+ * -w, --wsdl Enable WSDL file generation
+ * -c. --classpath=<path< The classpath that contains the endpoint
+ * -o, --output=<directory> The directory to put generated artifacts
+ * -r, --resource=<directory> The directory to put resource artifacts
+ * -s, --source=<directory> The directory to put Java source
+ * -q, --quiet Be somewhat more quiet
+ * -t, --show-traces Show full exception stack traces
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsprovide
+{
+ private boolean generateSource = false;
+ private boolean generateWsdl = false;
+ private boolean quiet = false;
+ private boolean showTraces = false;
+ private ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ private File outputDir = new File("output");
+ private File resourceDir = null;
+ private File sourceDir = null;
+
+ public static String PROGRAM_NAME = System.getProperty("program.name", wsprovide.class.getSimpleName());
+
+ public static void main(String[] args)
+ {
+ wsprovide generate = new wsprovide();
+ String endpoint = generate.parseArguments(args);
+ System.exit(generate.generate(endpoint));
+ }
+
+ private String parseArguments(String[] args)
+ {
+ String shortOpts = "hwko:r:s:c:qt";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("wsdl", LongOpt.NO_ARGUMENT, null, 'w'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'k':
+ generateSource = true;
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'r':
+ resourceDir = new File(getopt.getOptarg());
+ break;
+ case 'w':
+ generateWsdl = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 'c':
+ processClassPath(getopt.getOptarg());
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ int endpointPos = getopt.getOptind();
+ if (endpointPos >= args.length)
+ {
+ System.err.println("Error: endpoint implementation was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ return args[endpointPos];
+ }
+
+
+ private int generate(String endpoint)
+ {
+ if (!JavaUtils.isLoaded(endpoint, loader))
+ {
+ System.err.println("Error: Could not load class [" + endpoint + "]. Did you specify a valid --classpath?");
+ return 1;
+ }
+
+ WSContractProvider gen = WSContractProvider.newInstance(loader);
+ gen.setGenerateWsdl(generateWsdl);
+ gen.setGenerateSource(generateSource);
+ gen.setOutputDirectory(outputDir);
+ if (resourceDir != null)
+ gen.setResourceDirectory(resourceDir);
+ if (sourceDir != null)
+ gen.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ gen.setMessageStream(System.out);
+
+ try
+ {
+ gen.provide(endpoint);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not generate. (use --show-traces to see full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private void processClassPath(String classPath)
+ {
+ String[] entries = classPath.split(File.pathSeparator);
+ List<URL> urls= new ArrayList<URL>(entries.length);
+ for (String entry : entries)
+ {
+ try
+ {
+ urls.add(new File(entry).toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: a classpath entry was malformed: " + entry);
+ }
+ }
+ loader = new URLClassLoader(urls.toArray(new URL[0]), loader);
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("wsprovide generates portable JAX-WS artifacts for an endpoint implementation.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <endpoint class name>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -k, --keep Keep/Generate Java source");
+ out.println(" -w, --wsdl Enable WSDL file generation");
+ out.println(" -c. --classpath=<path> The classpath that contains the endpoint");
+ out.println(" -o, --output=<directory> The directory to put generated artifacts");
+ out.println(" -r, --resource=<directory> The directory to put resource artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java source");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack traces");
+ out.flush();
+ }
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/command/wsprovide.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javassist.CannotCompileException;
+import javassist.NotFoundException;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+public class BytecodeWrapperGenerator extends DynamicWrapperGenerator implements WritableWrapperGenerator
+{
+ private List<String> typeNames = new ArrayList<String>();
+ PrintStream stream;
+
+ public BytecodeWrapperGenerator(ClassLoader loader, PrintStream stream)
+ {
+ super(loader);
+ this.stream = stream;
+ prune = false;
+ }
+
+ @Override
+ public void reset(ClassLoader loader)
+ {
+ super.reset(loader);
+ typeNames.clear();
+ }
+
+ @Override
+ public void generate(FaultMetaData fmd)
+ {
+ super.generate(fmd);
+
+ typeNames.add(fmd.getFaultBeanName());
+ }
+
+ @Override
+ public void generate(ParameterMetaData pmd)
+ {
+ super.generate(pmd);
+
+ typeNames.add(pmd.getJavaTypeName());
+ }
+
+ public void write(File directory) throws IOException
+ {
+ stream.println("Writing Classes:");
+ for (String name : typeNames)
+ {
+ try
+ {
+ stream.println(name.replace('.', '/') + ".class");
+ pool.get(name).writeFile(directory.getAbsolutePath());
+ }
+ catch (CannotCompileException e)
+ {
+ throw new WSException(e);
+ }
+ catch (NotFoundException e)
+ {
+ throw new WSException(e);
+ }
+ }
+ }
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/BytecodeWrapperGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,81 @@
+/*
+ * 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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+public class ChainedWritableWrapperGenerator implements WrapperGenerator
+{
+ private List<Entry> chain = new ArrayList<Entry>();
+
+ static class Entry
+ {
+ Entry(WritableWrapperGenerator generator, File directory)
+ {
+ this.generator = generator;
+ this.directory = directory;
+ }
+
+ WritableWrapperGenerator generator;
+ File directory;
+ }
+
+ public ChainedWritableWrapperGenerator()
+ {
+ }
+
+ public void reset(ClassLoader loader)
+ {
+ for (Entry entry : chain)
+ entry.generator.reset(loader);
+ }
+
+ public void write() throws IOException
+ {
+ for (Entry entry : chain)
+ entry.generator.write(entry.directory);
+ }
+
+ public void generate(FaultMetaData fmd)
+ {
+ for (Entry entry : chain)
+ entry.generator.generate(fmd);
+ }
+
+ public void generate(ParameterMetaData pmd)
+ {
+ for (Entry entry : chain)
+ entry.generator.generate(pmd);
+ }
+
+ public void add(WritableWrapperGenerator generator, File directory)
+ {
+ chain.add(new Entry(generator, directory));
+ }
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,39 @@
+/*
+ * 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.tools.jaxws.impl;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+import org.jboss.ws.integration.tools.jaxws.spi.WSContractProviderFactory;
+
+/**
+ * Creates a JBossWS WSContractProvider implementation.
+ * @see org.jboss.ws.integration.tools.jaxws.impl.JBossWSProviderImpl
+ */
+public class JBossWSProviderFactoryImpl implements WSContractProviderFactory
+{
+ public WSContractProvider createProvider(ClassLoader loader)
+ {
+ JBossWSProviderImpl impl = new JBossWSProviderImpl();
+ impl.setClassLoader(loader);
+ return impl;
+ }
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,183 @@
+/*
+* 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.tools.jaxws.impl;
+
+import static org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB3;
+import static org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import javax.ejb.Stateless;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.integration.ResourceLoaderAdapter;
+import org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+
+/**
+ * The default WSContractProvider implementation.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+final class JBossWSProviderImpl extends WSContractProvider
+{
+ private ClassLoader loader;
+ private boolean generateWsdl = false;
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File resourceDir = null;
+ private File sourceDir = null;
+ private PrintStream messageStream = new NullPrintStream();
+
+ private void createDirectories(File resourceDir, File sourceDir)
+ {
+ if (!outputDir.exists())
+ if (!outputDir.mkdirs())
+ throw new WSException("Could not create directory: " + outputDir);
+
+ if (generateWsdl && !resourceDir.exists())
+ if (!resourceDir.mkdirs())
+ throw new WSException("Could not create directory: " + resourceDir);
+
+ if (generateSource && !sourceDir.exists())
+ if (!sourceDir.mkdirs())
+ throw new WSException("Could not create directory: " + sourceDir);
+ }
+
+ private UnifiedDeploymentInfo createUDI(Class<?> endpointClass, ClassLoader loader)
+ {
+ DeploymentType type = (endpointClass.isAnnotationPresent(Stateless.class)) ? JAXWS_EJB3 : JAXWS_JSE;
+ UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo(type)
+ {
+ @Override
+ public URL getMetaDataFileURL(String resourcePath) throws IOException
+ {
+ return null;
+ }
+ };
+ udi.classLoader = loader;
+ return udi;
+ }
+
+ @Override
+ public void provide(Class<?> endpointClass)
+ {
+ // Use the output directory as the default
+ File resourceDir = (this.resourceDir != null) ? this.resourceDir : outputDir;
+ File sourceDir = (this.sourceDir != null) ? this.sourceDir : outputDir;
+
+ createDirectories(resourceDir, sourceDir);
+
+ // Create a dummy classloader to catch generated classes
+ ClassLoader loader = new URLClassLoader(new URL[0], this.loader);
+ UnifiedMetaData umd = new UnifiedMetaData(new ResourceLoaderAdapter(loader));
+ umd.setClassLoader(loader);
+
+ ChainedWritableWrapperGenerator generator = new ChainedWritableWrapperGenerator();
+ if (generateSource)
+ generator.add(new SourceWrapperGenerator(loader, messageStream), sourceDir);
+ generator.add(new BytecodeWrapperGenerator(loader, messageStream), outputDir);
+
+ JAXWSWebServiceMetaDataBuilder builder = new JAXWSWebServiceMetaDataBuilder();
+ builder.setWrapperGenerator(generator);
+ builder.setGenerateWsdl(generateWsdl);
+ builder.setToolMode(true);
+ builder.setWsdlDirectory(resourceDir);
+ builder.setMessageStream(messageStream);
+
+ if (generateWsdl)
+ messageStream.println("Generating WSDL:");
+
+ UnifiedDeploymentInfo udi = createUDI(endpointClass, loader);
+ builder.buildWebServiceMetaData(umd, udi, endpointClass, null);
+ try
+ {
+ generator.write();
+ }
+ catch (IOException io)
+ {
+ throw new WSException("Could not write output files:", io);
+ }
+ }
+
+ @Override
+ public void provide(String endpointClass)
+ {
+ try
+ {
+ provide(loader.loadClass(endpointClass));
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new WSException("Class not found: " + endpointClass);
+ }
+ }
+
+ @Override
+ public void setClassLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ }
+
+ @Override
+ public void setGenerateWsdl(boolean generateWsdl)
+ {
+ this.generateWsdl = generateWsdl;
+ }
+
+ @Override
+ public void setOutputDirectory(File directory)
+ {
+ outputDir = directory;
+ }
+
+ @Override
+ public void setGenerateSource(boolean generateSource)
+ {
+ this.generateSource = generateSource;
+ }
+
+ @Override
+ public void setResourceDirectory(File directory)
+ {
+ resourceDir = directory;
+ }
+
+ @Override
+ public void setSourceDirectory(File directory)
+ {
+ sourceDir = directory;
+ }
+
+ @Override
+ public void setMessageStream(PrintStream messageStream)
+ {
+ this.messageStream = messageStream;
+ }
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/JBossWSProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,209 @@
+/*
+ * 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.tools.jaxws.impl;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Locale;
+
+class NullPrintStream extends PrintStream
+{
+ NullPrintStream()
+ {
+ // Doesn't actually do anything
+ super(new ByteArrayOutputStream());
+ }
+
+ @Override
+ public PrintStream append(char c)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq, int start, int end)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq)
+ {
+ return this;
+ }
+
+ @Override
+ public boolean checkError()
+ {
+ return false;
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ @Override
+ public void flush()
+ {
+ }
+
+ @Override
+ public PrintStream format(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream format(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void print(boolean b)
+ {
+ }
+
+ @Override
+ public void print(char c)
+ {
+ }
+
+ @Override
+ public void print(char[] s)
+ {
+ }
+
+ @Override
+ public void print(double d)
+ {
+ }
+
+ @Override
+ public void print(float f)
+ {
+ }
+
+ @Override
+ public void print(int i)
+ {
+ }
+
+ @Override
+ public void print(long l)
+ {
+ }
+
+ @Override
+ public void print(Object obj)
+ {
+ }
+
+ @Override
+ public void print(String s)
+ {
+ }
+
+ @Override
+ public PrintStream printf(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream printf(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void println()
+ {
+ }
+
+ @Override
+ public void println(boolean x)
+ {
+ }
+
+ @Override
+ public void println(char x)
+ {
+ }
+
+ @Override
+ public void println(char[] x)
+ {
+ }
+
+ @Override
+ public void println(double x)
+ {
+ }
+
+ @Override
+ public void println(float x)
+ {
+ }
+
+ @Override
+ public void println(int x)
+ {
+ }
+
+ @Override
+ public void println(long x)
+ {
+ }
+
+ @Override
+ public void println(Object x)
+ {
+ }
+
+ @Override
+ public void println(String x)
+ {
+ }
+
+ @Override
+ protected void setError()
+ {
+ }
+
+ @Override
+ public void write(byte[] buf, int off, int len)
+ {
+ }
+
+ @Override
+ public void write(int b)
+ {
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException
+ {
+ }
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/NullPrintStream.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.List;
+import java.util.SortedMap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.AbstractWrapperGenerator;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+
+import com.sun.codemodel.JAnnotationArrayMember;
+import com.sun.codemodel.JAnnotationUse;
+import com.sun.codemodel.JCodeModel;
+import com.sun.codemodel.JDefinedClass;
+import com.sun.codemodel.JExpr;
+import com.sun.codemodel.JFieldVar;
+import com.sun.codemodel.JMethod;
+import com.sun.codemodel.JMod;
+
+/**
+ * Generates source for wrapper beans
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class SourceWrapperGenerator extends AbstractWrapperGenerator implements WritableWrapperGenerator
+{
+ private static Logger log = Logger.getLogger(SourceWrapperGenerator.class);
+ private PrintStream stream;
+ private JCodeModel codeModel;
+
+
+ public SourceWrapperGenerator(ClassLoader loader, PrintStream stream)
+ {
+ super(loader);
+ this.stream = stream;
+ codeModel = new JCodeModel();
+ }
+
+ @Override
+ public void reset(ClassLoader loader)
+ {
+ super.reset(loader);
+ codeModel = new JCodeModel();
+ }
+
+ public void write(File directory) throws IOException
+ {
+ stream.println("Writing Source:");
+ codeModel.build(directory, stream);
+ }
+
+ public void generate(ParameterMetaData pmd)
+ {
+ List<WrappedParameter> wrappedParameters = pmd.getWrappedParameters();
+ OperationMetaData operationMetaData = pmd.getOperationMetaData();
+
+ if (operationMetaData.isDocumentWrapped() == false)
+ throw new WSException("Operation is not document/literal (wrapped)");
+
+ if (wrappedParameters == null)
+ throw new WSException("Cannot generate a type when their is no type information");
+
+ String wrapperName = pmd.getJavaTypeName();
+ if (log.isDebugEnabled())
+ if(log.isDebugEnabled()) log.debug("Generating wrapper: " + wrapperName);
+
+ try
+ {
+
+ JDefinedClass clazz = codeModel._class(wrapperName);
+ addClassAnnotations(clazz, pmd.getXmlName(), pmd.getXmlType(), null);
+ for (WrappedParameter wrapped : wrappedParameters)
+ {
+ addProperty(clazz, wrapped.getType(), wrapped.getName(), wrapped.getVariable());
+ }
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not generate wrapper type: " + wrapperName, e);
+ }
+ }
+ public void generate(FaultMetaData fmd)
+ {
+ String faultBeanName = fmd.getFaultBeanName();
+ Class exception = fmd.getJavaType();
+
+ try
+ {
+ SortedMap<String, Class<?>> properties = getExceptionProperties(exception);
+ String[] propertyOrder = properties.keySet().toArray(new String[0]);
+
+ JDefinedClass clazz = codeModel._class(faultBeanName);
+ addClassAnnotations(clazz, fmd.getXmlName(), fmd.getXmlType(), propertyOrder);
+
+ for (String property : propertyOrder)
+ addProperty(clazz, properties.get(property).getName(), new QName(property), property);
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not generate wrapper type: " + faultBeanName, e);
+ }
+ }
+
+ private static String getterPrefix(Class type)
+ {
+ return Boolean.TYPE == type || Boolean.class == type ? "is" : "get";
+ }
+
+ private void addProperty(JDefinedClass clazz, String typeName, QName name, String variable)
+ throws ClassNotFoundException
+ {
+ Class type = JavaUtils.loadJavaType(typeName, loader);
+ JFieldVar field = clazz.field(JMod.PRIVATE, type, variable);
+ JAnnotationUse annotation = field.annotate(XmlElement.class);
+ if (name.getNamespaceURI() != null)
+ annotation.param("namespace", name.getNamespaceURI());
+ annotation.param("name", name.getLocalPart());
+
+ // Add acessor methods
+ JMethod method = clazz.method(JMod.PUBLIC, type, getterPrefix(type) + JavaUtils.capitalize(variable));
+ method.body()._return(JExpr._this().ref(variable));
+
+ method = clazz.method(JMod.PUBLIC, type, "set" + JavaUtils.capitalize(variable));
+ method.body().assign(JExpr._this().ref(variable), method.param(type, variable));
+ }
+
+ private static void addClassAnnotations(JDefinedClass clazz, QName xmlName, QName xmlType, String[] propertyOrder)
+ {
+ JAnnotationUse annotation = clazz.annotate(XmlRootElement.class);
+ if (xmlName.getNamespaceURI() != null && xmlName.getNamespaceURI().length() > 0)
+ annotation.param("namespace", xmlName.getNamespaceURI());
+ annotation.param("name", xmlName.getLocalPart());
+
+ annotation = clazz.annotate(XmlType.class);
+ if (xmlType.getNamespaceURI() != null & xmlType.getNamespaceURI().length() > 0)
+ annotation.param("namespace", xmlType.getNamespaceURI());
+ annotation.param("name", xmlType.getLocalPart());
+ if (propertyOrder != null)
+ {
+ JAnnotationArrayMember paramArray = annotation.paramArray("propOrder");
+ for (String property : propertyOrder)
+ paramArray.param(property);
+ }
+
+ annotation = clazz.annotate(XmlAccessorType.class);
+ annotation.param("value", XmlAccessType.FIELD);
+ }
+}
\ No newline at end of file
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SourceWrapperGenerator.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,39 @@
+/*
+* 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.tools.jaxws.impl;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+import org.jboss.ws.integration.tools.jaxws.spi.WSContractConsumerFactory;
+
+/**
+ * Creates a WSContractConsumer that delegates to the Sun RI.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision:2311 $
+ */
+public class SunRIConsumerFactoryImpl implements WSContractConsumerFactory
+{
+ public WSContractConsumer createConsumer() {
+ return new SunRIConsumerImpl();
+ }
+}
+
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.sun.tools.ws.wscompile.CompileTool;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+
+/**
+ * WSContractConsumer that delegates to the Sun CompileTool.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class SunRIConsumerImpl extends WSContractConsumer
+{
+ private List<File> bindingFiles = null;
+ private File catalog = null;
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+ private String targetPackage = null;
+ private PrintStream messageStream = null;
+ private String wsdlLocation = null;
+ private List<String> additionalCompilerClassPath = null;
+
+ @Override
+ public void setBindingFiles(List<File> bindingFiles) {
+ this.bindingFiles = bindingFiles;
+ }
+
+ @Override
+ public void setCatalog(File catalog) {
+ this.catalog = catalog;
+ }
+
+ @Override
+ public void setGenerateSource(boolean generateSource) {
+ this.generateSource = generateSource;
+ }
+
+ @Override
+ public void setMessageStream(PrintStream messageStream) {
+ // TODO Auto-generated method stub
+ this.messageStream = messageStream;
+ }
+
+ @Override
+ public void setOutputDirectory(File directory) {
+ // TODO Auto-generated method stub
+ outputDir = directory;
+ }
+
+ @Override
+ public void setSourceDirectory(File directory) {
+ sourceDir = directory;
+ }
+
+ @Override
+ public void setTargetPackage(String targetPackage) {
+ this.targetPackage = targetPackage;
+ }
+
+ @Override
+ public void setWsdlLocation(String wsdlLocation) {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void setAdditionalCompilerClassPath(List<String> additionalCompilerClassPath) {
+ this.additionalCompilerClassPath = additionalCompilerClassPath;
+ }
+
+ @Override
+ public void consume(URL wsdl) {
+ List<String> args = new ArrayList<String>();
+ if (bindingFiles != null) {
+ for (File file : bindingFiles) {
+ args.add("-b");
+ args.add(file.getAbsolutePath());
+
+ }
+ }
+
+ if (catalog != null) {
+ args.add("-catalog");
+ args.add(catalog.getAbsolutePath());
+ }
+
+ if (generateSource) {
+ args.add("-keep");
+ if (sourceDir != null) {
+ if (!sourceDir.exists() && !sourceDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
+
+ args.add("-s");
+ args.add(sourceDir.getAbsolutePath());
+ }
+ }
+
+ if (targetPackage != null) {
+ args.add("-p");
+ args.add(targetPackage);
+ }
+
+ if (wsdlLocation != null) {
+ args.add("-wsdllocation");
+ args.add(wsdlLocation);
+ }
+
+ PrintStream stream = messageStream;
+ if (stream != null) {
+ args.add("-verbose");
+ } else {
+ stream = new NullPrintStream();
+ }
+
+ if (!outputDir.exists() && !outputDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + outputDir.getName());
+
+ // Always add the output directory and the wsdl location
+ args.add("-d");
+ args.add(outputDir.getAbsolutePath());
+ args.add(wsdl.toString());
+
+ // WSToolsObjectFactory tools = WSToolsObjectFactory.newInstance();
+ // tools.wsimport(stream, args.toArray(new String[0]));
+
+ // We have to manipulate internals since they don't expose a way to set
+ // the classpath that is used for compilation
+ CompileTool tool = new CompileTool(stream, "wsimport") {
+ @Override
+ public boolean run(String[] args) {
+ StringBuilder builder = new StringBuilder();
+ if (additionalCompilerClassPath != null && additionalCompilerClassPath.size() > 0) {
+ for (String entry : additionalCompilerClassPath)
+ builder.append(entry).append(File.pathSeparatorChar);
+ builder.setLength(builder.length() - 1);
+ }
+ userClasspath = builder.toString();
+ return super.run(args);
+ }
+ };
+ tool.run(args.toArray(new String[0]));
+ }
+}
+
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/SunRIConsumerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,32 @@
+/*
+ * 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.tools.jaxws.impl;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+
+public interface WritableWrapperGenerator extends WrapperGenerator
+{
+ public void write(File directory) throws IOException;
+}
\ No newline at end of file
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/impl/WritableWrapperGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,40 @@
+/*
+ * 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.tools.jaxws.spi;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractConsumer;
+
+/**
+ * WSContractConsumerFactory defines the contract for a WSContractConsumer factory.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public interface WSContractConsumerFactory
+{
+ /**
+ * Create a new WSContractConsumer. There are no restrictions on how this
+ * should be performed.
+ *
+ * @return a new WSContractConsumer
+ */
+ public WSContractConsumer createConsumer();
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractConsumerFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -0,0 +1,43 @@
+/*
+ * 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.tools.jaxws.spi;
+
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
+
+/**
+ * WSContractProviderFactory defines the contract for a WSContractProvider factory.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public interface WSContractProviderFactory
+{
+ /**
+ * Create a new WSContractProvider. There are no restrictions on how this
+ * should be performed. The passed ClassLoader is the one used in
+ * {@link WSContractProvider#newInstance(ClassLoader)}. This loader
+ * should be made available to the generated WSContractProvider.
+ *
+ * @param loader the ClassLoader for type discovery
+ * @return a new WSContractProvider
+ */
+ public WSContractProvider createProvider(ClassLoader loader);
+}
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/integration/tools/jaxws/spi/WSContractProviderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -52,7 +52,7 @@
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.ws.tools.ToolsUtils;
-import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
+import org.jboss.ws.tools.wsdl.JAXBWSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
Added: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java (rev 0)
+++ branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -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.tools.wsdl;
+
+import java.io.IOException;
+
+import javax.xml.bind.SchemaOutputResolver;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.dom.DOMResult;
+
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.metadata.wsdl.DOMTypes;
+import org.jboss.ws.tools.wsdl.WSDLGenerator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+
+/**
+ * JAXBWSDLGenerator provides a JAXB based WSDLGenerator.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public class JAXBWSDLGenerator extends WSDLGenerator
+{
+ private JAXBRIContext ctx;
+
+ public JAXBWSDLGenerator(JAXBRIContext ctx)
+ {
+ super();
+ this.ctx = ctx;
+ }
+
+ protected void processTypes()
+ {
+ // Register namespaces
+ for (String ns : ctx.getKnownNamespaceURIs())
+ if (ns.length() > 0)
+ wsdl.registerNamespaceURI(ns, null);
+
+ try
+ {
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document doc = builder.newDocument();
+ DOMTypes types = new DOMTypes(doc);
+ final Element element = types.getElement();
+ final Element throwAway = doc.createElement("throw-away");
+
+ ctx.generateSchema(new SchemaOutputResolver()
+ {
+ @Override
+ public Result createOutput(String namespace, String file) throws IOException
+ {
+ // JBWS-1295, getKnownNamespaceURIs is not accurate
+ if (namespace.length() > 0 && wsdl.getPrefix(namespace) == null)
+ wsdl.registerNamespaceURI(namespace, null);
+
+ // JAXB creates an empty namespace due to type references, ignore it
+ DOMResult result = new DOMResult((namespace == null || namespace.length() == 0) ? throwAway : element);
+ result.setSystemId("replace-me");
+ return result;
+ }
+ });
+
+ // Until we stop inlining schema, we will need to filter schemaLocations since JAXB requires them
+ removeSchemaLocations(element);
+
+ wsdl.setWsdlTypes(types);
+ }
+ catch (Exception exception)
+ {
+ throw new WSException("Could not generate schema: " + exception.getMessage(), exception);
+ }
+ }
+
+ private void removeSchemaLocations(Element element)
+ {
+ for (Element child = Util.getFirstChildElement(element); child != null; child = Util.getNextSiblingElement(child))
+ {
+ if ("import".equals(child.getLocalName()) && Constants.NS_SCHEMA_XSD.equals(child.getNamespaceURI()) && "replace-me".equals(child.getAttribute("schemaLocation")))
+ {
+ child.removeAttribute("schemaLocation");
+ }
+ else
+ {
+ removeSchemaLocations(child);
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: branches/hbraun/trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/hbraun/trunk/jbossws-core/src/resources/samples/build.xml
===================================================================
--- branches/hbraun/trunk/jbossws-core/src/resources/samples/build.xml 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/jbossws-core/src/resources/samples/build.xml 2007-05-15 15:38:54 UTC (rev 3100)
@@ -239,7 +239,7 @@
<target name="wsconsume" depends="init" description="Consume JAX-WS contracts" if="HAVE_JDK_1.5">
<!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsconsume" classname="org.jboss.ws.tools.jaxws.ant.wsconsume">
+ <taskdef name="wsconsume" classname="org.jboss.ws.integration.tools.jaxws.ant.wsconsume">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/jbossws-wsconsume-impl.jar"/>
@@ -331,7 +331,7 @@
<target name="wsprovide" depends="compile" description="Provide the JAX-WS contracts." if="HAVE_JDK_1.5">
<!-- Define the JAX-WS wsprovide task -->
- <taskdef name="wsprovide" classname="org.jboss.ws.tools.jaxws.ant.wsprovide">
+ <taskdef name="wsprovide" classname="org.jboss.ws.integration.tools.jaxws.ant.wsprovide">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/concurrent.jar"/>
Modified: branches/hbraun/trunk/jbossws-tests/build.xml
===================================================================
--- branches/hbraun/trunk/jbossws-tests/build.xml 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/jbossws-tests/build.xml 2007-05-15 15:38:54 UTC (rev 3100)
@@ -246,14 +246,14 @@
<target name="wsconsume" depends="init" description="Consume JAX-WS contracts" if="HAVE_JDK_1.5">
<!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsconsume" classname="org.jboss.ws.tools.jaxws.ant.wsconsume">
+ <taskdef name="wsconsume" classname="org.jboss.ws.integration.tools.jaxws.ant.wsconsume">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/jbossws-wsconsume-impl.jar"/>
<classpath location="${thirdparty.dir}/jaxb-xjc.jar"/>
</taskdef>
- <wsconsume wsdl="${tests.resources.dir}/benchmark/jaxws/doclit/WEB-INF/wsdl/BenchmarkWebService.wsdl" package="org.jboss.test.ws.benchmark.jaxws.doclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/benchmark/jaxws/doclit/WEB-INF/wsdl/BenchmarkWebService.wsdl" package="org.jboss.test.ws.benchmark.jaxws.doclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="true"/>
<wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitB/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitb" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitW/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitw" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesRpcLit/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.baserpclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
@@ -344,7 +344,7 @@
<target name="wsprovide" depends="compile" description="Provide the JAX-WS contracts." if="HAVE_JDK_1.5">
<!-- Define the JAX-WS wsprovide task -->
- <taskdef name="wsprovide" classname="org.jboss.ws.tools.jaxws.ant.wsprovide">
+ <taskdef name="wsprovide" classname="org.jboss.ws.integration.tools.jaxws.ant.wsprovide">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/concurrent.jar"/>
Modified: branches/hbraun/trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java
===================================================================
--- branches/hbraun/trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java 2007-05-15 14:01:18 UTC (rev 3099)
+++ branches/hbraun/trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java 2007-05-15 15:38:54 UTC (rev 3100)
@@ -31,7 +31,7 @@
import org.jboss.test.ws.jaxws.samples.soapbinding.PurchaseOrder;
import org.jboss.test.ws.jaxws.samples.soapbinding.PurchaseOrderAck;
import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.tools.jaxws.api.WSContractProvider;
+import org.jboss.ws.integration.tools.jaxws.api.WSContractProvider;
import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
17 years, 4 months
JBossWS SVN: r3099 - in branches/tdiesler/trunk: integration/jboss50 and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-15 10:01:18 -0400 (Tue, 15 May 2007)
New Revision: 3099
Added:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB3.java
Removed:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/WebAppGeneratorDeployer.java
Modified:
branches/tdiesler/trunk/build/eclipse/jbossws.userlibraries
branches/tdiesler/trunk/integration/jboss50/.classpath
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/.classpath
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/AbstractDeployerHook.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java
Log:
restructure
Modified: branches/tdiesler/trunk/build/eclipse/jbossws.userlibraries
===================================================================
--- branches/tdiesler/trunk/build/eclipse/jbossws.userlibraries 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/build/eclipse/jbossws.userlibraries 2007-05-15 14:01:18 UTC (rev 3099)
@@ -17,6 +17,13 @@
<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/ejb3.deployer/jboss-ejb3.jar"/>
<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/lib/jboss-common.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/lib/jboss-j2ee.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/jboss-bean.deployer/jboss-dependency.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/jboss-bean.deployer/jboss-microcontainer.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/lib/jboss-xml-binding.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/lib/servlet-api.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/lib/jbosssx.jar"/>
</library>
<library name="jboss-5.0.x" systemlibrary="false">
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-aop-jdk50.jar"/>
@@ -29,7 +36,13 @@
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jboss.jar" source="/home/tdiesler/svn/jbossas/trunk/server/src/main"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jnpserver.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-logging-spi.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-xml-binding.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/client/jboss-ejb3-client.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-common-core.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jbosssx.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-annotations-ejb3.jar"/>
-<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-ejb3.jar" source="/home/tdiesler/svn/jbossas/branches/Branch_4_2/ejb3/src/main"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-ejb3.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/antlr.jar"/>
</library>
</eclipse-userlibraries>
Modified: branches/tdiesler/trunk/integration/jboss50/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/.classpath 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jboss50/.classpath 2007-05-15 14:01:18 UTC (rev 3099)
@@ -2,9 +2,9 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
<classpathentry combineaccessrules="false" kind="src" path="/spi"/>
<classpathentry kind="lib" path="/spi/thirdparty/jaxws-api.jar"/>
<classpathentry kind="lib" path="/spi/thirdparty/jsr181-api.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -27,10 +27,8 @@
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/.classpath 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/.classpath 2007-05-15 14:01:18 UTC (rev 3099)
@@ -2,9 +2,9 @@
<classpath>
<classpathentry excluding="org/jboss/ws/integration/jboss42/jms/" kind="src" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-4.2.x"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws"/>
<classpathentry combineaccessrules="false" kind="src" path="/spi"/>
<classpathentry combineaccessrules="false" kind="src" path="/jboss42"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-4.2.x"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/AbstractDeployerHook.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/AbstractDeployerHook.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/AbstractDeployerHook.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -33,7 +33,10 @@
import org.jboss.mx.util.MBeanProxy;
import org.jboss.mx.util.MBeanProxyCreationException;
import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.DeployerManager;
+import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.WSDeploymentException;
import org.jboss.ws.integration.jboss42.DeployerHook;
import org.jboss.ws.integration.jboss42.DeployerInterceptorMBean;
@@ -52,12 +55,72 @@
protected DeployerManager deployerManager;
private List<ObjectName> phaseOneInterceptors;
private List<ObjectName> phaseTwoInterceptors;
+ private String deploymentClass;
+ private String serviceClass;
+ private String endpointClass;
public void setDeployerManager(DeployerManager deploymentManager)
{
this.deployerManager = deploymentManager;
}
+ public void setDeploymentClass(String deploymentClass)
+ {
+ this.deploymentClass = deploymentClass;
+ }
+
+ public void setEndpointClass(String endpointClass)
+ {
+ this.endpointClass = endpointClass;
+ }
+
+ public void setServiceClass(String serviceClass)
+ {
+ this.serviceClass = serviceClass;
+ }
+
+ public Deployment createDeployment()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(deploymentClass);
+ return (Deployment)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + deploymentClass);
+ }
+ }
+
+ public Service createService()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(serviceClass);
+ return (Service)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + serviceClass);
+ }
+ }
+
+ public Endpoint createEndpoint()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(endpointClass);
+ return (Endpoint)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + endpointClass);
+ }
+ }
+
public void setPhaseOneInterceptors(List<ObjectName> phaseOneInterceptors)
{
this.phaseOneInterceptors = phaseOneInterceptors;
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -73,9 +73,9 @@
/** Initialize the service endpoint */
@Override
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
- super.init(endpoint);
+ super.create(endpoint);
server = MBeanServerLocator.locateJBoss();
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -66,9 +66,9 @@
/** Initialize the service endpoint */
@Override
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
- super.init(endpoint);
+ super.create(endpoint);
ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
if (sepMetaData == null)
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookEJB21.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookEJB21.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -27,10 +27,8 @@
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
@@ -55,7 +53,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.ucl);
@@ -92,11 +90,14 @@
Class<?> epBean = loader.loadClass(ejbClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbLink;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -29,10 +29,8 @@
import org.jboss.deployment.DeploymentInfo;
import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
@@ -61,7 +59,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new BasicDeployment();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.annotationsCl);
@@ -94,7 +92,7 @@
{
ClassLoader loader = dep.getClassLoader();
Class<?> epBean = loader.loadClass(servletClass.trim());
-
+
// If this is a servlet we defer the the bean creation
if (javax.servlet.Servlet.class.isAssignableFrom(epBean))
{
@@ -102,11 +100,14 @@
}
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletLink;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -31,10 +31,8 @@
import org.jboss.ejb3.Ejb3ModuleMBean;
import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.utils.ObjectNameFactory;
@@ -56,7 +54,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new UnifiedMetaDataDeployment();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.ucl);
@@ -74,11 +72,14 @@
Class epBean = container.getBeanClass();
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbName;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
}
}
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -23,7 +23,6 @@
//$Id$
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -36,12 +35,8 @@
import org.jboss.deployment.DeploymentInfo;
import org.jboss.metadata.WebMetaData;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.BasicEndpoint;
-import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.utils.ObjectNameFactory;
@@ -63,7 +58,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new JSEDeployment();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.annotationsCl);
@@ -88,11 +83,14 @@
Class<?> epBean = loader.loadClass(servletClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Copied: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB21.java (from rev 3097, branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java)
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB21.java (rev 0)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB21.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -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.jboss42.jbossws;
+
+//$Id$
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.AssemblyDescriptorMetaData;
+import org.jboss.ws.integration.deployment.SecurityRolesHandler;
+import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+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 SecurityRolesHandlerEJB21 implements SecurityRolesHandler
+{
+ // logging support
+ protected Logger log = Logger.getLogger(SecurityRolesHandlerEJB21.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ public void addSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
+ {
+ // Fix: http://jira.jboss.org/jira/browse/JBWS-309
+ ApplicationMetaData applMetaData = (ApplicationMetaData)udi.getAttachment(ApplicationMetaData.class);
+ 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()));
+ }
+ }
+ }
+ }
+}
Copied: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB3.java (from rev 3097, branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java)
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB3.java (rev 0)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB3.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -0,0 +1,96 @@
+/*
+ * 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.jboss42.jbossws;
+
+//$Id$
+
+import javax.annotation.security.RolesAllowed;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+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.WSException;
+import org.jboss.ws.integration.deployment.SecurityRolesHandler;
+import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+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 SecurityRolesHandlerEJB3 implements SecurityRolesHandler
+{
+ // logging support
+ protected Logger log = Logger.getLogger(SecurityRolesHandlerEJB3.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ public void addSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
+ {
+ // The container objects below provide access to all of the ejb metadata
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.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: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -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.jboss42.jbossws;
-
-//$Id$
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.AssemblyDescriptorMetaData;
-import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-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(Element webApp, UnifiedDeploymentInfo udi)
- {
- // Fix: http://jira.jboss.org/jira/browse/JBWS-309
- ApplicationMetaData applMetaData = (ApplicationMetaData)udi.getAttachment(ApplicationMetaData.class);
- 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: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -1,96 +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.jboss42.jbossws;
-
-//$Id$
-
-import javax.annotation.security.RolesAllowed;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-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.WSException;
-import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-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 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(Element webApp, UnifiedDeploymentInfo udi)
- {
- // The container objects below provide access to all of the ejb metadata
- Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.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: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/WebAppGeneratorDeployer.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/WebAppGeneratorDeployer.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/WebAppGeneratorDeployer.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -1,61 +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.jboss42.jbossws;
-
-//$Id$
-
-import org.jboss.ws.integration.deployment.AbstractDeployer;
-import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * A deployer that generates a webapp for an EJB endpoint
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class WebAppGeneratorDeployer extends AbstractDeployer
-{
- @Override
- public void create(Deployment dep)
- {
- UnifiedDeploymentInfo udi = dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
- if (udi == null)
- throw new IllegalStateException("Cannot obtain unified deployement info");
-
- UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
- if (umd == null)
- throw new IllegalStateException("Cannot obtain unified meta data");
-
- if (dep.getType().toString().endsWith("EJB21"))
- {
- ServiceEndpointGeneratorEJB21 generator = new ServiceEndpointGeneratorEJB21();
- udi.webappURL = generator.generatWebDeployment(umd, udi);
- }
- else if (dep.getType().toString().endsWith("EJB3"))
- {
- ServiceEndpointGeneratorEJB3 generator = new ServiceEndpointGeneratorEJB3();
- udi.webappURL = generator.generatWebDeployment(umd, udi);
- }
- }
-}
\ No newline at end of file
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-05-15 14:01:18 UTC (rev 3099)
@@ -163,6 +163,8 @@
Register DeployerHooks with JBoss deployers
-->
<bean name="WSDeployerHook_JAXRPC_JSE" class="org.jboss.ws.integration.jboss42.jbossws.JAXRPCDeployerHookJSE">
+ <property name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject bean="WSDeployerManagerJSE"/></property>
<property name="phaseOneInterceptors">
<list class="java.util.LinkedList" elementClass="javax.management.ObjectName">
@@ -171,6 +173,8 @@
</property>
</bean>
<bean name="WSDeployerHook_JAXRPC_EJB21" class="org.jboss.ws.integration.jboss42.jbossws.JAXRPCDeployerHookEJB21">
+ <property name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject bean="WSDeployerManagerEJB"/></property>
<property name="phaseOneInterceptors">
<list class="java.util.LinkedList" elementClass="javax.management.ObjectName">
@@ -179,6 +183,8 @@
</property>
</bean>
<bean name="WSDeployerHook_JAXWS_JSE" class="org.jboss.ws.integration.jboss42.jbossws.JAXWSDeployerHookJSE">
+ <property name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject bean="WSDeployerManagerJSE"/></property>
<property name="phaseOneInterceptors">
<list class="java.util.LinkedList" elementClass="javax.management.ObjectName">
@@ -187,6 +193,8 @@
</property>
</bean>
<bean name="WSDeployerHook_JAXWS_EJB3" class="org.jboss.ws.integration.jboss42.jbossws.JAXWSDeployerHookEJB3">
+ <property name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject bean="WSDeployerManagerEJB"/></property>
<property name="phaseOneInterceptors">
<list class="java.util.LinkedList" elementClass="javax.management.ObjectName">
Modified: branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -73,9 +73,9 @@
/** Initialize the service endpoint */
@Override
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
- super.init(endpoint);
+ super.create(endpoint);
server = MBeanServerLocator.locateJBoss();
Modified: branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -66,9 +66,9 @@
/** Initialize the service endpoint */
@Override
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
- super.init(endpoint);
+ super.create(endpoint);
ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
if (sepMetaData == null)
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -44,7 +44,7 @@
// Initialize the invoker
InvocationHandler invoker = endpoint.getInvocationHandler();
- invoker.init(endpoint);
+ invoker.create(endpoint);
endpoint.setState(EndpointState.CREATED);
}
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -55,6 +55,8 @@
*/
package org.jboss.ws.integration.invocation;
+import javax.xml.ws.handler.MessageContext;
+
//$Id$
/**
@@ -65,4 +67,6 @@
*/
public interface InvocationContext
{
+ /** Get the message context */
+ MessageContext getMessageContext();
}
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -57,10 +57,12 @@
//$Id$
+import java.lang.reflect.Method;
+
import org.jboss.ws.integration.Endpoint;
/**
- * A general endpoint invoker.
+ * A general ep invoker.
*
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
@@ -68,8 +70,20 @@
public interface InvocationHandler
{
/** Initialize the invocation handler */
- void init(Endpoint endpoint);
+ void create(Endpoint ep);
- /** Invoke the the service endpoint */
- void invoke(InvocationContext reqContext) throws Exception;
+ /** Initialize the invocation handler */
+ void start(Endpoint ep);
+
+ /** Get an instance of the target bean */
+ Object getTargetBean(Endpoint ep) throws InstantiationException, IllegalAccessException;
+
+ /** Invoke the the service ep */
+ Object invoke(Endpoint ep, Object targetBean, Method method, Object[] args, InvocationContext invContext) throws Exception;
+
+ /** Initialize the invocation handler */
+ void stop(Endpoint ep);
+
+ /** Initialize the invocation handler */
+ void destroy(Endpoint ep);
}
Modified: branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -23,10 +23,13 @@
// $Id$
+import java.lang.reflect.Method;
+
+import javax.xml.ws.handler.MessageContext;
+
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.invocation.InvocationContext;
import org.jboss.ws.integration.invocation.InvocationHandler;
/**
@@ -43,14 +46,31 @@
private Endpoint endpoint;
/** Initialize the service endpoint */
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
this.endpoint = endpoint;
}
+ public void start(Endpoint endpoint)
+ {
+ }
+
+ public Object getTargetBean(Endpoint endpoint)
+ {
+ throw new NotImplementedException();
+ }
+
/** Invoke the the service endpoint */
- public void invoke(InvocationContext reqContext) throws Exception
+ public Object invoke(Endpoint endpoint, Object targetBean, Method method, Object[] args, MessageContext msgContext) throws Exception
{
throw new NotImplementedException();
}
+
+ public void stop(Endpoint endpoint)
+ {
+ }
+
+ public void destroy(Endpoint endpoint)
+ {
+ }
}
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -71,7 +71,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Apr-2007
*/
-public abstract class AbstractInvocationHandler implements InvocationHandler
+public abstract class AbstractInvocationHandler
{
// provide logging
private static final Logger log = Logger.getLogger(AbstractInvocationHandler.class);
@@ -81,10 +81,10 @@
protected ServerHandlerDelegate delegate;
/** Initialize the service endpoint */
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
this.endpoint = endpoint;
-
+
ServerEndpointMetaData sepMetaData = endpoint.getMetaData(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
@@ -134,18 +134,12 @@
}
/** Invoke the the service endpoint */
- public void invoke(InvocationContext reqContext) throws Exception
+ public void invoke(ServletRequestContext reqContext) throws Exception
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)msgContext.getEndpointMetaData();
MessageAbstraction reqMessage = msgContext.getMessageAbstraction();
- // Load the endpoint implementation bean
- Class seImpl = loadServiceEndpoint();
-
- // Create an instance of the endpoint implementation bean
- Object seInstance = createServiceEndpointInstance(seImpl, reqContext);
-
// The direction of the message
DirectionHolder direction = new DirectionHolder(Direction.InBound);
@@ -209,8 +203,16 @@
epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
}
- // Invoke the service endpoint
- invokeServiceEndpointInstance(seInstance, epInv);
+ InvocationHandler invHandler = endpoint.getInvocationHandler();
+ Object targetBean = invHandler.getTargetBean(endpoint);
+
+ Class implClass = endpoint.getEndpointImpl();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getRequestPayload();
+ Object retObj = invHandler.invoke(endpoint, targetBean, implMethod, args, reqContext);
+ epInv.setReturnValue(retObj);
}
finally
{
@@ -280,8 +282,6 @@
closeHandlerChain(sepMetaData, handlerType[2]);
closeHandlerChain(sepMetaData, handlerType[1]);
closeHandlerChain(sepMetaData, handlerType[0]);
-
- destroyServiceEndpointInstance(seInstance);
}
}
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -40,7 +40,9 @@
import org.jboss.ws.core.jaxws.WebServiceContextJSE;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.invocation.InvocationContext;
+import org.jboss.ws.integration.invocation.InvocationHandler;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
/**
@@ -49,11 +51,57 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Apr-2007
*/
-public class InvocationHandlerJSE extends AbstractInvocationHandler
+public class InvocationHandlerJSE implements InvocationHandler
{
// provide logging
private static final Logger log = Logger.getLogger(InvocationHandlerJSE.class);
+ public void create(Endpoint ep)
+ {
+ // noting to do
+ }
+
+ public void destroy(Endpoint endpoint)
+ {
+ }
+
+ public Object getTargetBean(Endpoint ep) throws InstantiationException, IllegalAccessException
+ {
+ Class epClass = ep.getEndpointImpl();
+ Object targetBean = epClass.newInstance();
+ return targetBean;
+ }
+
+ public Object invoke(Endpoint endpoint, Object targetBean, Method method, Object[] args, InvocationContext invContext) throws Exception
+ {
+ if (targetBean instanceof ServiceLifecycle && context != null)
+ {
+ try
+ {
+ ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)seiImpl);
+ ServletEndpointContext servletEndpointContext = new ServletEndpointContextImpl((ServletRequestContext)context);
+ serviceLifecycle.init(servletEndpointContext);
+ }
+ catch (ServiceException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+ return null;
+ }
+
+ public void start(Endpoint endpoint)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void stop(Endpoint endpoint)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
/** Load the SEI implementation bean if necessary */
public Class loadServiceEndpoint() throws ClassNotFoundException
{
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java 2007-05-15 12:42:40 UTC (rev 3098)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java 2007-05-15 14:01:18 UTC (rev 3099)
@@ -356,9 +356,12 @@
ClassLoader classLoader = sepMetaData.getClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
+ AbstractInvocationHandler invHandler = endpoint.getMetaData(AbstractInvocationHandler.class);
+ if (invHandler == null)
+ throw new IllegalStateException("Cannot obtain invocation handler");
+
// Invoke the service endpoint
- InvocationHandler invoker = endpoint.getInvocationHandler();
- invoker.invoke(reqContext);
+ invHandler.invoke(reqContext);
// Get the response message context
msgContext = MessageContextAssociation.peekMessageContext();
17 years, 4 months
JBossWS SVN: r3098 - in branches/dlofthouse/JBWS-1647: jbossws-core/src/java/org/jboss/ws/core/jaxws/binding and 17 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-05-15 08:42:40 -0400 (Tue, 15 May 2007)
New Revision: 3098
Added:
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestCaseBase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl
branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml
Modified:
branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java
branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java
branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
branches/dlofthouse/JBWS-1647/jbossws-tests/ant-import/build-jars-jaxrpc.xml
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java
Log:
Comment preservation for message marshalling.
Modified: branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -67,6 +67,7 @@
import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.core.soap.SOAPHeaderElementImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.TextImpl;
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
import org.jboss.ws.core.soap.attachment.CIDGenerator;
@@ -229,10 +230,10 @@
log.debug("Add unboundHeader element: " + soapName);
SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
-
+
if (soapHeader == null)
soapHeader = soapEnvelope.addHeader();
-
+
soapHeader.addChildElement(contentElement);
contentElement.setObjectValue(value);
}
@@ -291,7 +292,18 @@
SOAPElement soapBodyElement = soapBody;
if (style == Style.RPC)
{
- soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
+ soapBodyElement = null;
+
+ Iterator it = soapBody.getChildElements();
+ while (soapBodyElement == null && it.hasNext())
+ {
+ Object current = it.next();
+ if (current instanceof SOAPElement)
+ {
+ soapBodyElement = (SOAPElement)current;
+ }
+ }
+
Name elName = soapBodyElement.getElementName();
QName elQName = new QName(elName.getURI(), elName.getLocalName(), elName.getPrefix());
@@ -537,8 +549,14 @@
Iterator bodyChildren = soapBody.getChildElements();
SOAPBodyElement soapBodyElement = null;
- if (bodyChildren.hasNext() != false)
- soapBodyElement = (SOAPBodyElement)bodyChildren.next();
+ while (bodyChildren.hasNext() && soapBodyElement == null)
+ {
+ Object next = bodyChildren.next();
+ if (next instanceof SOAPBodyElement)
+ {
+ soapBodyElement = (SOAPBodyElement)next;
+ }
+ }
// Translate the SOAPFault to an exception and throw it
if (soapBodyElement instanceof SOAPFaultImpl)
@@ -804,8 +822,14 @@
Iterator childElements = soapElement.getChildElements();
while (childElements.hasNext())
{
- SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
+ Object child = childElements.next();
+ if (child instanceof TextImpl)
+ {
+ continue;
+ }
+ SOAPElementImpl childElement = (SOAPElementImpl)child;
+
// If this message was manipulated by a handler the child may not be a content element
if (!(childElement instanceof SOAPContentElement))
childElement = (SOAPContentElement)soapElement.replaceChild(new SOAPContentElement(childElement), childElement);
Modified: branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -23,10 +23,12 @@
// $Id$
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Source;
import javax.xml.ws.handler.Handler;
@@ -93,7 +95,18 @@
SOAPMessage reqMessage = (SOAPMessage)payload;
SOAPBodyImpl body = (SOAPBodyImpl)reqMessage.getSOAPBody();
- SOAPContentElement bodyElement = (SOAPContentElement)body.getFirstChild();
+
+ SOAPContentElement bodyElement = null;
+ Iterator bodyChildren = body.getChildElements();
+ while (bodyChildren.hasNext() && bodyElement == null)
+ {
+ Object next = bodyChildren.next();
+ if (next instanceof SOAPContentElement)
+ {
+ bodyElement = (SOAPContentElement)next;
+ }
+ }
+
Source source = bodyElement.getXMLFragment().getSource();
if (source == null)
Modified: branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -27,6 +27,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.HashMap;
+import java.util.Iterator;
import javax.activation.DataHandler;
import javax.management.MBeanException;
@@ -344,9 +345,21 @@
{
String faultString;
SOAPBody soapBody = soapMessage.getSOAPBody();
- if (soapBody.getChildElements().hasNext())
+
+ Iterator bodyChildren = soapBody.getChildElements();
+ SOAPBodyElement soapBodyElement = null;
+
+ while (bodyChildren.hasNext() && soapBodyElement == null)
{
- SOAPBodyElement soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
+ Object next = bodyChildren.next();
+ if (next instanceof SOAPBodyElement)
+ {
+ soapBodyElement = (SOAPBodyElement)next;
+ }
+ }
+
+ if (soapBodyElement != null)
+ {
Name soapName = soapBodyElement.getElementName();
faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for: " + soapName;
}
Modified: branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -63,14 +63,28 @@
String bodyStr = DOMWriter.printNode(soapBody, true);
log.debug("Begin processHRefs:\n" + bodyStr);
- SOAPBodyElement bodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPBodyElement bodyElement = null;
+ Iterator children = soapBody.getChildElements();
+ while (bodyElement == null && children.hasNext())
+ {
+ Object currentChild = children.next();
+ if (currentChild instanceof SOAPBodyElement)
+ {
+ bodyElement = (SOAPBodyElement)currentChild;
+ }
+ }
+
processElement(bodyElement);
-
+
Iterator it = soapBody.getChildElements();
while (it.hasNext())
{
+ Object currentChild = it.next();
+ if (currentChild instanceof TextImpl)
+ continue;
+
// Remove id elements
- SOAPElement soapElement = (SOAPElement)it.next();
+ SOAPElement soapElement = (SOAPElement)currentChild;
if ((soapElement instanceof SOAPBodyElement) == false)
soapBody.removeChild(soapElement);
}
Modified: branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -143,7 +143,7 @@
}
public SOAPElement setElementQNameInternal(QName qname) throws SOAPException
- {
+ {
elementName = new NameImpl(qname);
Document owner = domNode.getOwnerDocument();
@@ -153,7 +153,6 @@
return this.completeNamespaceDeclaration();
}
-
/**
* Adds an attribute with the specified name and value to this SOAPElement object.
*
@@ -465,9 +464,7 @@
}
else if (node instanceof Text)
{
- String value = node.getNodeValue();
- if (value.trim().length() > 0)
- list.add(node);
+ list.add(node);
}
}
return list.iterator();
@@ -835,7 +832,14 @@
}
else if (node instanceof TextImpl)
{
+ boolean comment = node.getNodeType() == Node.COMMENT_NODE;
+ if (comment)
+ out.write("<!--");
+
out.write(node.getValue());
+
+ if (comment)
+ out.write("-->");
}
else
{
Modified: branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -58,7 +58,7 @@
/** Add a SOAPHeaderElement as a child of this SOAPHeader instance.
*/
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
- {
+ {
QName qname = child.getElementQName();
if (qname == null || qname.getNamespaceURI().length() == 0)
throw new SOAPException("Invalid SOAPHeaderElement name: " + qname);
@@ -111,8 +111,12 @@
Iterator it = getChildElements();
while (it.hasNext())
{
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- list.add(shElement);
+ Object currentChild = it.next();
+ if (currentChild instanceof SOAPHeaderElement)
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)currentChild;
+ list.add(shElement);
+ }
}
return list.iterator();
}
@@ -129,9 +133,13 @@
Iterator it = getChildElements();
while (it.hasNext())
{
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- if (actor.equals(shElement.getActor()))
- list.add(shElement);
+ Object currentChild = it.next();
+ if (currentChild instanceof SOAPHeaderElement)
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)currentChild;
+ if (actor.equals(shElement.getActor()))
+ list.add(shElement);
+ }
}
return list.iterator();
}
@@ -149,9 +157,13 @@
Iterator it = getChildElements();
while (it.hasNext())
{
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- if (actor.equals(shElement.getActor()) && shElement.getMustUnderstand())
- list.add(shElement);
+ Object currentChild = it.next();
+ if (currentChild instanceof SOAPHeaderElement)
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)currentChild;
+ if (actor.equals(shElement.getActor()) && shElement.getMustUnderstand())
+ list.add(shElement);
+ }
}
return list.iterator();
}
@@ -163,9 +175,13 @@
Iterator it = getChildElements();
while (it.hasNext())
{
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- removeChild(shElement);
- list.add(shElement);
+ Object currentChild = it.next();
+ if (currentChild instanceof SOAPHeaderElement)
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)currentChild;
+ removeChild(shElement);
+ list.add(shElement);
+ }
}
return list.iterator();
}
@@ -180,11 +196,15 @@
Iterator it = getChildElements();
while (it.hasNext())
{
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- if (actor.equals(shElement.getActor()))
+ Object currentChild = it.next();
+ if (currentChild instanceof SOAPHeaderElement)
{
- removeChild(shElement);
- list.add(shElement);
+ SOAPHeaderElement shElement = (SOAPHeaderElement)currentChild;
+ if (actor.equals(shElement.getActor()))
+ {
+ removeChild(shElement);
+ list.add(shElement);
+ }
}
}
return list.iterator();
Modified: branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -68,7 +68,8 @@
if (wsaAction.equals(opAux.getSOAPAction()))
{
opMetaData = opAux;
- if(log.isDebugEnabled()) log.debug("Use wsa:Action dispatch: " + wsaAction);
+ if (log.isDebugEnabled())
+ log.debug("Use wsa:Action dispatch: " + wsaAction);
break;
}
}
@@ -87,8 +88,19 @@
SOAPBody soapBody = soapMessage.getSOAPBody();
Iterator bodyChildren = soapBody.getChildElements();
- if (bodyChildren.hasNext() == false)
+ SOAPBodyElement soapBodyElement = null;
+
+ while (bodyChildren.hasNext() && soapBodyElement == null)
{
+ Object next = bodyChildren.next();
+ if (next instanceof SOAPBodyElement)
+ {
+ soapBodyElement = (SOAPBodyElement)next;
+ }
+ }
+
+ if (soapBodyElement == null)
+ {
if (epMetaData.getStyle() == Style.RPC)
throw new SOAPException("Empty SOAP body with no child element not supported for RPC");
@@ -97,7 +109,8 @@
{
if (opAux.getParameters().size() == 0)
{
- if(log.isDebugEnabled()) log.debug ("Dispatching empty SOAP body");
+ if (log.isDebugEnabled())
+ log.debug("Dispatching empty SOAP body");
opMetaData = opAux;
break;
}
@@ -105,7 +118,6 @@
}
else
{
- SOAPBodyElement soapBodyElement = (SOAPBodyElement)bodyChildren.next();
Name soapName = soapBodyElement.getElementName();
QName xmlElementName = new QName(soapName.getURI(), soapName.getLocalName());
opMetaData = epMetaData.getOperation(xmlElementName);
@@ -119,14 +131,16 @@
{
if (opAux.isMessageEndpoint())
{
- if(log.isDebugEnabled()) log.debug("Use generic message style dispatch");
+ if (log.isDebugEnabled())
+ log.debug("Use generic message style dispatch");
opMetaData = opAux;
break;
}
}
}
- if(log.isDebugEnabled()) log.debug("getDispatchDestination: " + (opMetaData != null ? opMetaData.getQName() : null));
+ if (log.isDebugEnabled())
+ log.debug("getDispatchDestination: " + (opMetaData != null ? opMetaData.getQName() : null));
return opMetaData;
}
}
\ No newline at end of file
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -2571,7 +2571,41 @@
<include name="wsdl/**"/>
</metainf>
</jar>
+
+ <!-- jbossws-jbws1647 RPC/Literal -->
+ <war warfile="${tests.output.dir}/libs/jaxrpc-jbws1647-rpclit.war"
+ webxml="${tests.output.dir}/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxrpc/jbws1647/rpclit/WEB-INF">
+ <include name="webservices.xml"/>
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+ <!-- jbossws-jbws1647 Document/Literal -->
+ <war warfile="${tests.output.dir}/libs/jaxrpc-jbws1647-doclit.war"
+ webxml="${tests.output.dir}/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxrpc/jbws1647/doclit/WEB-INF">
+ <include name="webservices.xml"/>
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+
<!-- jaxrpc-marshall-doclit.war -->
<war warfile="${tests.output.dir}/libs/jaxrpc-marshall-doclit.war"
webxml="${tests.output.dir}/resources/jaxrpc/marshall-doclit/WEB-INF/web.xml">
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -28,18 +28,19 @@
import java.io.IOException;
import javax.xml.soap.MessageFactory;
+import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
@@ -82,7 +83,9 @@
assertEquals("env:Envelope", env.getNodeName());
assertEquals(Constants.NS_SOAP11_ENV, env.getNamespaceURI());
- SOAPBodyElement soapBodyElement = (SOAPBodyElement)env.getBody().getChildElements().next();
+ Name name = new NameImpl("businessList", null, "urn:uddi-org:api_v2");
+ SOAPBodyElement soapBodyElement = (SOAPBodyElement)env.getBody().getChildElements(name).next();
+
assertEquals("urn:uddi-org:api_v2", soapBodyElement.getNamespaceURI());
}
@@ -225,4 +228,38 @@
//System.out.println(wasXML);
assertEquals(expXML, wasXML);
}
-}
\ No newline at end of file
+
+ public void testWriteToPreserveFormatting() throws Exception
+ {
+ String expMessage =
+ "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:typ='http://www.jboss.org/support/phonebook/types'>" +
+ " <soapenv:Header></soapenv:Header>" +
+ " <soapenv:Body>" +
+ " <!-- Comment One -->" +
+ " <typ:lookup xmlns:typ='http://www.jboss.org/support/phonebook/types'>" +
+ " <!-- Comment Two -->" +
+ " <firstName>Joe</firstName>" +
+ " <surname>Bloggs</surname>" +
+ " <!-- Comment Three -->" +
+ " </typ:lookup>" +
+ " <!-- Comment Four -->" +
+ " </soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(expMessage.getBytes());
+ SOAPMessage soapMsg = factory.createMessage(null, inputStream);
+
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ soapMsg.writeTo(outputStream);
+
+ String actualMessage = new String(outputStream.toByteArray(), "UTF-8");
+
+ //System.out.println("A - " + expMessage);
+ //System.out.println("B - " + DOMWriter.printNode(soapMsg.getSOAPPart().getEnvelope(), false));
+ //System.out.println("C - " + actualMessage);
+
+ assertEquals(expMessage, actualMessage);
+ }
+
+}
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -33,6 +33,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.soap.NameImpl;
/**
* Test the SOAPElement
@@ -114,8 +115,10 @@
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage(null, new ByteArrayInputStream(xml.getBytes()));
SOAPFactory soapFactory = SOAPFactory.newInstance();
- SOAPElement bearElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements().next();
+ Name name = new NameImpl("bear", "np", "http://northpole.net");
+ SOAPElement bearElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements(name).next();
+
assertEquals(2, getIteratorCount(bearElement.getAllAttributes()));
Iterator it = bearElement.getAllAttributes();
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -38,6 +38,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
+import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.utils.DOMUtils;
/**
@@ -76,7 +77,10 @@
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage soapMessage = factory.createMessage(null, new ByteArrayInputStream(envStr.getBytes()));
SOAPBody soapBody = soapMessage.getSOAPBody();
- SOAPFault soapFault = (SOAPFault)soapBody.getChildElements().next();
+
+ Name name = new NameImpl("Fault", "env", "http://schemas.xmlsoap.org/soap/envelope/");
+ SOAPFault soapFault = (SOAPFault)soapBody.getChildElements(name).next();
+
assertEquals("env:Client", soapFault.getFaultCode());
assertEquals("Some fault message", soapFault.getFaultString());
assertEquals("Some fault actor", soapFault.getFaultActor());
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -61,9 +61,10 @@
SOAPMessage soapMessage = factory.createMessage(null, new ByteArrayInputStream(envStr.getBytes()));
SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
SOAPHeader soapHeader = soapEnv.getHeader();
- SOAPHeaderElement shElement = (SOAPHeaderElement)soapHeader.getChildElements().next();
-
+
Name name = new NameImpl("Bar", "ns2", "http://org.jboss.ws/header2");
+ SOAPHeaderElement shElement = (SOAPHeaderElement)soapHeader.getChildElements(name).next();
+
assertEquals(name, shElement.getElementName());
assertEquals("BradPitt", shElement.getActor());
@@ -86,9 +87,10 @@
SOAPMessage soapMessage = factory.createMessage(null, new ByteArrayInputStream(envStr.getBytes()));
SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
SOAPHeader soapHeader = soapEnv.getHeader();
- SOAPHeaderElement shElement = (SOAPHeaderElement)soapHeader.getChildElements().next();
-
+
Name name = new NameImpl("Bar", "ns2", "http://org.jboss.ws/header2");
+ SOAPHeaderElement shElement = (SOAPHeaderElement)soapHeader.getChildElements(name).next();
+
assertEquals(name, shElement.getElementName());
assertTrue(shElement.getMustUnderstand());
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -206,7 +206,7 @@
assertEquals("SomeHeaderValue", foo.getValue());
assertEquals("SomeOtherValue", bar.getValue());
- assertFalse(soapHeader.getChildElements().hasNext());
+ assertFalse(soapHeader.examineAllHeaderElements().hasNext());
}
public void testExtractHeaderElements() throws Exception
@@ -234,7 +234,7 @@
assertEquals("SomeOtherValue", bar.getValue());
- Iterator childElements = soapHeader.getChildElements();
+ Iterator childElements = soapHeader.examineAllHeaderElements();
SOAPHeaderElement foo = (SOAPHeaderElement)childElements.next();
Name fooName = new NameImpl("Foo", "ns1", "http://org.jboss.ws/header");
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.test.ws.jaxrpc.jbws1647;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public abstract class AbstractHandler extends GenericHandler
+{
+
+ private static final Logger log = Logger.getLogger(AbstractHandler.class);
+
+ public abstract String getExpectedMessage();
+
+ public boolean handleRequest(MessageContext msgContext)
+ {
+ log.info("handleRequest");
+
+ boolean valid = false;
+
+ SOAPMessageContext messageContext = (SOAPMessageContext)msgContext;
+
+ SOAPMessage soapMessage = messageContext.getMessage();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ String receivedMessage = "";
+ try
+ {
+ soapMessage.writeTo(baos);
+ receivedMessage = baos.toString();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Unable to process SOAPMessage", e);
+ }
+
+ valid = getExpectedMessage().equals(receivedMessage);
+ if (valid == false)
+ {
+ log.error("Received message does not equal expected message.");
+ log.info("EXP - " + getExpectedMessage());
+ log.info("ACT - " + receivedMessage);
+
+ throw new RuntimeException("Received message does not equal expected message.");
+ }
+
+ return valid;
+ }
+
+ public QName[] getHeaders()
+ {
+ return null;
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.test.ws.jaxrpc.jbws1647;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public class DocumentHandler extends AbstractHandler
+{
+
+ public static final String MESSAGE =
+ "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:typ='http://org.jboss.test.ws/jbws1647/types'>" +
+ " <!-- Comment Before Header -->" +
+ " <soapenv:Header></soapenv:Header>" +
+ " <!-- Comment After Header, Before Body -->" +
+ " <soapenv:Body>" +
+ " <!-- Comment After Body -->" +
+ " <typ:echoMessage xmlns:typ='http://org.jboss.test.ws/jbws1647/types'>" +
+ " <!-- Comment After Wrapper -->" +
+ " <String_1>My Message</String_1>" +
+ " <!-- Comment After Parameter -->" +
+ " </typ:echoMessage>" +
+ " <!-- Comment Before Close Body -->" +
+ " </soapenv:Body>" +
+ " <!-- Comment Before Close Envelope -->" +
+ "</soapenv:Envelope>";
+
+ public String getExpectedMessage()
+ {
+ return MESSAGE;
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.test.ws.jaxrpc.jbws1647;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public class JBWS1647DocumentTestCase extends TestCaseBase
+{
+
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1647DocumentTestCase.class, "jaxrpc-jbws1647-doclit.war");
+ }
+
+ public String getMessage()
+ {
+ return DocumentHandler.MESSAGE;
+ }
+
+ public String getToUrl()
+ {
+ return "http://" + getServerHost() + ":8080/jaxrpc-jbws1647-doclit/TestEndpoint";
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.test.ws.jaxrpc.jbws1647;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 May 2007
+ */
+public class JBWS1647RPCTestCase extends TestCaseBase
+{
+
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1647RPCTestCase.class, "jaxrpc-jbws1647-rpclit.war");
+ }
+
+ public String getMessage()
+ {
+ return RpcHandler.MESSAGE;
+ }
+
+ public String getToUrl()
+ {
+ return "http://" + getServerHost() + ":8080/jaxrpc-jbws1647-rpclit/TestEndpoint";
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.test.ws.jaxrpc.jbws1647;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public class RpcHandler extends AbstractHandler
+{
+
+ public static final String MESSAGE =
+ "<soapenv:Envelope xmlns:jbw='http://org.jboss.test.ws/jbws1647' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <!-- Comment Before Header -->" +
+ " <soapenv:Header></soapenv:Header>" +
+ " <!-- Comment After Header, Before Body -->" +
+ " <soapenv:Body>" +
+ " <!-- Comment After Body -->" +
+ " <jbw:echoMessage xmlns:jbw='http://org.jboss.test.ws/jbws1647'>" +
+ " <!-- Comment After Operation -->" +
+ " <String_1>My Message</String_1>" +
+ " <!-- Comment After Parameter -->" +
+ " </jbw:echoMessage>" +
+ " <!-- Comment Before Close Body -->" +
+ " </soapenv:Body>" +
+ " <!-- Comment Before Close Envelope -->" +
+ "</soapenv:Envelope>";
+
+ public String getExpectedMessage()
+ {
+ return MESSAGE;
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestCaseBase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestCaseBase.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestCaseBase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.test.ws.jaxrpc.jbws1647;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.test.ws.JBossWSTest;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public abstract class TestCaseBase extends JBossWSTest
+{
+
+ public abstract String getMessage();
+
+ public abstract String getToUrl();
+
+ public void testCall() throws Exception
+ {
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPMessage soapMessage = msgFactory.createMessage(null, new ByteArrayInputStream(getMessage().getBytes()));
+
+ SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
+ SOAPConnection con = conFactory.createConnection();
+ SOAPMessage resMessage = con.call(soapMessage, getToUrl());
+
+ SOAPElement soapElement = (SOAPElement)resMessage.getSOAPBody().getChildElements().next();
+ assertEquals("echoMessageResponse", soapElement.getElementName().getLocalName());
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestCaseBase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.test.ws.jaxrpc.jbws1647;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 May 2007
+ */
+public interface TestEndpoint extends Remote
+{
+
+ public String echoMessage(final String message) throws RemoteException;
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.test.ws.jaxrpc.jbws1647;
+
+import org.jboss.logging.Logger;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 May 2007
+ */
+public class TestEndpointImpl implements TestEndpoint
+{
+
+ private static final Logger log = Logger.getLogger(TestEndpointImpl.class);
+
+ public String echoMessage(final String message)
+ {
+ return message;
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Tue May 15 11:14:30 CEST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jaxrpc.jbws1647;
+
+
+public class TestEndpoint_echoMessage_RequestStruct
+{
+
+protected java.lang.String string_1;
+public TestEndpoint_echoMessage_RequestStruct(){}
+
+public TestEndpoint_echoMessage_RequestStruct(java.lang.String string_1){
+this.string_1=string_1;
+}
+public java.lang.String getString_1() { return string_1 ;}
+
+public void setString_1(java.lang.String string_1){ this.string_1=string_1; }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Tue May 15 11:14:30 CEST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jaxrpc.jbws1647;
+
+
+public class TestEndpoint_echoMessage_ResponseStruct
+{
+
+protected java.lang.String result;
+public TestEndpoint_echoMessage_ResponseStruct(){}
+
+public TestEndpoint_echoMessage_ResponseStruct(java.lang.String result){
+this.result=result;
+}
+public java.lang.String getResult() { return result ;}
+
+public void setResult(java.lang.String result){ this.result=result; }
+
+}
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -28,6 +28,7 @@
import javax.xml.rpc.Service;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
@@ -37,6 +38,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.soap.NameImpl;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -115,7 +117,7 @@
String xmlStr = "<?xml version='1.0' encoding='UTF-8' ?>" +
"<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:tns='http://uri.jboss.org'>" +
" <env:Body>" +
- " <tns:testMessage><![CDATA[ Hello ]]></tns:testMessage>" +
+ " <tns:myMessage><![CDATA[ Hello ]]></tns:myMessage>" +
" </env:Body>" +
"</env:Envelope>";
@@ -185,8 +187,10 @@
SOAPMessage soapMessage = mf.createMessage(mimeHeaders, new ByteArrayInputStream(xmlStr.getBytes()));
SOAPBody soapBody = soapMessage.getSOAPBody();
- SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next();
+ Name name = new NameImpl("myMessage", "tns", "http://uri.jboss.org");
+ SOAPElement soapElement = (SOAPElement)soapBody.getChildElements(name).next();
+
StringBuffer builder = new StringBuffer();
NodeList nlist = soapElement.getChildNodes();
for (int i = 0; i < nlist.getLength(); i++)
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -22,12 +22,14 @@
package org.jboss.test.ws.jaxws.handlerlifecycle;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
@@ -186,8 +188,32 @@
String testMethod;
try
{
- SOAPElement soapElement = (SOAPElement)((SOAPMessageContext)msgContext).getMessage().getSOAPBody().getChildElements().next();
- soapElement = (SOAPElement)soapElement.getChildElements().next();
+
+ SOAPMessage message = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPElement soapElement = null;
+ Iterator it = message.getSOAPBody().getChildElements();
+
+ while (soapElement == null && it.hasNext())
+ {
+ Object current = it.next();
+ if (current instanceof SOAPElement)
+ {
+ soapElement = (SOAPElement)current;
+ }
+ }
+
+ it = soapElement.getChildElements();
+ soapElement = null;
+
+ while (soapElement == null && it.hasNext())
+ {
+ Object current = it.next();
+ if (current instanceof SOAPElement)
+ {
+ soapElement = (SOAPElement)current;
+ }
+ }
+
testMethod = soapElement.getValue();
}
catch (SOAPException e)
Modified: branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java 2007-05-15 10:46:22 UTC (rev 3097)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java 2007-05-15 12:42:40 UTC (rev 3098)
@@ -31,6 +31,7 @@
import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
+import javax.xml.soap.Name;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPEnvelope;
@@ -45,6 +46,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
@@ -131,7 +133,9 @@
SOAPMessage resMsg = con.call(reqMsg, epURL);
SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
- Element child = (Element)resEnv.getBody().getChildElements().next();
+ Name name = new NameImpl("user", "ns1", "http://org.jboss.ws/provider");
+ Element child = (Element)resEnv.getBody().getChildElements(name).next();
+
JAXBContext jc = JAXBContext.newInstance(new Class[]{UserType.class});
UserType user = (UserType)jc.createUnmarshaller().unmarshal(new DOMSource(child));
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,56 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jaxrpc.jbws1647</package-type>
+ <namespaceURI>http://org.jboss.test.ws/jbws1647/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint_echoMessage_RequestStruct</java-type>
+ <root-type-qname xmlns:typeNS='http://org.jboss.test.ws/jbws1647/types'>typeNS:echoMessage</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>string_1</java-variable-name>
+ <xml-element-name>String_1</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint_echoMessage_ResponseStruct</java-type>
+ <root-type-qname xmlns:typeNS='http://org.jboss.test.ws/jbws1647/types'>typeNS:echoMessageResponse</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>result</java-variable-name>
+ <xml-element-name>result</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws/jbws1647'>serviceNS:TestService</wsdl-service-name>
+ <port-mapping>
+ <port-name>TestEndpointPort</port-name>
+ <java-port-name>TestEndpointPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws/jbws1647'>portTypeNS:TestEndpoint</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws/jbws1647'>bindingNS:TestEndpointBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>echoMessage</java-method-name>
+ <wsdl-operation>echoMessage</wsdl-operation>
+ <wrapped-element/>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1647'>wsdlMsgNS:TestEndpoint_echoMessage</wsdl-message>
+ <wsdl-message-part-name>String_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>java.lang.String</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1647'>wsdlMsgNS:TestEndpoint_echoMessageResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,21 @@
+<webservices version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+ <webservice-description>
+ <webservice-description-name>TestService</webservice-description-name>
+ <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+ <port-component>
+ <port-component-name>TestEndpointPort</port-component-name>
+ <wsdl-port xmlns:portNS='http://org.jboss.test.ws/jbws1647'>portNS:TestEndpointPort</wsdl-port>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint</service-endpoint-interface>
+ <service-impl-bean>
+ <servlet-link>TestEndpoint</servlet-link>
+ </service-impl-bean>
+
+ <handler>
+ <handler-name>TestHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxrpc.jbws1647.DocumentHandler</handler-class>
+ </handler>
+
+ </port-component>
+ </webservice-description>
+</webservices>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestService' targetNamespace='http://org.jboss.test.ws/jbws1647' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://org.jboss.test.ws/jbws1647/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws/jbws1647' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://org.jboss.test.ws/jbws1647/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://org.jboss.test.ws/jbws1647/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <complexType name='echoMessage'>
+ <sequence>
+ <element name='String_1' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoMessageResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ <element name='echoMessage' type='tns:echoMessage'/>
+ <element name='echoMessageResponse' type='tns:echoMessageResponse'/>
+ </schema>
+ </types>
+ <message name='TestEndpoint_echoMessage' xmlns='http://schemas.xmlsoap.org/wsdl/'>
+ <part element='ns1:echoMessage' name='echoMessage'/>
+ </message>
+ <message name='TestEndpoint_echoMessageResponse'>
+ <part element='ns1:echoMessageResponse' name='echoMessageResponse'/>
+ </message>
+ <portType name='TestEndpoint'>
+ <operation name='echoMessage' parameterOrder='echoMessage'>
+ <input message='tns:TestEndpoint_echoMessage'/>
+ <output message='tns:TestEndpoint_echoMessageResponse'/>
+ </operation>
+ </portType>
+ <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echoMessage'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ wstools.sh -cp ../../../../../output/classes -config wstools-config.xml
+-->
+
+<!-- Add the following handler to the generated webservices.xml
+
+ <handler>
+ <handler-name>TestHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxrpc.jbws1647.DocumentHandler</handler-class>
+ </handler>
+
+-->
+
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <java-wsdl>
+ <service name="TestService" endpoint="org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint" style="document">
+ </service>
+ <namespaces target-namespace="http://org.jboss.test.ws/jbws1647" type-namespace="http://org.jboss.test.ws/jbws1647/types"/>
+ <mapping file="jaxrpc-mapping.xml"/>
+ <webservices servlet-link="TestEndpoint"/>
+ </java-wsdl>
+
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jaxrpc.jbws1647</package-type>
+ <namespaceURI>http://org.jboss.test.ws/jbws1647/types</namespaceURI>
+ </package-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws/jbws1647'>serviceNS:TestService</wsdl-service-name>
+ <port-mapping>
+ <port-name>TestEndpointPort</port-name>
+ <java-port-name>TestEndpointPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws/jbws1647'>portTypeNS:TestEndpoint</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws/jbws1647'>bindingNS:TestEndpointBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>echoMessage</java-method-name>
+ <wsdl-operation>echoMessage</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1647'>wsdlMsgNS:TestEndpoint_echoMessage</wsdl-message>
+ <wsdl-message-part-name>String_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>java.lang.String</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1647'>wsdlMsgNS:TestEndpoint_echoMessageResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,21 @@
+<webservices version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+ <webservice-description>
+ <webservice-description-name>TestService</webservice-description-name>
+ <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+ <port-component>
+ <port-component-name>TestEndpointPort</port-component-name>
+ <wsdl-port xmlns:portNS='http://org.jboss.test.ws/jbws1647'>portNS:TestEndpointPort</wsdl-port>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint</service-endpoint-interface>
+ <service-impl-bean>
+ <servlet-link>TestEndpoint</servlet-link>
+ </service-impl-bean>
+
+ <handler>
+ <handler-name>TestHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxrpc.jbws1647.RpcHandler</handler-class>
+ </handler>
+
+ </port-component>
+ </webservice-description>
+</webservices>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestService' targetNamespace='http://org.jboss.test.ws/jbws1647' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws/jbws1647' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types/>
+ <message name='TestEndpoint_echoMessage'>
+ <part name='String_1' type='xsd:string'/>
+ </message>
+ <message name='TestEndpoint_echoMessageResponse'>
+ <part name='result' type='xsd:string'/>
+ </message>
+ <portType name='TestEndpoint'>
+ <operation name='echoMessage' parameterOrder='String_1'>
+ <input message='tns:TestEndpoint_echoMessage'/>
+ <output message='tns:TestEndpoint_echoMessageResponse'/>
+ </operation>
+ </portType>
+ <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echoMessage'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1647' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1647' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml (rev 0)
+++ branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml 2007-05-15 12:42:40 UTC (rev 3098)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ wstools.sh -cp ../../../../../output/classes -config wstools-config.xml
+-->
+
+<!-- Add the following handler to the generated webservices.xml
+
+ <handler>
+ <handler-name>TestHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxrpc.jbws1647.RpcHandler</handler-class>
+ </handler>
+
+-->
+
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <java-wsdl>
+ <service name="TestService" endpoint="org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint" style="rpc">
+ </service>
+ <namespaces target-namespace="http://org.jboss.test.ws/jbws1647" type-namespace="http://org.jboss.test.ws/jbws1647/types"/>
+ <mapping file="jaxrpc-mapping.xml"/>
+ <webservices servlet-link="TestEndpoint"/>
+ </java-wsdl>
+
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1647/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 4 months
JBossWS SVN: r3097 - in branches/tdiesler/trunk: integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-15 06:46:22 -0400 (Tue, 15 May 2007)
New Revision: 3097
Added:
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ClassLoaderInjectionDeployer.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployment.java
Removed:
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentImpl.java
Modified:
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerHook.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookJSE.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerHookEJB3.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerHookJSE.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicEndpoint.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicService.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployer.java
branches/tdiesler/trunk/testsuite/ant-import/build-jars-jaxws.xml
branches/tdiesler/trunk/testsuite/src/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
Log:
restructure
Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerHook.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerHook.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerHook.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -25,7 +25,11 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.logging.Logger;
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.DeployerManager;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.integration.deployment.WSDeploymentException;
/**
* An abstract web service deployer.
@@ -39,17 +43,72 @@
protected final Logger log = Logger.getLogger(getClass());
protected DeployerManager deployerManager;
+ protected String deploymentClass;
+ protected String serviceClass;
+ protected String endpointClass;
- public DeployerManager getDeployerManager()
+ public void setDeployerManager(DeployerManager deploymentManager)
{
- return deployerManager;
+ this.deployerManager = deploymentManager;
}
- public void setDeployerManager(DeployerManager deploymentManager)
+ public void setDeploymentClass(String deploymentClass)
{
- this.deployerManager = deploymentManager;
+ this.deploymentClass = deploymentClass;
}
+ public void setEndpointClass(String endpointClass)
+ {
+ this.endpointClass = endpointClass;
+ }
+
+ public void setServiceClass(String serviceClass)
+ {
+ this.serviceClass = serviceClass;
+ }
+
+ public Deployment createDeployment()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(deploymentClass);
+ return (Deployment)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + deploymentClass);
+ }
+ }
+
+ public Service createService()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(serviceClass);
+ return (Service)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + serviceClass);
+ }
+ }
+
+ public Endpoint createEndpoint()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(endpointClass);
+ return (Endpoint)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + endpointClass);
+ }
+ }
+
/** Return true if this deployment should be ignored
*/
public boolean ignoreDeployment(DeploymentUnit unit)
Copied: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ClassLoaderInjectionDeployer.java (from rev 3095, branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java)
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ClassLoaderInjectionDeployer.java (rev 0)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ClassLoaderInjectionDeployer.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -0,0 +1,57 @@
+/*
+ * 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 org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+
+/**
+ * A deployer that injects the correct classloader into the Deployment
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class ClassLoaderInjectionDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ DeploymentUnit unit = dep.getContext().getAttachment(DeploymentUnit.class);
+ if (unit == null)
+ throw new IllegalStateException("Cannot obtain deployement unit");
+
+ ClassLoader classLoader = unit.getClassLoader();
+
+ // Get the webapp context classloader and use it as the deploymet class loader
+ WebMetaData webMetaData = unit.getAttachment(WebMetaData.class);
+ if (webMetaData != null)
+ {
+ classLoader = webMetaData.getContextLoader();
+ }
+
+ dep.setClassLoader(classLoader);
+ }
+}
\ No newline at end of file
Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -55,7 +55,7 @@
@Override
public Deployment createDeployment(DeploymentUnit unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.getClassLoader());
@@ -92,11 +92,14 @@
Class<?> epBean = loader.loadClass(ejbClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbLink;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookJSE.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookJSE.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -29,7 +29,7 @@
import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
+import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
@@ -58,7 +58,7 @@
@Override
public Deployment createDeployment(DeploymentUnit unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.getClassLoader());
@@ -93,11 +93,14 @@
Class<?> epBean = loader.loadClass(servletClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletLink;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerHookEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerHookEJB3.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerHookEJB3.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -35,7 +35,7 @@
import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
+import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.utils.ObjectNameFactory;
@@ -58,7 +58,7 @@
@Override
public Deployment createDeployment(DeploymentUnit unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.getClassLoader());
@@ -81,11 +81,14 @@
Class epBean = container.getBeanClass();
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbName;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
}
Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerHookJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerHookJSE.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerHookJSE.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -35,7 +35,7 @@
import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
+import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.utils.ObjectNameFactory;
@@ -58,7 +58,7 @@
@Override
public Deployment createDeployment(DeploymentUnit unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.getClassLoader());
@@ -83,11 +83,14 @@
Class<?> epBean = loader.loadClass(servletClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -32,7 +32,7 @@
import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
+import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
@@ -61,7 +61,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = new BasicDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.annotationsCl);
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -34,7 +34,7 @@
import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
+import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.utils.ObjectNameFactory;
@@ -56,7 +56,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = new UnifiedMetaDataDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.ucl);
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -41,7 +41,7 @@
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
+import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.utils.ObjectNameFactory;
@@ -63,7 +63,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = new JSEDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.annotationsCl);
Deleted: branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -1,62 +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.jboss50.jbossws;
-
-//$Id$
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.integration.deployment.AbstractDeployer;
-import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * A deployer that injects the correct classloader into the UMDM
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class ClassLoaderInjectionDeployer extends AbstractDeployer
-{
- @Override
- public void create(Deployment dep)
- {
- DeploymentUnit unit = dep.getContext().getAttachment(DeploymentUnit.class);
- if (unit == null)
- throw new IllegalStateException("Cannot obtain deployement unit");
-
- UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
- if (umd == null)
- throw new IllegalStateException("Cannot obtain unified meta data");
-
- ClassLoader classLoader = unit.getClassLoader();
-
- // Get the webapp context classloader and use it as the deploymet class loader
- WebMetaData webMetaData = unit.getAttachment(WebMetaData.class);
- if (webMetaData != null)
- {
- classLoader = webMetaData.getContextLoader();
- }
-
- umd.setClassLoader(classLoader);
- }
-}
\ No newline at end of file
Modified: branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-05-15 10:46:22 UTC (rev 3097)
@@ -173,6 +173,8 @@
Register DeployerHooks with JBoss deployers
-->
<bean name="WSDeployerHook_JAXRPC_JSE" class="org.jboss.ws.integration.jboss50.JAXRPCDeployerHookJSE">
+ <property name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject bean="WSDeployerManagerJSE"/></property>
<install bean="WebServiceDeployerJSE" method="addDeployerHook">
<parameter>
@@ -187,6 +189,8 @@
<depends>WebServiceDeployerJSE</depends>
</bean>
<bean name="WSDeployerHook_JAXRPC_EJB21" class="org.jboss.ws.integration.jboss50.JAXRPCDeployerHookEJB21">
+ <property name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject bean="WSDeployerManagerEJB"/></property>
<install bean="WebServiceDeployerEJB" method="addDeployerHook">
<parameter>
@@ -201,6 +205,8 @@
<depends>WebServiceDeployerEJB</depends>
</bean>
<bean name="WSDeployerHook_JAXWS_JSE" class="org.jboss.ws.integration.jboss50.JAXWSDeployerHookJSE">
+ <property name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject bean="WSDeployerManagerJSE"/></property>
<install bean="WebServiceDeployerJSE" method="addDeployerHook">
<parameter>
@@ -215,6 +221,8 @@
<depends>WebServiceDeployerJSE</depends>
</bean>
<bean name="WSDeployerHook_JAXWS_EJB3" class="org.jboss.ws.integration.jboss50.JAXWSDeployerHookEJB3">
+ <property name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject bean="WSDeployerManagerEJB"/></property>
<install bean="WebServiceDeployerEJB" method="addDeployerHook">
<parameter>
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicEndpoint.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicEndpoint.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicEndpoint.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -79,10 +79,8 @@
private LifecycleHandler lifecycleHandler;
private Map<Class, Object> metaData = new HashMap<Class, Object>();
- public BasicEndpoint(Service service, Class impl)
+ public BasicEndpoint()
{
- this.service = service;
- this.endpointImpl = impl;
this.state = EndpointState.UNDEFINED;
}
Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicService.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicService.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicService.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -72,23 +72,23 @@
*/
public class BasicService implements Service
{
- private Deployment unit;
+ private Deployment dep;
private List<Endpoint> endpoints = new LinkedList<Endpoint>();
- public BasicService(Deployment unit)
+ public BasicService(Deployment dep)
{
- this.unit = unit;
- this.unit.setService(this);
+ this.dep = dep;
+ this.dep.setService(this);
}
public Deployment getDeployment()
{
- return unit;
+ return dep;
}
- public void setDeployment(Deployment unit)
+ public void setDeployment(Deployment dep)
{
- this.unit = unit;
+ this.dep = dep;
}
public void addEndpoint(Endpoint endpoint)
Copied: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java (from rev 3095, branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentImpl.java)
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java (rev 0)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -0,0 +1,140 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+package org.jboss.ws.integration.deployment;
+
+//$Id$
+
+import org.jboss.ws.integration.BasicService;
+import org.jboss.ws.integration.Service;
+
+/**
+ * A general web service deployment dep.
+ *
+ * It has no notion of J2EE deployment packages.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class BasicDeployment implements Deployment
+{
+ // The context for this deployment dep
+ private DeploymentContext context;
+ // A deployment has one service
+ private Service service;
+ // The type of this deployment
+ private DeploymentType type;
+ // The state for this deployment
+ private DeploymentState state;
+ // The deployment class loader
+ private ClassLoader classLoader;
+
+ public BasicDeployment()
+ {
+ context = new BasicDeploymentContext();
+ service = new BasicService(this);
+ state = DeploymentState.UNDEFINED;
+ }
+
+ public DeploymentContext getContext()
+ {
+ return context;
+ }
+
+ public void setContext(DeploymentContext context)
+ {
+ this.context = context;
+ }
+
+ public void setClassLoader(ClassLoader classLoader)
+ {
+ this.classLoader = classLoader;
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return classLoader;
+ }
+
+ public Service getService()
+ {
+ return service;
+ }
+
+ public void setService(Service service)
+ {
+ this.service = service;
+ }
+
+ public DeploymentState getState()
+ {
+ return state;
+ }
+
+ public void setState(DeploymentState deploymentState)
+ {
+ this.state = deploymentState;
+ }
+
+ public DeploymentType getType()
+ {
+ return type;
+ }
+
+ public void setType(DeploymentType deploymentType)
+ {
+ this.type = deploymentType;
+ }
+}
Deleted: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentImpl.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentImpl.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentImpl.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -1,140 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.jboss.ws.integration.deployment;
-
-//$Id$
-
-import org.jboss.ws.integration.BasicService;
-import org.jboss.ws.integration.Service;
-
-/**
- * A general web service deployment dep.
- *
- * It has no notion of J2EE deployment packages.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicDeploymentImpl implements Deployment
-{
- // The context for this deployment dep
- private DeploymentContext context;
- // A deployment has one service
- private Service service;
- // The type of this deployment
- private DeploymentType type;
- // The state for this deployment
- private DeploymentState state;
- // The deployment class loader
- private ClassLoader classLoader;
-
- public BasicDeploymentImpl()
- {
- context = new BasicDeploymentContext();
- service = new BasicService(this);
- state = DeploymentState.UNDEFINED;
- }
-
- public DeploymentContext getContext()
- {
- return context;
- }
-
- public void setContext(DeploymentContext context)
- {
- this.context = context;
- }
-
- public void setClassLoader(ClassLoader loader)
- {
- this.classLoader = loader;
- }
-
- public ClassLoader getClassLoader()
- {
- return classLoader;
- }
-
- public Service getService()
- {
- return service;
- }
-
- public void setService(Service service)
- {
- this.service = service;
- }
-
- public DeploymentState getState()
- {
- return state;
- }
-
- public void setState(DeploymentState deploymentState)
- {
- this.state = deploymentState;
- }
-
- public DeploymentType getType()
- {
- return type;
- }
-
- public void setType(DeploymentType deploymentType)
- {
- this.type = deploymentType;
- }
-}
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployer.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployer.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployer.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -49,7 +49,7 @@
{
UnifiedDeploymentInfo udi = dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
if (udi == null)
- throw new IllegalStateException("Cannot obtain unified deployement info");
+ throw new IllegalStateException("Cannot obtain unified deployment info");
if (udi.type == DeploymentType.JAXRPC_JSE)
{
Added: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployment.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployment.java (rev 0)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployment.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -0,0 +1,82 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+package org.jboss.ws.core.deployment;
+
+//$Id$
+
+import org.jboss.ws.integration.deployment.BasicDeployment;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployment that injects the ClassLoader into the UnifiedMetaDataModel
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class UnifiedMetaDataDeployment extends BasicDeployment
+{
+ @Override
+ public void setClassLoader(ClassLoader classLoader)
+ {
+ super.setClassLoader(classLoader);
+
+ UnifiedMetaData umd = getContext().getAttachment(UnifiedMetaData.class);
+ if (umd != null)
+ {
+ umd.setClassLoader(classLoader);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/UnifiedMetaDataDeployment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/tdiesler/trunk/testsuite/ant-import/build-jars-jaxws.xml
===================================================================
--- branches/tdiesler/trunk/testsuite/ant-import/build-jars-jaxws.xml 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/testsuite/ant-import/build-jars-jaxws.xml 2007-05-15 10:46:22 UTC (rev 3097)
@@ -39,7 +39,7 @@
</jar>
<jar jarfile="${tests.output.dir}/libs/jaxws-eardeployment.ear">
<fileset dir="${tests.output.dir}/libs">
- <!--include name="jaxws-eardeployment.jar"/-->
+ <include name="jaxws-eardeployment.jar"/>
<include name="jaxws-eardeployment.war"/>
</fileset>
<metainf dir="${tests.output.dir}/resources/jaxws/eardeployment/META-INF">
Modified: branches/tdiesler/trunk/testsuite/src/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
===================================================================
--- branches/tdiesler/trunk/testsuite/src/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2007-05-15 08:10:01 UTC (rev 3096)
+++ branches/tdiesler/trunk/testsuite/src/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2007-05-15 10:46:22 UTC (rev 3097)
@@ -45,7 +45,7 @@
return JBossWSTestSetup.newTestSetup(EarTestCase.class, earName);
}
- public void _testEJB3Endpoint() throws Exception
+ public void testEJB3Endpoint() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/earejb3/EJB3Bean?wsdl");
QName serviceName = new QName("http://eardeployment.jaxws.ws.test.jboss.org/", "TestEndpointService");
17 years, 4 months
JBossWS SVN: r3096 - in branches/tdiesler/trunk: integration/jboss42 and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-15 04:10:01 -0400 (Tue, 15 May 2007)
New Revision: 3096
Added:
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/SecurityRolesHandlerEJB21.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/SecurityRolesHandlerEJB3.java
Removed:
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java
Modified:
branches/tdiesler/trunk/build/version.properties
branches/tdiesler/trunk/integration/jboss42/build.xml
branches/tdiesler/trunk/integration/jboss50/build.xml
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ModifyWebMetaDataDeployer.java
branches/tdiesler/trunk/integration/jbws-jboss42/build.xml
branches/tdiesler/trunk/integration/jbws-jboss50/build.xml
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml
branches/tdiesler/trunk/integration/spi/ant-import/build-thirdparty.xml
branches/tdiesler/trunk/integration/spi/build.xml
branches/tdiesler/trunk/integration/sunri-jboss50/build.xml
branches/tdiesler/trunk/jbossws/ant-import/build-thirdparty.xml
branches/tdiesler/trunk/jbossws/build.xml
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/WebAppGeneratorDeployer.java
Log:
restructure
Modified: branches/tdiesler/trunk/build/version.properties
===================================================================
--- branches/tdiesler/trunk/build/version.properties 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/build/version.properties 2007-05-15 08:10:01 UTC (rev 3096)
@@ -21,5 +21,6 @@
jboss-jbossxb=2.0.0.CR2
jboss-microcontainer=2.0.0.Beta3
junit=3.8.1
+sun-jaf=1.1
sun-jaxws=2.1.1
sun-servlet=2.5
Modified: branches/tdiesler/trunk/integration/jboss42/build.xml
===================================================================
--- branches/tdiesler/trunk/integration/jboss42/build.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/jboss42/build.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -67,7 +67,7 @@
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
<mkdir dir="${jbws42.output.etc.dir}"/>
- <copy todir="${jbws42.output.etc.dir}" filtering="yes" overwrite="yes">
+ <copy todir="${jbws42.output.etc.dir}" filtering="yes">
<fileset dir="${build.dir}/etc">
<include name="default.mf"/>
</fileset>
Modified: branches/tdiesler/trunk/integration/jboss50/build.xml
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/build.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/jboss50/build.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -67,7 +67,7 @@
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
<mkdir dir="${jbws50.output.etc.dir}"/>
- <copy todir="${jbws50.output.etc.dir}" filtering="yes" overwrite="yes">
+ <copy todir="${jbws50.output.etc.dir}" filtering="yes">
<fileset dir="${build.dir}/etc">
<include name="default.mf"/>
</fileset>
Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ModifyWebMetaDataDeployer.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ModifyWebMetaDataDeployer.java 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ModifyWebMetaDataDeployer.java 2007-05-15 08:10:01 UTC (rev 3096)
@@ -42,6 +42,11 @@
{
private String servletClass;
+ public String getServletClass()
+ {
+ return servletClass;
+ }
+
public void setServletClass(String servletClass)
{
this.servletClass = servletClass;
Copied: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/SecurityRolesHandlerEJB21.java (from rev 3095, branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java)
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/SecurityRolesHandlerEJB21.java (rev 0)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/SecurityRolesHandlerEJB21.java 2007-05-15 08:10:01 UTC (rev 3096)
@@ -0,0 +1,66 @@
+/*
+ * 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 java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.AssemblyDescriptorMetaData;
+import org.jboss.ws.integration.deployment.SecurityRolesHandler;
+import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+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 SecurityRolesHandlerEJB21 implements SecurityRolesHandler
+{
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ public void addSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
+ {
+ // Fix: http://jira.jboss.org/jira/browse/JBWS-309
+ ApplicationMetaData applMetaData = (ApplicationMetaData)udi.getAttachment(ApplicationMetaData.class);
+ 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()));
+ }
+ }
+ }
+ }
+}
Copied: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/SecurityRolesHandlerEJB3.java (from rev 3095, branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java)
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/SecurityRolesHandlerEJB3.java (rev 0)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/SecurityRolesHandlerEJB3.java 2007-05-15 08:10:01 UTC (rev 3096)
@@ -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.jboss50;
+
+//$Id$
+
+import java.util.Iterator;
+
+import javax.annotation.security.RolesAllowed;
+
+import org.jboss.ejb3.EJBContainer;
+import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.ws.integration.deployment.SecurityRolesHandler;
+import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+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 SecurityRolesHandlerEJB3 implements SecurityRolesHandler
+{
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ public void addSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
+ {
+ Ejb3Deployment ejb3Deployment = udi.getAttachment(Ejb3Deployment.class);
+ if (ejb3Deployment != null)
+ {
+ Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
+ while (it.hasNext())
+ {
+ EJBContainer container = (EJBContainer)it.next();
+ 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));
+ }
+ }
+ }
+ }
+ }
+}
Deleted: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java 2007-05-15 08:10:01 UTC (rev 3096)
@@ -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.jboss50;
-
-//$Id$
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.AssemblyDescriptorMetaData;
-import org.jboss.ws.integration.deployment.SecurityRolesHandler;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-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 implements SecurityRolesHandler
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- public void addSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
- {
- // Fix: http://jira.jboss.org/jira/browse/JBWS-309
- ApplicationMetaData applMetaData = (ApplicationMetaData)udi.getAttachment(ApplicationMetaData.class);
- 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: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java 2007-05-15 08:10:01 UTC (rev 3096)
@@ -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.jboss50;
-
-//$Id$
-
-import java.util.Iterator;
-
-import javax.annotation.security.RolesAllowed;
-
-import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Deployment;
-import org.jboss.logging.Logger;
-import org.jboss.ws.integration.deployment.SecurityRolesHandler;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-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 ServiceEndpointGeneratorEJB3 implements SecurityRolesHandler
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- public void addSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
- {
- Ejb3Deployment ejb3Deployment = udi.getAttachment(Ejb3Deployment.class);
- if (ejb3Deployment != null)
- {
- Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
- while (it.hasNext())
- {
- EJBContainer container = (EJBContainer)it.next();
- 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));
- }
- }
- }
- }
- }
-}
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/build.xml
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/build.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/build.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -72,7 +72,7 @@
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
<mkdir dir="${jbws42.output.etc.dir}"/>
- <copy todir="${jbws42.output.etc.dir}" filtering="yes" overwrite="yes">
+ <copy todir="${jbws42.output.etc.dir}" filtering="yes">
<fileset dir="${jbws42.etc.dir}">
<include name="component-info.xml"/>
</fileset>
Modified: branches/tdiesler/trunk/integration/jbws-jboss50/build.xml
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss50/build.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/jbws-jboss50/build.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -70,7 +70,7 @@
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
<mkdir dir="${jbws50.output.etc.dir}"/>
- <copy todir="${jbws50.output.etc.dir}" filtering="yes" overwrite="yes">
+ <copy todir="${jbws50.output.etc.dir}" filtering="yes">
<fileset dir="${jbws50.etc.dir}">
<include name="component-info.xml"/>
</fileset>
Modified: branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/jbws-jboss50/src/main/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -146,22 +146,27 @@
<bean name="WSEndpointNameDeployer" class="org.jboss.ws.core.deployment.EndpointNameDeployer"/>
<bean name="WSEndpointRegistryDeployer" class="org.jboss.ws.integration.deployment.EndpointRegistryDeployer"/>
<bean name="WSEventingDeployer" class="org.jboss.ws.core.deployment.EventingDeployer"/>
- <bean name="WSModifyWebMetaDataDeployer" class="org.jboss.ws.integration.jboss50.jbossws.ModifyWebMetaDataDeployer">
- <property name="serviceEndpointPublisher"><inject bean="WSServiceEndpointPublisher"/></property>
+ <bean name="WSModifyWebMetaDataDeployer" class="org.jboss.ws.integration.jboss50.ModifyWebMetaDataDeployer">
+ <property name="servletClass">org.jboss.ws.core.server.ServiceEndpointServlet</property>
</bean>
<bean name="WSPublishContractDeployer" class="org.jboss.ws.core.deployment.PublishContractDeployer"/>
<bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.ws.integration.jboss50.UnifiedDeploymentInfoDeployer"/>
<bean name="WSUnifiedMetaDataAssociationDeployer" class="org.jboss.ws.core.deployment.UnifiedMetaDataAssociationDeployer"/>
<bean name="WSUnifiedMetaDataDeployer" class="org.jboss.ws.core.deployment.UnifiedMetaDataDeployer"/>
- <bean name="WSWebAppGeneratorDeployer" class="org.jboss.ws.integration.jboss50.jbossws.WebAppGeneratorDeployer"/>
- <bean name="WSWebAppDeployerDeployer" class="org.jboss.ws.integration.jboss50.jbossws.WebAppDeployerDeployer">
+ <bean name="WSWebAppGeneratorDeployer" class="org.jboss.ws.core.deployment.WebAppGeneratorDeployer">
+ <property name="securityRolesHandlerEJB21"><inject bean="WSSecurityRolesHandlerEJB21"/></property>
+ <property name="securityRolesHandlerEJB3"><inject bean="WSSecurityRolesHandlerEJB3"/></property>
+ </bean>
+ <bean name="WSWebAppDeployerDeployer" class="org.jboss.ws.integration.jboss50.WebAppDeployerDeployer">
<property name="serviceEndpointPublisher"><inject bean="WSServiceEndpointPublisher"/></property>
<property name="mainDeployer"><inject bean="MainDeployer"/></property>
</bean>
<!-- Deployer helper beans -->
- <bean name="WSServiceEndpointPublisher" class="org.jboss.ws.core.deployment.ServiceEndpointPublisher">
- <property name="servletClass">org.jboss.ws.core.server.ServiceEndpointServlet</property>
+ <bean name="WSSecurityRolesHandlerEJB21" class="org.jboss.ws.integration.jboss50.SecurityRolesHandlerEJB21"/>
+ <bean name="WSSecurityRolesHandlerEJB3" class="org.jboss.ws.integration.jboss50.SecurityRolesHandlerEJB3"/>
+ <bean name="WSServiceEndpointPublisher" class="org.jboss.ws.integration.deployment.ServiceEndpointPublisher">
+ <property name="servletClass"><inject bean="WSModifyWebMetaDataDeployer" property="servletClass"/></property>
</bean>
<!--
Modified: branches/tdiesler/trunk/integration/spi/ant-import/build-thirdparty.xml
===================================================================
--- branches/tdiesler/trunk/integration/spi/ant-import/build-thirdparty.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/spi/ant-import/build-thirdparty.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -52,6 +52,7 @@
<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/microcontainer/${jboss-microcontainer}/lib/jboss-microcontainer-src.zip" dest="${thirdparty.dir}/jboss-microcontainer-src.zip" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/junit/${junit}/lib/junit.jar" dest="${thirdparty.dir}/junit.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar" dest="${thirdparty.dir}/activation.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-api.jar" dest="${thirdparty.dir}/jaxws-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jsr181-api.jar" dest="${thirdparty.dir}/jsr181-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-servlet/${sun-servlet}/lib/servlet-api.jar" dest="${thirdparty.dir}/servlet-api.jar" usetimestamp="true" verbose="true"/>
@@ -63,6 +64,7 @@
<!-- The compile classpath for jbossws spi -->
<path id="thirdparty.classpath">
+ <pathelement location="${thirdparty.dir}/activation.jar"/>
<pathelement location="${thirdparty.dir}/jboss-common-core.jar"/>
<pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
<pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
Modified: branches/tdiesler/trunk/integration/spi/build.xml
===================================================================
--- branches/tdiesler/trunk/integration/spi/build.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/spi/build.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -69,7 +69,7 @@
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
<mkdir dir="${spi.output.etc.dir}"/>
- <copy todir="${spi.output.etc.dir}" filtering="yes" overwrite="yes">
+ <copy todir="${spi.output.etc.dir}" filtering="yes">
<fileset dir="${spi.etc.dir}">
<include name="component-info.xml"/>
</fileset>
Modified: branches/tdiesler/trunk/integration/sunri-jboss50/build.xml
===================================================================
--- branches/tdiesler/trunk/integration/sunri-jboss50/build.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/integration/sunri-jboss50/build.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -70,7 +70,7 @@
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
<mkdir dir="${sunri50.output.etc.dir}"/>
- <copy todir="${sunri50.output.etc.dir}" filtering="yes" overwrite="yes">
+ <copy todir="${sunri50.output.etc.dir}" filtering="yes">
<fileset dir="${sunri50.etc.dir}">
<include name="component-info.xml"/>
</fileset>
Modified: branches/tdiesler/trunk/jbossws/ant-import/build-thirdparty.xml
===================================================================
--- branches/tdiesler/trunk/jbossws/ant-import/build-thirdparty.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/jbossws/ant-import/build-thirdparty.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -85,7 +85,6 @@
<get src="${jboss.repository}/oswego-concurrent/${oswego-concurrent}/lib/concurrent.jar" dest="${thirdparty.dir}/concurrent.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/qdox/${qdox}/lib/qdox.jar" dest="${thirdparty.dir}/qdox.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/stax-api/${stax-api}/lib/stax-api.jar" dest="${thirdparty.dir}/stax-api.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar" dest="${thirdparty.dir}/activation.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-javamail/${sun-javamail}/lib/mail.jar" dest="${thirdparty.dir}/mail.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar" dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-impl.jar" dest="${thirdparty.dir}/jaxb-impl.jar" usetimestamp="true" verbose="true"/>
Modified: branches/tdiesler/trunk/jbossws/build.xml
===================================================================
--- branches/tdiesler/trunk/jbossws/build.xml 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/jbossws/build.xml 2007-05-15 08:10:01 UTC (rev 3096)
@@ -79,7 +79,7 @@
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
<mkdir dir="${core.output.etc.dir}"/>
- <copy todir="${core.output.etc.dir}" filtering="yes" overwrite="yes">
+ <copy todir="${core.output.etc.dir}" filtering="yes">
<fileset dir="${core.etc.dir}"/>
<fileset dir="${build.dir}/etc">
<include name="default.mf"/>
Modified: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/WebAppGeneratorDeployer.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/WebAppGeneratorDeployer.java 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/deployment/WebAppGeneratorDeployer.java 2007-05-15 08:10:01 UTC (rev 3096)
@@ -23,11 +23,28 @@
//$Id$
-import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.integration.deployment.AbstractDeployer;
import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.integration.deployment.SecurityRolesHandler;
import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.utils.DOMUtils;
+import org.w3c.dom.Element;
/**
* A deployer that generates a webapp for an EJB endpoint
@@ -37,8 +54,19 @@
*/
public class WebAppGeneratorDeployer extends AbstractDeployer
{
- private ServiceEndpointGeneratorEJB serviceEndpointGenerator;
-
+ private SecurityRolesHandler securityRolesHandlerEJB21;
+ private SecurityRolesHandler securityRolesHandlerEJB3;
+
+ public void setSecurityRolesHandlerEJB21(SecurityRolesHandler securityRolesHandlerEJB21)
+ {
+ this.securityRolesHandlerEJB21 = securityRolesHandlerEJB21;
+ }
+
+ public void setSecurityRolesHandlerEJB3(SecurityRolesHandler securityRolesHandlerEJB3)
+ {
+ this.securityRolesHandlerEJB3 = securityRolesHandlerEJB3;
+ }
+
@Override
public void create(Deployment dep)
{
@@ -50,6 +78,259 @@
if (umd == null)
throw new IllegalStateException("Cannot obtain unified meta data");
- udi.webappURL = serviceEndpointGenerator.generatWebDeployment(umd, udi);
+ if (dep.getType().toString().endsWith("EJB21"))
+ {
+ udi.webappURL = generatWebDeployment(umd, udi, securityRolesHandlerEJB21);
+ }
+ else if (dep.getType().toString().endsWith("EJB3"))
+ {
+ udi.webappURL = generatWebDeployment(umd, udi, securityRolesHandlerEJB3);
+ }
}
+
+ private URL generatWebDeployment(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, SecurityRolesHandler securityHandler)
+ {
+ // Collect the list of ServerEndpointMetaData
+ List<ServerEndpointMetaData> sepMetaDataList = new ArrayList<ServerEndpointMetaData>();
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ sepMetaDataList.add((ServerEndpointMetaData)epMetaData);
+ }
+ }
+
+ Element webDoc = createWebAppDescriptor(sepMetaDataList, udi, securityHandler);
+ Element jbossDoc = createJBossWebAppDescriptor(sepMetaDataList);
+
+ File tmpWar = null;
+ try
+ {
+ ServerConfig config = ServerConfigFactory.getInstance().getServerConfig();
+ File tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/deploy");
+
+ String deploymentName = wsMetaData.getDeploymentName().replace('/', '-');
+ 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();
+
+ return tmpWar.toURL();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to create webservice.war", e);
+ }
+ }
+
+ private Element createWebAppDescriptor(List<ServerEndpointMetaData> sepMetaDataList, UnifiedDeploymentInfo udi, SecurityRolesHandler securityHandler)
+ {
+ Element webApp = DOMUtils.createElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ for (ServerEndpointMetaData sepMetaData : sepMetaDataList)
+ {
+ 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 implName = sepMetaData.getServiceEndpointImplName();
+ String seiName = sepMetaData.getServiceEndpointInterfaceName();
+ String endpointTarget = (implName != null ? implName : seiName);
+ servletClass.appendChild(DOMUtils.createTextNode(endpointTarget));
+ }
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ ArrayList urlPatters = new ArrayList();
+ for (ServerEndpointMetaData sepMetaData : sepMetaDataList)
+ {
+ 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 (ServerEndpointMetaData sepMetaData : sepMetaDataList)
+ {
+ 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));
+ if (sepMetaData.isSecureWSDLAccess())
+ {
+ Element method = (Element)wrc.appendChild(DOMUtils.createElement("http-method"));
+ method.appendChild(DOMUtils.createTextNode("GET"));
+ }
+ Element 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"));
+
+ securityHandler.addSecurityRoles(webApp, udi);
+ }
+
+ return webApp;
+ }
+
+ private Element createJBossWebAppDescriptor(List<ServerEndpointMetaData> sepMetaDataList)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ <virtual-host>some.domain.com</virtual-host>
+ </jboss-web>
+ */
+ Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+ UnifiedMetaData wsMetaData = sepMetaDataList.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 (ServerEndpointMetaData sepMetaData : sepMetaDataList)
+ {
+ 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));
+
+ String[] virtualHosts = null;
+ for (ServerEndpointMetaData sepMetaData : sepMetaDataList)
+ {
+ String[] next = sepMetaData.getVirtualHosts();
+ if (next != null && next.length > 0)
+ {
+ Arrays.sort(next);
+ if (virtualHosts == null)
+ {
+ virtualHosts = next;
+ }
+ else
+ {
+ if (Arrays.equals(virtualHosts, next) == false)
+ {
+ throw new WSException("All endpoints must define the same virtual hosts");
+ }
+ }
+ }
+ }
+
+ if (virtualHosts != null)
+ {
+ for (String current : virtualHosts)
+ {
+ Element virtualHost = (Element)jbossWeb.appendChild(DOMUtils.createElement("virtual-host"));
+ virtualHost.appendChild(DOMUtils.createTextNode(current));
+ }
+ }
+
+ return jbossWeb;
+ }
}
\ No newline at end of file
Deleted: branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java
===================================================================
--- branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java 2007-05-15 05:13:16 UTC (rev 3095)
+++ branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java 2007-05-15 08:10:01 UTC (rev 3096)
@@ -1,306 +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.core.server;
-
-//$Id$
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.integration.deployment.SecurityRolesHandler;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.management.ServerConfig;
-import org.jboss.ws.integration.management.ServerConfigFactory;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Generate a web deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB.class);
-
- private SecurityRolesHandler securityRolesHandler;
-
- public URL generatWebDeployment(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi)
- {
- // Collect the list of ServerEndpointMetaData
- List<ServerEndpointMetaData> sepMetaDataList = new ArrayList<ServerEndpointMetaData>();
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- sepMetaDataList.add((ServerEndpointMetaData)epMetaData);
- }
- }
-
- Element webDoc = createWebAppDescriptor(sepMetaDataList, udi);
- Element jbossDoc = createJBossWebAppDescriptor(sepMetaDataList);
-
- File tmpWar = null;
- try
- {
- ServerConfig config = ServerConfigFactory.getInstance().getServerConfig();
- File tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/deploy");
-
- String deploymentName = wsMetaData.getDeploymentName().replace('/', '-');
- 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();
-
- return tmpWar.toURL();
- }
- catch (IOException e)
- {
- throw new WSException("Failed to create webservice.war", e);
- }
- }
-
- private Element createWebAppDescriptor(List<ServerEndpointMetaData> sepMetaDataList, UnifiedDeploymentInfo udi)
- {
- Element webApp = DOMUtils.createElement("web-app");
-
- /*
- <servlet>
- <servlet-name>
- <servlet-class>
- </servlet>
- */
- for (ServerEndpointMetaData sepMetaData : sepMetaDataList)
- {
- 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 implName = sepMetaData.getServiceEndpointImplName();
- String seiName = sepMetaData.getServiceEndpointInterfaceName();
- String endpointTarget = (implName != null ? implName : seiName);
- servletClass.appendChild(DOMUtils.createTextNode(endpointTarget));
- }
-
- /*
- <servlet-mapping>
- <servlet-name>
- <url-pattern>
- </servlet-mapping>
- */
- ArrayList urlPatters = new ArrayList();
- for (ServerEndpointMetaData sepMetaData : sepMetaDataList)
- {
- 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 (ServerEndpointMetaData sepMetaData : sepMetaDataList)
- {
- 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));
- if (sepMetaData.isSecureWSDLAccess())
- {
- Element method = (Element)wrc.appendChild(DOMUtils.createElement("http-method"));
- method.appendChild(DOMUtils.createTextNode("GET"));
- }
- Element 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"));
-
- securityRolesHandler.addSecurityRoles(webApp, udi);
- }
-
- return webApp;
- }
-
- private Element createJBossWebAppDescriptor(List<ServerEndpointMetaData> sepMetaDataList)
- {
- /* Create a jboss-web
- <jboss-web>
- <security-domain>java:/jaas/cts</security-domain>
- <context-root>/ws/ejbN/</context-root>
- <virtual-host>some.domain.com</virtual-host>
- </jboss-web>
- */
- Element jbossWeb = DOMUtils.createElement("jboss-web");
-
- UnifiedMetaData wsMetaData = sepMetaDataList.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 (ServerEndpointMetaData sepMetaData : sepMetaDataList)
- {
- 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));
-
- String[] virtualHosts = null;
- for (ServerEndpointMetaData sepMetaData : sepMetaDataList)
- {
- String[] next = sepMetaData.getVirtualHosts();
- if (next != null && next.length > 0)
- {
- Arrays.sort(next);
- if (virtualHosts == null)
- {
- virtualHosts = next;
- }
- else
- {
- if (Arrays.equals(virtualHosts, next) == false)
- {
- throw new WSException("All endpoints must define the same virtual hosts");
- }
- }
- }
- }
-
- if (virtualHosts != null)
- {
- for (String current : virtualHosts)
- {
- Element virtualHost = (Element)jbossWeb.appendChild(DOMUtils.createElement("virtual-host"));
- virtualHost.appendChild(DOMUtils.createTextNode(current));
- }
- }
-
- return jbossWeb;
- }
-}
17 years, 4 months