Author: pete.muir(a)jboss.org
Date: 2009-07-28 11:56:32 -0400 (Tue, 28 Jul 2009)
New Revision: 3315
Modified:
extensions/trunk/se/pom.xml
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverMethodImpl.java
Log:
WBRI-314
Modified: extensions/trunk/se/pom.xml
===================================================================
--- extensions/trunk/se/pom.xml 2009-07-28 13:24:13 UTC (rev 3314)
+++ extensions/trunk/se/pom.xml 2009-07-28 15:56:32 UTC (rev 3315)
@@ -54,22 +54,21 @@
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.jta</groupId>
+ <artifactId>transaction-api</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-logger</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-core</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
</dependencies>
<scm>
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-07-28
13:24:13 UTC (rev 3314)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-07-28
15:56:32 UTC (rev 3315)
@@ -16,11 +16,13 @@
*/
package org.jboss.webbeans.event;
+import javax.enterprise.event.Observes;
import javax.enterprise.event.TransactionPhase;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -42,7 +44,7 @@
public static <X, T> ObserverMethodImpl<X, T> create(WBMethod<?>
method, RIBean<?> declaringBean, BeanManagerImpl manager)
{
ObserverMethodImpl<X, T> result = null;
- TransactionPhase transactionPhase =
TransactionalObserverMethodImpl.getTransactionalPhase(method);
+ TransactionPhase transactionPhase = getTransactionalPhase(method);
if (manager.getServices().contains(TransactionServices.class) &&
!transactionPhase.equals(TransactionPhase.IN_PROGRESS))
{
result = new TransactionalObserverMethodImpl<X, T>(method, declaringBean,
transactionPhase, manager);
@@ -54,4 +56,16 @@
result.initialize();
return result;
}
+
+ /**
+ * Tests an observer method to see if it is transactional.
+ *
+ * @param observer The observer method
+ * @return true if the observer method is annotated as transactional
+ */
+ public static TransactionPhase getTransactionalPhase(WBMethod<?> observer)
+ {
+ WBParameter<?> parameter =
observer.getAnnotatedParameters(Observes.class).iterator().next();
+ return parameter.getAnnotationStore().getAnnotation(Observes.class).during();
+ }
}
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverMethodImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverMethodImpl.java 2009-07-28
13:24:13 UTC (rev 3314)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverMethodImpl.java 2009-07-28
15:56:32 UTC (rev 3315)
@@ -16,14 +16,12 @@
*/
package org.jboss.webbeans.event;
-import javax.enterprise.event.Observes;
import javax.enterprise.event.TransactionPhase;
import javax.transaction.Synchronization;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.introspector.WBMethod;
-import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -32,17 +30,6 @@
*/
class TransactionalObserverMethodImpl<X, T> extends ObserverMethodImpl<X, T>
{
- /**
- * Tests an observer method to see if it is transactional.
- *
- * @param observer The observer method
- * @return true if the observer method is annotated as transactional
- */
- public static TransactionPhase getTransactionalPhase(WBMethod<?> observer)
- {
- WBParameter<?> parameter =
observer.getAnnotatedParameters(Observes.class).iterator().next();
- return parameter.getAnnotationStore().getAnnotation(Observes.class).during();
- }
/**
* Creates a new instance of a transactional observer method implicit object.