[jboss-cvs] JBossAS SVN: r69306 - in projects/aop/trunk/aop/src: main/org/jboss/aop/proxy/container and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jan 24 14:35:22 EST 2008
Author: kabir.khan at jboss.com
Date: 2008-01-24 14:35:22 -0500 (Thu, 24 Jan 2008)
New Revision: 69306
Added:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsDelegate.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsInVmTestCase.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsOutOfVmTestCase.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsTest.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor3.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor4.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor5.java
Modified:
projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerInstanceInterceptor.java
projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerJoinpointInterceptor.java
projects/aop/trunk/aop/src/main/org/jboss/aop/proxy/container/MarshalledContainerProxy.java
Log:
[JBAOP-467] Test that interceptors of all scopes can be marshalled
Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerInstanceInterceptor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerInstanceInterceptor.java 2008-01-24 19:19:54 UTC (rev 69305)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerInstanceInterceptor.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -102,9 +102,14 @@
}
}
}
- Interceptor interceptor = (Interceptor) instanceAdvisor.getPerInstanceAspect(aspectDefinition);
+ Interceptor interceptor = getAspectInstance(instanceAdvisor);
return interceptor.invoke(invocation);
}
}
+
+ public Interceptor getAspectInstance(InstanceAdvisor ia)
+ {
+ return (Interceptor) ia.getPerInstanceAspect(aspectDefinition);
+ }
}
Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerJoinpointInterceptor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerJoinpointInterceptor.java 2008-01-24 19:19:54 UTC (rev 69305)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerJoinpointInterceptor.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -35,6 +35,8 @@
import org.jboss.aop.joinpoint.Joinpoint;
import org.jboss.aop.joinpoint.MethodCalledByMethodJoinpoint;
import org.jboss.aop.joinpoint.MethodJoinpoint;
+import org.jboss.aop.proxy.container.ClassProxyContainer;
+import org.jboss.aop.proxy.container.ContainerProxyMethodInvocation;
/**
* Comment
@@ -123,10 +125,41 @@
Object targetObject = invocation.getTargetObject();
if (targetObject == null) return invocation.invokeNext(); // static method call or static field call
- Advised advised = (Advised) targetObject;
- InstanceAdvisor advisor = advised._getInstanceAdvisor();
- Interceptor interceptor = (Interceptor) advisor.getPerInstanceJoinpointAspect(joinpoint, aspectDefinition);
+ InstanceAdvisor instanceAdvisor = null;
+ if (targetObject instanceof Advised)
+ {
+ Advised advised = (Advised) targetObject;
+ instanceAdvisor = advised._getInstanceAdvisor();
+ }
+ else
+ {
+ Advisor advisor = invocation.getAdvisor();
+ if (advisor == null)
+ {
+ return invocation.invokeNext();
+ }
+ else if (advisor instanceof InstanceAdvisor)
+ {
+ instanceAdvisor = (InstanceAdvisor) advisor;
+ }
+ else if (advisor instanceof ClassProxyContainer && invocation instanceof ContainerProxyMethodInvocation)
+ {
+ ContainerProxyMethodInvocation pi = (ContainerProxyMethodInvocation)invocation;
+ instanceAdvisor = pi.getProxy().getInstanceAdvisor();
+ }
+ else
+ {
+ return invocation.invokeNext();
+ }
+ }
+ Interceptor interceptor = getAspectInstance(instanceAdvisor);
return interceptor.invoke(invocation);
}
}
+
+ public Interceptor getAspectInstance(InstanceAdvisor ia)
+ {
+ return (Interceptor) ia.getPerInstanceJoinpointAspect(joinpoint, aspectDefinition);
+ }
+
}
\ No newline at end of file
Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/proxy/container/MarshalledContainerProxy.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/proxy/container/MarshalledContainerProxy.java 2008-01-24 19:19:54 UTC (rev 69305)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/proxy/container/MarshalledContainerProxy.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -42,7 +42,9 @@
import org.jboss.aop.advice.AbstractAdvice;
import org.jboss.aop.advice.Interceptor;
import org.jboss.aop.advice.PerInstanceAdvice;
+import org.jboss.aop.advice.PerInstanceInterceptor;
import org.jboss.aop.advice.PerJoinpointAdvice;
+import org.jboss.aop.advice.PerJoinpointInterceptor;
import org.jboss.aop.instrument.Untransformable;
import org.jboss.aop.metadata.SimpleMetaData;
import org.jboss.aop.util.MethodHashing;
@@ -387,13 +389,30 @@
{
if (icptrs[i] instanceof AbstractAdvice == false)
{
- allIcptrs.add(icptrs[i]);
+ Interceptor icptr = null;
+ if (icptrs[i] instanceof PerInstanceInterceptor && !Modifier.isStatic(info.getMethod().getModifiers()))
+ {
+ requiresInstanceAdvisor = true;
+ InstanceAdvisor ia = getProxyInstanceAdvisor();
+ icptr = ((PerInstanceInterceptor)icptrs[i]).getAspectInstance(ia);
+ }
+ else if (icptrs[i] instanceof PerJoinpointInterceptor && !Modifier.isStatic(info.getMethod().getModifiers()))
+ {
+ requiresInstanceAdvisor = true;
+ InstanceAdvisor ia = getProxyInstanceAdvisor();
+ icptr = ((PerJoinpointInterceptor)icptrs[i]).getAspectInstance(ia);
+ }
+ else
+ {
+ icptr = icptrs[i];
+ }
+ allIcptrs.add(icptr);
}
else
{
AbstractAdvice advice = (AbstractAdvice)icptrs[i];
Object aspectInstance = null;
- if (icptrs[i] instanceof PerInstanceAdvice)
+ if (icptrs[i] instanceof PerInstanceAdvice && !Modifier.isStatic(info.getMethod().getModifiers()))
{
requiresInstanceAdvisor = true;
InstanceAdvisor ia = getProxyInstanceAdvisor();
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsDelegate.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsDelegate.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsDelegate.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -0,0 +1,123 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.test.aop.proxy;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.ObjectOutputStream;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.proxy.container.AOPProxyFactory;
+import org.jboss.aop.proxy.container.AOPProxyFactoryMixin;
+import org.jboss.aop.proxy.container.AOPProxyFactoryParameters;
+import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SerializeContainerProxyWithScopedInterceptorsDelegate extends ProxyFileCreatorDelegate
+{
+ public static void main (String[] args)
+ {
+ SerializeContainerProxyWithScopedInterceptorsDelegate delegate = new SerializeContainerProxyWithScopedInterceptorsDelegate();
+ delegate.createAndSerializeProxy(args);
+ }
+
+ public void createAndSerializeProxy(File file) throws Exception
+ {
+ AspectManager manager = AspectManager.instance();
+ addInterceptorBinding(manager,
+ 1,
+ Scope.PER_VM,
+ TestInterceptor.class.getName(),
+ "execution(* $instanceof{" + SomeInterface.class.getName() + "}->helloWorld(..))");
+
+ addInterceptorBinding(manager,
+ 2,
+ Scope.PER_CLASS,
+ TestInterceptor2.class.getName(),
+ "execution(* $instanceof{" + SomeInterface.class.getName() + "}->helloWorld(..))");
+
+ addInterceptorBinding(manager,
+ 3,
+ Scope.PER_CLASS_JOINPOINT,
+ TestInterceptor3.class.getName(),
+ "execution(* $instanceof{" + SomeInterface.class.getName() + "}->helloWorld(..))");
+
+ addInterceptorBinding(manager,
+ 4,
+ Scope.PER_INSTANCE,
+ TestInterceptor4.class.getName(),
+ "execution(* $instanceof{" + SomeInterface.class.getName() + "}->helloWorld(..))");
+
+ addInterceptorBinding(manager,
+ 5,
+ Scope.PER_JOINPOINT,
+ TestInterceptor5.class.getName(),
+ "execution(* $instanceof{" + SomeInterface.class.getName() + "}->helloWorld(..))");
+
+
+
+ AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
+ params.setInterfaces(new Class[] {SomeInterface.class});
+ params.setMixins(new AOPProxyFactoryMixin[] {
+ new AOPProxyFactoryMixin(OtherMixin.class, new Class[] {OtherMixinInterface.class, OtherMixinInterface2.class}, "20")
+ });
+
+ params.setTarget(new SerializablePOJO());
+ AOPProxyFactory factory = new GeneratedAOPProxyFactory();
+ SomeInterface si = (SomeInterface)factory.createAdvisedProxy(params);
+
+ TestInterceptor.invoked = false;
+ TestInterceptor2.invoked = false;
+ TestInterceptor3.invoked = false;
+ TestInterceptor4.invoked = false;
+ TestInterceptor5.invoked = false;
+ si.helloWorld();
+ assertTrue(TestInterceptor.invoked);
+ assertTrue(TestInterceptor2.invoked);
+ assertTrue(TestInterceptor3.invoked);
+ assertTrue(TestInterceptor4.invoked);
+ assertTrue(TestInterceptor5.invoked);
+
+
+ ObjectOutputStream out = null;
+ try
+ {
+ out = new ObjectOutputStream(new FileOutputStream(file));
+ out.writeObject(si);
+ }
+ finally
+ {
+ try
+ {
+ out.close();
+ }
+ catch(Exception e)
+ {
+ }
+ }
+ }
+}
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsInVmTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsInVmTestCase.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsInVmTestCase.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -0,0 +1,51 @@
+/*
+ * 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.test.aop.proxy;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ * @version $Revision: 64431 $
+ */
+public class SerializeContainerProxyWithScopedInterceptorsInVmTestCase extends SerializeContainerProxyWithScopedInterceptorsTest
+{
+
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("SerializeContainerProxyWithScopedInterceptorsInVmTestCase");
+ suite.addTestSuite(SerializeContainerProxyWithScopedInterceptorsInVmTestCase.class);
+ return suite;
+ }
+
+ public SerializeContainerProxyWithScopedInterceptorsInVmTestCase(String name)
+ {
+ super(name, new InProcessProxyFileCreator(new SerializeContainerProxyWithScopedInterceptorsDelegate()));
+ }
+}
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsOutOfVmTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsOutOfVmTestCase.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsOutOfVmTestCase.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -0,0 +1,52 @@
+/*
+ * 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.test.aop.proxy;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ * @version $Revision: 64431 $
+ */
+public class SerializeContainerProxyWithScopedInterceptorsOutOfVmTestCase extends SerializeContainerProxyWithScopedInterceptorsTest
+{
+
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("SerializeContainerProxyWithScopedInterceptorsOutOfVmTestCase");
+ suite.addTestSuite(SerializeContainerProxyWithScopedInterceptorsOutOfVmTestCase.class);
+ return suite;
+ }
+
+ public SerializeContainerProxyWithScopedInterceptorsOutOfVmTestCase(String name)
+ {
+ super(name, new OutOfProcessProxyFileCreator(SerializeContainerProxyWithScopedInterceptorsDelegate.class.getName()));
+ }
+
+}
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsTest.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsTest.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/SerializeContainerProxyWithScopedInterceptorsTest.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -0,0 +1,59 @@
+/*
+ * 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.test.aop.proxy;
+
+/**
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ * @version $Revision: 64431 $
+ */
+public abstract class SerializeContainerProxyWithScopedInterceptorsTest extends AbstractSerializeContainerTest
+{
+ public SerializeContainerProxyWithScopedInterceptorsTest(String name, ProxyFileCreator creator)
+ {
+ super(name, creator);
+ }
+
+ public void testContainerProxy() throws Exception
+ {
+ try
+ {
+ SomeInterface si = getSerializedProxy();
+
+ TestInterceptor.invoked = false;
+ TestInterceptor2.invoked = false;
+ TestInterceptor3.invoked = false;
+ TestInterceptor4.invoked = false;
+ TestInterceptor5.invoked = false;
+ si.helloWorld();
+ assertTrue(TestInterceptor.invoked);
+ assertTrue(TestInterceptor2.invoked);
+ assertTrue(TestInterceptor3.invoked);
+ assertTrue(TestInterceptor4.invoked);
+ assertTrue(TestInterceptor5.invoked);
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+}
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor3.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor3.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor3.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.test.aop.proxy;
+
+import java.io.Serializable;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInterceptor3 implements Interceptor, Serializable
+{
+ private static final long serialVersionUID = 1L;
+ static boolean invoked;
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public Object invoke(Invocation inv) throws Throwable
+ {
+ invoked = true;
+ return inv.invokeNext();
+ }
+}
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor4.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor4.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor4.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.test.aop.proxy;
+
+import java.io.Serializable;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInterceptor4 implements Interceptor, Serializable
+{
+ private static final long serialVersionUID = 1L;
+ static boolean invoked;
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public Object invoke(Invocation inv) throws Throwable
+ {
+ invoked = true;
+ return inv.invokeNext();
+ }
+}
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor5.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor5.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/proxy/TestInterceptor5.java 2008-01-24 19:35:22 UTC (rev 69306)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.test.aop.proxy;
+
+import java.io.Serializable;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInterceptor5 implements Interceptor, Serializable
+{
+ private static final long serialVersionUID = 1L;
+ static boolean invoked;
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public Object invoke(Invocation inv) throws Throwable
+ {
+ invoked = true;
+ return inv.invokeNext();
+ }
+}
More information about the jboss-cvs-commits
mailing list