[jboss-cvs] jboss-seam/src/main/org/jboss/seam/interceptors ...
Gavin King
gavin.king at jboss.com
Wed Oct 4 19:42:53 EDT 2006
User: gavin
Date: 06/10/04 19:42:53
Modified: src/main/org/jboss/seam/interceptors
ClientSideInterceptor.java JavaBeanInterceptor.java
Log:
fix bug where components of non-default role got initialized with values from the default role
Revision Changes Path
1.2 +7 -1 jboss-seam/src/main/org/jboss/seam/interceptors/ClientSideInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ClientSideInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/interceptors/ClientSideInterceptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ClientSideInterceptor.java 26 Jul 2006 21:51:05 -0000 1.1
+++ ClientSideInterceptor.java 4 Oct 2006 23:42:53 -0000 1.2
@@ -1,4 +1,4 @@
-//$Id: ClientSideInterceptor.java,v 1.1 2006/07/26 21:51:05 gavin Exp $
+//$Id: ClientSideInterceptor.java,v 1.2 2006/10/04 23:42:53 gavin Exp $
package org.jboss.seam.interceptors;
import java.io.Serializable;
@@ -41,6 +41,7 @@
private Object interceptInvocation(final Object bean, final Method method, final Object[] params,
final MethodProxy methodProxy) throws Exception
{
+
return seamInterceptor.aroundInvoke( new InvocationContext() {
Object[] resultParams = params;
@@ -68,6 +69,7 @@
public Object proceed() throws Exception
{
+ SeamInterceptor.COMPONENT.set( seamInterceptor.getComponent() );
try
{
return methodProxy.invoke(bean, resultParams);
@@ -85,6 +87,10 @@
//only extremely wierd stuff!
throw new Exception(t);
}
+ finally
+ {
+ SeamInterceptor.COMPONENT.set(null);
+ }
}
public void setParameters(Object[] newParams)
1.10 +5 -7 jboss-seam/src/main/org/jboss/seam/interceptors/JavaBeanInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: JavaBeanInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/interceptors/JavaBeanInterceptor.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- JavaBeanInterceptor.java 23 Sep 2006 15:41:39 -0000 1.9
+++ JavaBeanInterceptor.java 4 Oct 2006 23:42:53 -0000 1.10
@@ -1,4 +1,4 @@
-//$Id: JavaBeanInterceptor.java,v 1.9 2006/09/23 15:41:39 gavin Exp $
+//$Id: JavaBeanInterceptor.java,v 1.10 2006/10/04 23:42:53 gavin Exp $
package org.jboss.seam.interceptors;
import java.io.Serializable;
@@ -25,12 +25,10 @@
private final SeamInterceptor seamInterceptor;
private boolean recursive = false;
- private final Component component;
public JavaBeanInterceptor(Component component)
{
seamInterceptor = new SeamInterceptor(InterceptorType.ANY, component);
- this.component = component;
}
public Object intercept(final Object target, final Method method, final Object[] params,
@@ -75,7 +73,7 @@
seamInterceptor.prePassivate( new InvocationContext() {
final Object[] params = {};
- final Method passivateMethod = component.getPrePassivateMethod();
+ final Method passivateMethod = seamInterceptor.getComponent().getPrePassivateMethod();
final Map contextData = new HashMap();
public Object getTarget()
@@ -100,7 +98,7 @@
public Object proceed() throws Exception
{
- component.callPrePassivateMethod(target);
+ seamInterceptor.getComponent().callPrePassivateMethod(target);
return null;
}
@@ -117,7 +115,7 @@
seamInterceptor.postActivate( new InvocationContext() {
final Object[] params = {};
- final Method activateMethod = component.getPostActivateMethod();
+ final Method activateMethod = seamInterceptor.getComponent().getPostActivateMethod();
final Map contextData = new HashMap();
public Object getTarget()
@@ -142,7 +140,7 @@
public Object proceed() throws Exception
{
- component.callPostActivateMethod(target);
+ seamInterceptor.getComponent().callPostActivateMethod(target);
return null;
}
More information about the jboss-cvs-commits
mailing list