[jboss-cvs] JBossAS SVN: r68761 - in trunk: ejb3/src/main/org/jboss/ejb3/mdb and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jan 9 16:51:49 EST 2008
Author: thomas.diesler at jboss.com
Date: 2008-01-09 16:51:49 -0500 (Wed, 09 Jan 2008)
New Revision: 68761
Added:
trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB21.java
trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB3.java
Modified:
trunk/build/build-distr.xml
trunk/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java
trunk/webservices/src/main/org/jboss/wsf/container/jboss50/EJBArchiveMetaDataAdapterEJB3.java
trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerFactoryImpl.java
trunk/webservices/src/main/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
Log:
[JBWS-1911] Support the JMS transport with JAX-WS
Modified: trunk/build/build-distr.xml
===================================================================
--- trunk/build/build-distr.xml 2008-01-09 21:05:58 UTC (rev 68760)
+++ trunk/build/build-distr.xml 2008-01-09 21:51:49 UTC (rev 68761)
@@ -1921,6 +1921,9 @@
<include name="stax-ex.jar"/>
<include name="streambuffer.jar"/>
</fileset>
+ <fileset dir="${trove.trove.lib}">
+ <include name="trove.jar"/>
+ </fileset>
<fileset dir="${woodstox.woodstox.lib}">
<include name="wstx.jar"/>
</fileset>
Modified: trunk/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java 2008-01-09 21:05:58 UTC (rev 68760)
+++ trunk/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java 2008-01-09 21:51:49 UTC (rev 68761)
@@ -73,7 +73,7 @@
messagingType = annotation.messageListenerInterface();
if (messagingType.getName().equals(Object.class.getName()))
{
- Set<Class<?>> businessInterfaces = ProxyFactoryHelper.getBusinessInterfaces(clazz,false);
+ Set<Class<?>> businessInterfaces = ProxyFactoryHelper.getBusinessInterfaces(clazz,true);
if (businessInterfaces.size() > 1 || businessInterfaces.size() == 0)
throw new RuntimeException("Unable to choose messagingType interface for MDB " + getEjbName() + " from " + businessInterfaces);
messagingType = businessInterfaces.iterator().next();
Modified: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/EJBArchiveMetaDataAdapterEJB3.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/EJBArchiveMetaDataAdapterEJB3.java 2008-01-09 21:05:58 UTC (rev 68760)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/EJBArchiveMetaDataAdapterEJB3.java 2008-01-09 21:51:49 UTC (rev 68761)
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.ejb3.Container;
@@ -41,6 +42,7 @@
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData;
import org.jboss.metadata.javaee.spec.PortComponent;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -115,7 +117,6 @@
if (container instanceof StatelessContainer)
{
ejbMetaData = new SLSBMetaData();
-
JBossEnterpriseBeanMetaData beanMetaData = container.getXml();
if (beanMetaData instanceof JBossGenericBeanMetaData)
{
@@ -129,8 +130,17 @@
else if (container instanceof MessagingContainer)
{
ejbMetaData = new MDBMetaData();
- log.warn("No implemented: initialize MDB destination");
- //((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessagingContainer)container).getDestination());
+ MessagingContainer mdb = (MessagingContainer)container;
+ Map props = mdb.getActivationConfigProperties();
+ if (props != null)
+ {
+ ActivationConfigPropertyMetaData destProp = (ActivationConfigPropertyMetaData)props.get("destination");
+ if (destProp != null)
+ {
+ String destination = destProp.getValue();
+ ((MDBMetaData)ejbMetaData).setDestinationJndiName(destination);
+ }
+ }
}
if (ejbMetaData != null)
Modified: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerFactoryImpl.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerFactoryImpl.java 2008-01-09 21:05:58 UTC (rev 68760)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerFactoryImpl.java 2008-01-09 21:51:49 UTC (rev 68761)
@@ -43,14 +43,18 @@
case JAXRPC_EJB21:
handler = new InvocationHandlerEJB21();
break;
+ case JAXRPC_MDB21:
+ handler = new InvocationHandlerMDB21();
+ break;
case JAXWS_JSE:
handler = new InvocationHandlerJAXWS();
break;
- case JAXWS_EJB21:
- handler = new InvocationHandlerEJB21();
- break;
case JAXWS_EJB3:
handler = new InvocationHandlerEJB3();
+ break;
+ case JAXWS_MDB3:
+ handler = new InvocationHandlerMDB3();
+ break;
}
if(null == handler)
Added: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB21.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB21.java (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB21.java 2008-01-09 21:51:49 UTC (rev 68761)
@@ -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.wsf.container.jboss50;
+
+// $Id$
+
+import java.lang.reflect.Method;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+
+/**
+ * Handles invocations on MDB EJB21 endpoints.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Apr-2007
+ */
+public class InvocationHandlerMDB21 extends AbstractInvocationHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(InvocationHandlerMDB21.class);
+
+ public Invocation createInvocation()
+ {
+ return new Invocation();
+ }
+
+ public void init(Endpoint ep)
+ {
+
+ }
+
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
+ {
+ log.debug("Invoke: " + epInv.getJavaMethod().getName());
+
+ try
+ {
+ InvocationContext invContext = epInv.getInvocationContext();
+ Object targetBean = invContext.getTargetBean();
+ Class implClass = targetBean.getClass();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getArgs();
+ Object retObj = implMethod.invoke(targetBean, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+}
Property changes on: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB3.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB3.java (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB3.java 2008-01-09 21:51:49 UTC (rev 68761)
@@ -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.wsf.container.jboss50;
+
+// $Id$
+
+import java.lang.reflect.Method;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+
+/**
+ * Handles invocations on MDB EJB3 endpoints.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Apr-2007
+ */
+public class InvocationHandlerMDB3 extends AbstractInvocationHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(InvocationHandlerMDB3.class);
+
+ public Invocation createInvocation()
+ {
+ return new Invocation();
+ }
+
+ public void init(Endpoint ep)
+ {
+
+ }
+
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
+ {
+ log.debug("Invoke: " + epInv.getJavaMethod().getName());
+
+ try
+ {
+ InvocationContext invContext = epInv.getInvocationContext();
+ Object targetBean = invContext.getTargetBean();
+ Class implClass = targetBean.getClass();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getArgs();
+ Object retObj = implMethod.invoke(targetBean, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+}
Property changes on: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerMDB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java 2008-01-09 21:05:58 UTC (rev 68760)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java 2008-01-09 21:51:49 UTC (rev 68761)
@@ -27,6 +27,7 @@
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.ejb3.EJBContainer;
import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.ejb3.mdb.MessagingContainer;
import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.metadata.serviceref.VirtualFileAdaptor;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -116,7 +117,7 @@
private boolean isWebServiceBean(EJBContainer container)
{
boolean isWebServiceBean = false;
- if (container instanceof StatelessContainer)
+ if (container instanceof StatelessContainer || container instanceof MessagingContainer)
{
boolean isWebService = container.resolveAnnotation(WebService.class) != null;
boolean isWebServiceProvider = container.resolveAnnotation(WebServiceProvider.class) != null;
More information about the jboss-cvs-commits
mailing list