[jboss-cvs] JBossAS SVN: r79021 - projects/aop/trunk/aop/src/main/org/jboss/aop.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 2 07:58:20 EDT 2008


Author: kabir.khan at jboss.com
Date: 2008-10-02 07:58:20 -0400 (Thu, 02 Oct 2008)
New Revision: 79021

Modified:
   projects/aop/trunk/aop/src/main/org/jboss/aop/AspectManager.java
Log:
Tidy up

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/AspectManager.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/AspectManager.java	2008-10-02 11:53:48 UTC (rev 79020)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/AspectManager.java	2008-10-02 11:58:20 UTC (rev 79021)
@@ -21,6 +21,8 @@
   */
 package org.jboss.aop;
 
+import java.io.File;
+import java.io.FileOutputStream;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.Field;
 import java.security.AccessController;
@@ -163,15 +165,6 @@
 
    protected static AOPLock lock = new AOPLock();
 
-   // these fields represent whether there are certain pointcut types.
-   // for performance reasons the transformers and binders can make a lot of us of this.
-//   protected boolean execution = false;
-//   protected boolean construction = false;
-//   protected boolean call = false;
-//   protected boolean within = false;
-//   protected boolean get = false;
-//   protected boolean set = false;
-//   protected boolean withincode = false;
    public static boolean classicOrder = false;
 
    protected volatile LinkedHashMap<String, ClassMetaDataBinding> classMetaData = UnmodifiableEmptyCollections.EMPTY_LINKED_HASHMAP;
@@ -1041,7 +1034,37 @@
                   }
                }
       
-               return weavingStrategy.translate(this, className, loader, classfileBuffer);
+               byte[] bytes = weavingStrategy.translate(this, className, loader, classfileBuffer);
+               
+               if (bytes != null && (className.contains("SecurityTester") || className.contains("SecuredPOJO")))
+               {
+                  try
+                  {
+                     System.out.println("!!!!!!!!!!!!!!!! outputting");
+                     String filename = "." + File.separatorChar
+                         + className.replace('.', File.separatorChar) + ".class";
+                     System.out.println("!!!!!!!!!!!!!!!! OUTPUTTING " + className);
+                     int pos = filename.lastIndexOf(File.separatorChar);
+                     if (pos > 0) {
+                         String dir = filename.substring(0, pos);
+                         if (!dir.equals("."))
+                             new File(dir).mkdirs();
+                     }
+
+                     FileOutputStream out = new FileOutputStream(filename);
+                     try {
+                        out.write(bytes);
+                     }
+                     finally {
+                         out.close();
+                     }
+                  }
+                  catch(Exception e)
+                  {
+                     System.out.println("!!!!!!!!!! COULD NOT OUTPUT FILE");
+                  }
+               }
+               return bytes;
             }
          }
          finally




More information about the jboss-cvs-commits mailing list