activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r887556 - /activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/actor/Actor.java
Date Sat, 05 Dec 2009 16:23:13 GMT
Author: chirino
Date: Sat Dec  5 16:23:11 2009
New Revision: 887556

URL: http://svn.apache.org/viewvc?rev=887556&view=rev
Log:
added some code that can dump the generated class file for inspection/debugging

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=887556&r1=887555&r2=887556&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
Sat Dec  5 16:23:11 2009
@@ -7,8 +7,10 @@
  **************************************************************************************/
 package org.apache.activemq.actor;
 
+import java.io.FileOutputStream;
 import java.lang.reflect.Method;
 
+import net.sf.cglib.core.DefaultGeneratorStrategy;
 import net.sf.cglib.proxy.Enhancer;
 import net.sf.cglib.proxy.MethodInterceptor;
 import net.sf.cglib.proxy.MethodProxy;
@@ -31,6 +33,20 @@
         e.setSuperclass(target.getClass());
         e.setInterfaces(interfaces);
         e.setCallback(new ActorMethodInterceptor(queue));
+//      Un-comment the following if you want store the generated class file:
+//        e.setStrategy(new DefaultGeneratorStrategy() {
+//            protected byte[] transform(byte[] b) {
+//                try {
+//                    FileOutputStream os = new FileOutputStream("test.class");
+//                    os.write(b);
+//                    os.close();
+//                } catch (Throwable e) {
+//                    e.printStackTrace();
+//                }
+//                return b;
+//            }
+//        });
+
         return (T) e.create();
     }
 
@@ -50,7 +66,8 @@
     /**
      * Tests if a given method has a Message annotation
      * 
-     * @param method The mehod.
+     * @param method
+     *            The mehod.
      */
     private static boolean isMessage(Method method) {
         if (method.isAnnotationPresent(Message.class)) {



Mime
View raw message