[jboss-cvs] jboss-seam/src/main/org/jboss/seam ...
Gavin King
gavin.king at jboss.com
Tue Oct 10 00:48:21 EDT 2006
User: gavin
Date: 06/10/10 00:48:21
Modified: src/main/org/jboss/seam Component.java
Log:
JBSEAM-399 @Synchronized
Revision Changes Path
1.182 +15 -2 jboss-seam/src/main/org/jboss/seam/Component.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Component.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -b -r1.181 -r1.182
--- Component.java 10 Oct 2006 03:48:19 -0000 1.181
+++ Component.java 10 Oct 2006 04:48:21 -0000 1.182
@@ -65,6 +65,7 @@
import org.jboss.seam.annotations.RequestParameter;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Startup;
+import org.jboss.seam.annotations.Synchronized;
import org.jboss.seam.annotations.Unwrap;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.contexts.Context;
@@ -93,6 +94,7 @@
import org.jboss.seam.interceptors.RemoveInterceptor;
import org.jboss.seam.interceptors.RollbackInterceptor;
import org.jboss.seam.interceptors.SecurityInterceptor;
+import org.jboss.seam.interceptors.SynchronizationInterceptor;
import org.jboss.seam.interceptors.TransactionInterceptor;
import org.jboss.seam.interceptors.ValidationInterceptor;
import org.jboss.seam.util.Conversions;
@@ -109,7 +111,7 @@
*
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
* @author Gavin King
- * @version $Revision: 1.181 $
+ * @version $Revision: 1.182 $
*/
@Scope(ScopeType.APPLICATION)
public class Component
@@ -127,6 +129,7 @@
private boolean startup;
private String[] dependencies;
private boolean mutable;
+ private boolean synchronize;
private Method destroyMethod;
private Method createMethod;
@@ -216,6 +219,12 @@
Init.instance().getMutableComponentNames().add(name);
}
+ synchronize = beanClass.isAnnotationPresent(Synchronized.class);
+ if (synchronize && scope==STATELESS)
+ {
+ throw new IllegalArgumentException("@Synchronized not meaningful for stateless components: " + name);
+ }
+
jndiName = getJndiName(applicationContext);
log.info(
@@ -671,11 +680,15 @@
private void initDefaultInterceptors()
{
+ if (synchronize)
+ {
+ addInterceptor( new Interceptor( new SynchronizationInterceptor(), this ) );
+ }
addInterceptor( new Interceptor( new AsynchronousInterceptor(), this ) );
addInterceptor( new Interceptor( new ExceptionInterceptor(), this ) );
addInterceptor( new Interceptor( new RemoveInterceptor(), this ) );
addInterceptor( new Interceptor( new EventInterceptor(), this ) );
- addInterceptor( new Interceptor( new ConversationalInterceptor(), this ) );
+ addInterceptor( new Interceptor( new ConversationalInterceptor(), this ) ); //legacy!
addInterceptor( new Interceptor( new BusinessProcessInterceptor(), this ) );
addInterceptor( new Interceptor( new ConversationInterceptor(), this ) );
addInterceptor( new Interceptor( new OutcomeInterceptor(), this ) );
More information about the jboss-cvs-commits
mailing list