[jboss-cvs] JBossAS SVN: r89920 - in branches/JBPAPP_4_2_0_GA_CP/ejb3: src/main/org/jboss/ejb3/mdb/inflow and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jun 5 16:41:29 EDT 2009
Author: permaine
Date: 2009-06-05 16:41:29 -0400 (Fri, 05 Jun 2009)
New Revision: 89920
Removed:
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/
Modified:
branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/JBossMessageEndpointFactory.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java
Log:
Back out fix for JBPAPP-1668 as the branch is currently frozen for CP release
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml 2009-06-05 19:42:05 UTC (rev 89919)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml 2009-06-05 20:41:29 UTC (rev 89920)
@@ -2185,18 +2185,6 @@
<build-simple-jar name="jbpapp1224"/>
</target>
- <target name="jbpapp1668"
- description="Builds a simple jar files."
- depends="compile-classes">
-
- <jar jarfile="${build.lib}/jbpapp1668.jar">
- <fileset dir="${build.classes}">
- <include name="org/jboss/ejb3/test/common/*.class"/>
- <include name="org/jboss/ejb3/test/jbpapp1668/*.class"/>
- </fileset>
- </jar>
- </target>
-
<target name="jbpapp1951" depends="compile-classes">
<mkdir dir="${build.lib}"/>
<jar jarfile="${build.lib}/jbpapp1951.jar">
@@ -3906,7 +3894,6 @@
jbpapp999,
jbpapp1186,
jbpapp1224,
- jbpapp1668,
jbpapp1951,
jbas4489, epcpropagation, jaccpropagation,
aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency, jaxws,
@@ -4556,9 +4543,6 @@
<param name="test" value="jbpapp1224"/>
</antcall>
<antcall target="test" inheritRefs="true">
- <param name="test" value="jbpapp1668"/>
- </antcall>
- <antcall target="test" inheritRefs="true">
<param name="test" value="jbpapp1951"/>
</antcall>
</target>
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/JBossMessageEndpointFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/JBossMessageEndpointFactory.java 2009-06-05 19:42:05 UTC (rev 89919)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/JBossMessageEndpointFactory.java 2009-06-05 20:41:29 UTC (rev 89920)
@@ -26,11 +26,12 @@
import java.util.Collection;
import java.util.HashMap;
+import javax.ejb.TransactionManagementType;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
-import javax.ejb.TransactionManagementType;
-import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
import javax.resource.spi.ActivationSpec;
import javax.resource.spi.UnavailableException;
import javax.resource.spi.endpoint.MessageEndpoint;
@@ -40,11 +41,11 @@
import org.jboss.deployment.DeploymentException;
import org.jboss.ejb3.Container;
import org.jboss.ejb3.KernelAbstractionFactory;
-import org.jboss.ejb3.mdb.MessagingContainer;
import org.jboss.ejb3.tx.TxUtil;
-import org.jboss.logging.Logger;
+import org.jboss.ejb3.mdb.MessagingContainer;
import org.jboss.metadata.ActivationConfigPropertyMetaData;
import org.jboss.mx.util.JMXExceptionDecoder;
+import org.jboss.logging.Logger;
import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
@@ -185,10 +186,8 @@
TransactionManagementType mtype = TxUtil.getTransactionManagementType(container);
if (mtype == javax.ejb.TransactionManagementType.BEAN) return false;
- // JBPAPP-1668: the method can be called by anybody using the interface method (== unadvised)
- Method advisedMethod = container.getMethodInfo(method).getAdvisedMethod();
-
- TransactionAttribute attr = (TransactionAttribute)container.resolveAnnotation(advisedMethod, TransactionAttribute.class);
+
+ TransactionAttribute attr = (TransactionAttribute)container.resolveAnnotation(method, TransactionAttribute.class);
if (attr == null)
{
attr =(TransactionAttribute)container.resolveAnnotation(TransactionAttribute.class);
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java 2009-06-05 19:42:05 UTC (rev 89919)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java 2009-06-05 20:41:29 UTC (rev 89920)
@@ -21,8 +21,8 @@
*/
package org.jboss.ejb3.mdb.inflow;
-import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
+import java.lang.reflect.InvocationHandler;
import javax.resource.ResourceException;
import javax.resource.spi.endpoint.MessageEndpointFactory;
@@ -31,10 +31,11 @@
import javax.transaction.TransactionManager;
import javax.transaction.xa.XAResource;
-import org.jboss.aop.MethodInfo;
import org.jboss.aop.joinpoint.Invocation;
import org.jboss.aop.joinpoint.MethodInvocation;
+import org.jboss.aop.MethodInfo;
import org.jboss.ejb3.mdb.MessagingContainer;
+import org.jboss.ejb3.mdb.MDB;
import org.jboss.ejb3.tx.TxUtil;
import org.jboss.logging.Logger;
@@ -48,26 +49,6 @@
{
private static final Logger log = Logger.getLogger(MessageInflowLocalProxy.class);
- private static final Method METHOD_TO_STRING;
-
- static
- {
- try
- {
- //METHOD_EQUALS = Object.class.getDeclaredMethod("equals", Object.class);
- //METHOD_HASH_CODE = Object.class.getDeclaredMethod("hashCode");
- METHOD_TO_STRING = Object.class.getDeclaredMethod("toString");
- }
- catch (SecurityException e)
- {
- throw new RuntimeException(e);
- }
- catch (NoSuchMethodException e)
- {
- throw new RuntimeException(e);
- }
- }
-
/** The key for the factory */
public static final String MESSAGE_ENDPOINT_FACTORY = "MessageEndpoint.Factory";
@@ -123,10 +104,7 @@
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
- {
- if(method.equals(METHOD_TO_STRING))
- return getProxyString(proxy);
-
+ {
// Are we still useable?
if (released.get())
throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " has been released");
@@ -220,7 +198,8 @@
try
{
// Is the delivery transacted?
- boolean isTransacted = messageEndpointFactory.isDeliveryTransacted((Method) args[0]);
+ MethodInfo methodInfo = container.getMethodInfo((Method)args[0]);
+ boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(methodInfo.getAdvisedMethod());
startTransaction("beforeDelivery", proxy, container, method, args, isTransacted);
}
@@ -283,7 +262,7 @@
// Check for starting a transaction
if (oldClassLoader == null)
{
- boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(method);
+ boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(methodInfo.getAdvisedMethod());
startTransaction("delivery", proxy, container, method, args, isTransacted);
}
return container.localInvoke(methodInfo, args);
Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java 2009-06-05 19:42:05 UTC (rev 89919)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java 2009-06-05 20:41:29 UTC (rev 89920)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.common;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-
-import org.jboss.logging.Logger;
-
-/**
- * Sets up a MDB which can reply to messages via sendReply.
- *
- * Make sure that postConstruct are preDestroy are properly executed when overridden.
- *
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public abstract class AbstractReplierMDB implements MessageListener
-{
- private static final Logger log = Logger.getLogger(AbstractReplierMDB.class);
-
- @Resource(mappedName="java:/ConnectionFactory")
- private QueueConnectionFactory factory;
-
- private QueueConnection connection;
- private QueueSession session;
- private QueueSender sender;
-
- /**
- * Send an object message to the specified destination.
- *
- * @param destination
- * @param obj
- * @throws JMSException
- */
- protected void sendReply(Destination destination, Serializable obj) throws JMSException
- {
- Message message = session.createObjectMessage(obj);
- sender.send(destination, message);
- }
-
- @PostConstruct
- public void postConstruct()
- {
- try
- {
- connection = factory.createQueueConnection();
- session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- sender = session.createSender(null);
- }
- catch(JMSException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- @PreDestroy
- public void preDestroy()
- {
- try
- {
- if(sender != null)
- sender.close();
- if(session != null)
- session.close();
- if(connection != null)
- connection.close();
- }
- catch(JMSException e)
- {
- throw new RuntimeException(e);
- }
- }
-}
More information about the jboss-cvs-commits
mailing list