You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cm...@apache.org on 2009/12/15 23:09:06 UTC

svn commit: r891028 - /activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/actor/Actor.java

Author: cmacnaug
Date: Tue Dec 15 22:09:06 2009
New Revision: 891028

URL: http://svn.apache.org/viewvc?rev=891028&view=rev
Log:
Fixing cglib actor invocation to invoke methods on the original target.

Modified:
    activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/actor/Actor.java

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/actor/Actor.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/actor/Actor.java?rev=891028&r1=891027&r2=891028&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/actor/Actor.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/actor/Actor.java Tue Dec 15 22:09:06 2009
@@ -32,7 +32,7 @@
         Enhancer e = new Enhancer();
         e.setSuperclass(target.getClass());
         e.setInterfaces(interfaces);
-        e.setCallback(new ActorMethodInterceptor(queue));
+        e.setCallback(new ActorMethodInterceptor(target, queue));
 //      Un-comment the following if you want store the generated class file:
 //        e.setStrategy(new DefaultGeneratorStrategy() {
 //            protected byte[] transform(byte[] b) {
@@ -82,9 +82,11 @@
     private static class ActorMethodInterceptor implements MethodInterceptor {
 
         private final DispatchQueue queue;
-
-        ActorMethodInterceptor(DispatchQueue queue) {
+        private final Object target;
+        
+        ActorMethodInterceptor(Object target, DispatchQueue queue) {
             this.queue = queue;
+            this.target = target;
         }
 
         /*
@@ -99,7 +101,7 @@
                 queue.dispatchAsync(new Runnable() {
                     public void run() {
                         try {
-                            proxy.invokeSuper(obj, args);
+                            proxy.invoke(target, args);
                         } catch (Throwable thrown) {
                             throw new IllegalStateException(thrown);
                         }
@@ -107,7 +109,7 @@
                 });
                 return null;
             } else {
-                return proxy.invokeSuper(obj, args);
+                return proxy.invoke(target, args);
             }
         }
     }