[jboss-cvs] JBossAS SVN: r71189 - in projects/aop/branches/joinpoint_graph/asintegration: src/main/org/jboss/aop/asintegration/jboss4 and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 24 00:17:14 EDT 2008


Author: flavia.rainone at jboss.com
Date: 2008-03-24 00:17:13 -0400 (Mon, 24 Mar 2008)
New Revision: 71189

Removed:
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallback.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallbackHandler.java
Modified:
   projects/aop/branches/joinpoint_graph/asintegration/pom.xml
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/JBossClassPool.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/JBossClassPoolFactory.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/LoaderRepositoryUrlUtil.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/RepositoryClassLoaderScopingPolicy.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/ScopedJBossClassPool.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/ScopedRepositoryClassLoaderHelper.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/SecurityActions.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/classpool/ExtraClassPoolFactoryParameters.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/AbstractAspectManager.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/JBossAspectLibrary.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectDeployer.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectManagerService.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectManagerServiceMBean.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializer.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/ScopedRepositoryClassLoaderDomain.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/junit/AOPTest.java
   projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/junit/AOPTestDelegate.java
   projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTest.java
   projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTestDelegate.java
   projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersionsUnitTestCase.java
Log:
Merging trunk changes.

Modified: projects/aop/branches/joinpoint_graph/asintegration/pom.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/pom.xml	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/pom.xml	2008-03-24 04:17:13 UTC (rev 71189)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.jboss.aop</groupId>
     <artifactId>jboss-aop-parent</artifactId>
-    <version>1-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>jboss-aop-asintegration</artifactId>

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/JBossClassPool.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/JBossClassPool.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/JBossClassPool.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -72,7 +72,7 @@
       return false;
    }
 
-   public Class toClass(CtClass cc, ClassLoader loader, ProtectionDomain domain)
+   public Class<?> toClass(CtClass cc, ClassLoader loader, ProtectionDomain domain)
    throws CannotCompileException
    {
       lockInCache(cc);
@@ -80,7 +80,7 @@
       {
          return super.toClass(cc, loader, domain);
       }
-      Class dynClass = null;
+      Class<?> dynClass = null;
       try
       {
          File classFile = null;

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/JBossClassPoolFactory.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/JBossClassPoolFactory.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/JBossClassPoolFactory.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -25,8 +25,6 @@
 import java.io.IOException;
 import java.net.URL;
 
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
 import org.jboss.aop.classpool.AOPClassPool;
 import org.jboss.aop.classpool.AbstractJBossClassPoolFactory;
 import org.jboss.mx.loading.RepositoryClassLoader;
@@ -66,7 +64,6 @@
          {
             throw new RuntimeException(e);
          }
-         AOPClassLoaderScopingPolicy policy = AspectManager.getClassLoaderScopingPolicy();
          if (ScopedRepositoryClassLoaderHelper.isScopedClassLoader(cl))
          {
             //It is scoped

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/LoaderRepositoryUrlUtil.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/LoaderRepositoryUrlUtil.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/LoaderRepositoryUrlUtil.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -120,10 +120,8 @@
       int scopedLength = 0;
       for (int i = 0 ; i < scopedRepositoryUrls.length ; i++)
       {
-         URL scopedUrl = scopedRepositoryUrls[i];
          for (int j = 0 ; j < globalUrls.length ; j ++)
          {
-            URL globalUrl = globalUrls[j];
             if (scopedRepositoryUrls[i].equals(globalUrls[j]))
             {
                scopedLength = i;

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/RepositoryClassLoaderScopingPolicy.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/RepositoryClassLoaderScopingPolicy.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/RepositoryClassLoaderScopingPolicy.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -29,9 +29,8 @@
 import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
 import org.jboss.aop.classpool.AOPClassPoolRepository;
 import org.jboss.aop.domain.DomainInitializer;
-import org.jboss.aop.domain.DomainInitializerCallback;
-import org.jboss.aop.domain.DomainInitializerCallbackHandler;
 import org.jboss.aop.domain.ScopedRepositoryClassLoaderDomain;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.logging.Logger;
 import org.jboss.mx.loading.HeirarchicalLoaderRepository3;
 import org.jboss.mx.loading.RepositoryClassLoader;
@@ -48,14 +47,9 @@
    /** A map of domains by loader repository, maintaned by the top level AspectManager */
    private Map<Object, Domain> scopedClassLoaderDomains = new WeakHashMap<Object, Domain>();
 
-
-   public Domain initializeDomain(DomainInitializerCallbackHandler handler)
+   public Domain initializeDomain(VFSDeploymentUnit unit)
    {
-      DomainInitializerCallback<ClassLoader> callback = new DomainInitializerCallback<ClassLoader>(ClassLoader.class);
-      DomainInitializerCallback[] callbacks = new DomainInitializerCallback[]{callback};
-      handler.handle(callbacks);
-      
-      ClassLoader loader = callback.getValue();
+      ClassLoader loader = unit.getClassLoader();
       Domain domain = getDomain(loader, AspectManager.getTopLevelAspectManager());
       
       AspectManager.instance().registerClassLoader(loader); //Ends up in classpool factory create method

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/ScopedJBossClassPool.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/ScopedJBossClassPool.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/ScopedJBossClassPool.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -22,10 +22,8 @@
 package org.jboss.aop.asintegration.jboss4;
 
 import java.io.File;
-import java.lang.ref.WeakReference;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Iterator;
 
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.classpool.AOPClassPool;
@@ -50,9 +48,8 @@
 {
    final static LoaderRepositoryUrlUtil LOADER_REPOSITORY_UTIL = new LoaderRepositoryUrlUtil();
    
-   WeakReference repository = null;
-   UrlInfo urlInfo;
-   ThreadLocal lastPool = new ThreadLocal();
+   private UrlInfo urlInfo;
+   private ThreadLocal<ClassPool> lastPool = new ThreadLocal<ClassPool>();
 
    public ScopedJBossClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository, File tmp, URL tmpURL)
    {
@@ -201,11 +198,11 @@
       {
          //JBoss 5 has an extra NoAnnotationURLCLassLoader that is not on the default path, make sure that that is checked at the end
          //FIXME This needs revisiting/removing once the 
-         ArrayList noAnnotationURLClassLoaderPools = null;
+         ArrayList<AOPClassPool> noAnnotationURLClassLoaderPools = null;
          String resource = url.toString();
-         for(Iterator it = AspectManager.getRegisteredCLs().values().iterator() ; it.hasNext() ; )
+         for(ClassPool pool : AspectManager.getRegisteredCLs().values())
          {
-            AOPClassPool candidate = (AOPClassPool)it.next();
+            AOPClassPool candidate = (AOPClassPool)pool;
             if (candidate.isUnloadedClassLoader())
             {
                AspectManager.instance().unregisterClassLoader(candidate.getClassLoader());
@@ -231,7 +228,7 @@
             {
                if (noAnnotationURLClassLoaderPools == null)
                {
-                  noAnnotationURLClassLoaderPools = new ArrayList(); 
+                  noAnnotationURLClassLoaderPools = new ArrayList<AOPClassPool>(); 
                }
                noAnnotationURLClassLoaderPools.add(candidate);
             }
@@ -240,10 +237,8 @@
          //FIXME Remove once we have the JBoss 5 version of pool
          if (noAnnotationURLClassLoaderPools != null)
          {
-            for (Iterator it = noAnnotationURLClassLoaderPools.iterator() ; it.hasNext() ; )
+            for (AOPClassPool pool : noAnnotationURLClassLoaderPools)
             {
-               ClassPool pool = (ClassPool)it.next();
-               
                try
                {
                   pool.get(classname);
@@ -264,7 +259,7 @@
     */
    private boolean isInstanceOfNoAnnotationURLClassLoader(ClassLoader loader)
    {
-      Class parent = loader.getClass();
+      Class<?> parent = loader.getClass();
       while (parent != null)
       {
          if ("NoAnnotationURLClassLoader".equals(parent.getSimpleName()))

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/ScopedRepositoryClassLoaderHelper.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/ScopedRepositoryClassLoaderHelper.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/ScopedRepositoryClassLoaderHelper.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -42,8 +42,8 @@
          if (repository instanceof HeirarchicalLoaderRepository3)
          {
             scoped = true;
-            HeirarchicalLoaderRepository3 hlr = (HeirarchicalLoaderRepository3)repository;
-            boolean parentFirst = hlr.getUseParentFirst();
+            //HeirarchicalLoaderRepository3 hlr = (HeirarchicalLoaderRepository3)repository;
+            //boolean parentFirst = hlr.getUseParentFirst();
          }
       }
       return scoped;

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/SecurityActions.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/SecurityActions.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/asintegration/jboss4/SecurityActions.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -68,6 +68,10 @@
    
    public static ClassLoader getParent(ClassLoader loader)
    {
+      if (loader == null)
+      {
+         return null;
+      }
       if (System.getSecurityManager() == null)
       {
          return GetParentAction.NON_PRIVILEGED.getParent(loader);

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/classpool/ExtraClassPoolFactoryParameters.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/classpool/ExtraClassPoolFactoryParameters.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/classpool/ExtraClassPoolFactoryParameters.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -24,6 +24,7 @@
 import java.util.Map;
 
 /**
+ * This class is used by the AS5 integration. Do not delete!!!! 
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
@@ -31,21 +32,21 @@
 public class ExtraClassPoolFactoryParameters
 {
    /** A map of properties that can be used to configure the classpool factories further */
-   private static ThreadLocal<Map> properties = new ThreadLocal<Map>();
+   private static ThreadLocal<Map<Object, Object>> properties = new ThreadLocal<Map<Object, Object>>();
    
-   public static void pushThreadProperties(Map props)
+   public static void pushThreadProperties(Map<Object, Object> props)
    {
       properties.set(props);
    }
    
-   public static Map peekThreadProperties()
+   public static Map<Object, Object> peekThreadProperties()
    {
       return properties.get();
    }
    
-   public static Map popThreadProperties()
+   public static Map<Object, Object> popThreadProperties()
    {
-      Map props = properties.get();
+      Map<Object, Object> props = properties.get();
       properties.remove();
       return props;
    }

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/AbstractAspectManager.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/AbstractAspectManager.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/AbstractAspectManager.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -37,6 +37,7 @@
 
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aop.annotation.PortableAnnotationElement;
 import org.jboss.aop.asintegration.JBossIntegration;
 import org.jboss.aop.deployment.AspectManagerService;
 import org.jboss.deployment.DeploymentInfo;
@@ -167,7 +168,8 @@
                Document doc = AspectXmlLoader.loadDocument(new BufferedInputStream(in));
                AspectXmlLoader loader = new AspectXmlLoader();
                loader.setManager(getAspectManager());
-               loader.deployXML(doc, null);
+               PortableAnnotationElement.setClosingDownManager(true);
+               loader.undeployXML(doc, null);
             }
             finally
             {
@@ -249,6 +251,15 @@
    {
       return delegate.getInclude();
    }
+   
+   /**
+    * @return
+    * @see org.jboss.aop.deployment.AspectManagerService#getIncludedInvisibleAnnotations()
+    */
+   public String getIncludedInvisibleAnnotations()
+   {
+      return delegate.getIncludedInvisibleAnnotations();
+   }
 
    /**
     * @return
@@ -556,6 +567,15 @@
    {
       delegate.setInclude(include);
    }
+   
+   /**
+    * @param include
+    * @see org.jboss.aop.deployment.AspectManagerService#setIncludedInvisibleAnnotations(java.lang.String)
+    */
+   public void setIncludedInvisibleAnnotations(String iia)
+   {
+      delegate.setIncludedInvisibleAnnotations(iia);
+   }
 
    /**
     * @param instrumentor

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -36,9 +36,6 @@
 import org.jboss.aop.Domain;
 import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
 import org.jboss.aop.domain.DomainInitializer;
-import org.jboss.aop.domain.DomainInitializerCallback;
-import org.jboss.aop.domain.DomainInitializerCallbackHandler;
-import org.jboss.deployers.plugins.classloading.Module;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.DeploymentStages;
 import org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer;
@@ -368,29 +365,9 @@
             throw new RuntimeException(policy + " must implement DomainInitializer");
          }
          DomainInitializer initializer = (DomainInitializer)policy;
-         domain = initializer.initializeDomain(new DomainInitializerCallbackHandler() {
-            public void handle(DomainInitializerCallback[] callbacks)
-            {
-               for (DomainInitializerCallback callback : callbacks)
-               {
-                  if (callback.getDataType() == Module.class)
-                  {
-                     callback.setValue(unit.getTopLevel().getAttachment(Module.class));
-                  }
-                  else if (callback.getDataType() == ClassLoader.class)
-                  {
-                     callback.setValue(unit.getClassLoader());
-                  }
-                  else
-                  {
-                     throw new RuntimeException("Invalid data type passed in by callback " + callback.getDataType());
-                  }
-               }
-            }
-         });
+         domain = initializer.initializeDomain(unit); 
       }
       
-      
       if (domain != null)
       {
          return domain;

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/JBossAspectLibrary.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/JBossAspectLibrary.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployers/JBossAspectLibrary.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -51,7 +51,13 @@
     */
    public void start() throws Exception
    {
+      log.debug("Starting JBoss AspectLibrary");
       aspectManager.deployBaseAspects();
    }
+   
+   public void stop()
+   {
+      log.debug("Stopping JBoss AspectLibrary");
+   }
 
 }

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectDeployer.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectDeployer.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectDeployer.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -76,7 +76,7 @@
 
    /**
     * Set the suffixes and relative order attributes.
-    * 
+    *
     * Those are read at subdeployer registration time by the MainDeployer
     * to update its SuffixOrder list.
     */
@@ -162,19 +162,20 @@
 
          if (scl != null)
          {
-            log.info("AOP deployment is scoped using classloader " + scl);   
+            log.info("AOP deployment is scoped using classloader " + scl);
          }
-         
+
          Thread.currentThread().setContextClassLoader(di.ucl);
          AspectManager manager = (scl != null) ? AspectManager.instance(scl) : AspectManager.instance();
          if (!di.isXML)
          {
+            @SuppressWarnings("unchecked")
             Iterator it = ArchiveBrowser.getBrowser(di.localUrl, new ClassFileFilter());
             AspectAnnotationLoader loader = new AspectAnnotationLoader(manager);
             loader.setClassLoader(scl);
             loader.deployInputStreamIterator(it);
          }
-         
+
          AspectXmlLoader.deployXML(docURL, scl, manager);
          Notification msg = new Notification("AOP Deploy", this, getNextNotificationSequenceNumber());
          sendNotification(msg);
@@ -223,7 +224,7 @@
          log.debug("Ignoring request to stop '" + di.url + "', current state: " + di.state);
          return;
       }
-      
+
       log.debug("undeploying document " + di.url);
       ClassLoader old = Thread.currentThread().getContextClassLoader();
       try
@@ -231,6 +232,7 @@
          Thread.currentThread().setContextClassLoader(di.ucl);
          if (!di.isXML)
          {
+            @SuppressWarnings("unchecked")
             Iterator it = ArchiveBrowser.getBrowser(di.localUrl, new ClassFileFilter());
             AspectAnnotationLoader loader = new AspectAnnotationLoader(AspectManager.instance());
             loader.undeployInputStreamIterator(it);
@@ -243,9 +245,9 @@
          AspectManager.instance().unregisterClassLoader(di.ucl);
 
          /*
-         System.out.println("************************");
-         System.out.println("undeploy took: " + (System.currentTimeMillis() - start));
-         System.out.println("************************");
+//         System.out.println("************************");
+//         System.out.println("undeploy took: " + (System.currentTimeMillis() - start));
+//         System.out.println("************************");
          */
          Notification msg = new Notification("AOP Undeploy", this, getNextNotificationSequenceNumber());
          sendNotification(msg);
@@ -298,7 +300,7 @@
          throw new DeploymentException("Failed to find META-INF/jboss-aop.xml");
       return docURL;
    }
-   
+
    private ClassLoader getScopedClassLoader(DeploymentInfo di, URL docUrl) throws Exception
    {
       //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
@@ -308,7 +310,7 @@
       {
          return di.ucl;
       }
-      
+
       LoaderRepository attachToRepository = getLoaderRepositoryIfAttaching(di, docUrl);
       if (attachToRepository != null)
       {
@@ -318,23 +320,23 @@
       }
       return null;
    }
-   
+
    private LoaderRepository getLoaderRepositoryIfAttaching(DeploymentInfo di, URL docUrl) throws Exception
    {
       if (di.parent == null)
       {
          //We are a top-level deployment, check if we are meant to be attaching to a scoped repository
-         
+
          Document doc = AspectXmlLoader.loadURL(docUrl);
          Element top = doc.getDocumentElement();
          NodeList children = top.getChildNodes();
          int childlength = children.getLength();
          for (int i = 0; i < childlength ; i++)
          {
-            Node child = children.item(i); 
+            Node child = children.item(i);
             if (child.getNodeType() == Node.ELEMENT_NODE)
             {
-               Element element = (Element)child;  
+               Element element = (Element)child;
                if (element.getTagName().equals("loader-repository"))
                {
                   String repositoryName = null;
@@ -359,16 +361,17 @@
                   {
                      throw new RuntimeException("loader-repository='" + repositoryName + "' is not a valid object name", e);
                   }
-                  
+
                   try
                   {
+                     @SuppressWarnings("unused")
                      MBeanInfo info = server.getMBeanInfo(on);
                   }
                   catch (InstanceNotFoundException e)
                   {
                      log.warn("No scoped loader repository exists with the name " + on);
                   }
-                  
+
                   LoaderRepository repository = (LoaderRepository)server.getAttribute(on, "Instance");
                   if (repository instanceof HeirarchicalLoaderRepository3)
                   {
@@ -379,10 +382,10 @@
                      log.warn("Loader repository " + on + " is not a isolated loader repository. Deploying aspects in default domain.");
                   }
                }
-            }            
+            }
          }
       }
-      
+
       return null;
    }
 }
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectManagerService.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectManagerService.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectManagerService.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -25,10 +25,11 @@
 import java.io.FileNotFoundException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 
+import javassist.ClassPool;
 import javassist.scopedpool.ScopedClassPoolFactory;
 
 import javax.management.Notification;
@@ -45,6 +46,11 @@
 import org.jboss.aop.hook.JDK14TransformerManager;
 import org.jboss.aop.instrument.InstrumentorFactory;
 import org.jboss.aop.instrument.TransformerCommon;
+import org.jboss.aop.introduction.InterfaceIntroduction;
+import org.jboss.aop.advice.AdviceBinding;
+import org.jboss.aop.advice.AdviceStack;
+import org.jboss.aop.advice.AspectDefinition;
+import org.jboss.aop.advice.InterceptorFactory;
 import org.jboss.aop.asintegration.JBossIntegration;
 import org.jboss.aop.asintegration.jboss4.JBoss4Integration;
 import org.jboss.logging.Logger;
@@ -71,7 +77,7 @@
       //When AspectManager.translate() is called the first time, these classes have not been loaded yet, and this is what causes
       //JRockit to get confused
       @SuppressWarnings("unused")
-      Class clazz = TransformerCommon.class;
+      Class<?> clazz = TransformerCommon.class;
       clazz = SuperClassesFirstWeavingStrategy.class;
       clazz = ClassicWeavingStrategy.class;
       clazz = HeirarchicalLoaderRepository3.class;
@@ -90,6 +96,7 @@
    protected String exclude;
    protected String include;
    protected String ignore;
+   protected String includedInvisibleAnnotations;
    private String baseXml = "base-aop.xml";
    //When running with JBoss 5 registration with MBeanServer happens after the service has been started
    boolean registerHappensAfterStart;
@@ -103,6 +110,13 @@
    // Constructors -------------------------------------------------
    public AspectManagerService()
    {
+      //This constructor shouuld only get called when used in JBoss 4.x.x, not in JBoss 5.
+      //In JBoss 4 we need tomaintain this field
+      
+      //Initialise the manager
+      @SuppressWarnings("unused")
+      AspectManager manager = AspectManager.instance();
+      AspectManager.maintainAdvisorMethodInterceptors = true;
    }
 
    /**
@@ -345,6 +359,22 @@
       }
       AspectManager.instance().setIgnore(list);
    }
+   
+   public String getIncludedInvisibleAnnotations()
+   {
+      return includedInvisibleAnnotations;
+   }
+   
+   public void setIncludedInvisibleAnnotations(String ia)
+   {
+      List<String> iiaList = new ArrayList<String>();
+      if(ia != null)
+      {
+         for(String inc : ia.split(","))
+           iiaList.add(inc.trim());
+      }
+      AspectManager.instance().setIncludedInvisibleAnnotations(iiaList);
+   }
 
 
    /**
@@ -430,12 +460,11 @@
     */
    public String interceptorFactories()
    {
-      Map factories = AspectManager.instance().getInterceptorFactories();
-      Iterator it = factories.keySet().iterator();
+      Map<String, InterceptorFactory> factories = AspectManager.instance().getInterceptorFactories();
       StringBuffer buffer = new StringBuffer("");
-      while (it.hasNext())
+      for (String name : factories.keySet())
       {
-         buffer.append(it.next() + "<br>");
+         buffer.append(name + "<br>");
       }
       return buffer.toString();
    }
@@ -445,60 +474,55 @@
     */
    public String aspectDefinitions()
    {
-      Map factories = AspectManager.instance().getAspectDefinitions();
-      Iterator it = factories.keySet().iterator();
+      Map<String, AspectDefinition> factories = AspectManager.instance().getAspectDefinitions();
       StringBuffer buffer = new StringBuffer("");
-      while (it.hasNext())
+      for (String name : factories.keySet())
       {
-         buffer.append(it.next() + "<br>");
+         buffer.append(name + "<br>");
       }
       return buffer.toString();
    }
 
    public String introductions()
    {
-      Map factories = AspectManager.instance().getInterfaceIntroductions();
-      Iterator it = factories.keySet().iterator();
+      Map<String, InterfaceIntroduction> factories = AspectManager.instance().getInterfaceIntroductions();
       StringBuffer buffer = new StringBuffer("");
-      while (it.hasNext())
+      for (String name : factories.keySet())
       {
-         buffer.append(it.next() + "<br>");
+         buffer.append(name + "<br>");
       }
       return buffer.toString();
    }
 
    public String stacks()
    {
-      Map factories = AspectManager.instance().getInterceptorStacks();
-      Iterator it = factories.keySet().iterator();
+      Map<String, AdviceStack> factories = AspectManager.instance().getInterceptorStacks();
       StringBuffer buffer = new StringBuffer("");
-      while (it.hasNext())
+      for (String name : factories.keySet())
       {
-         buffer.append(it.next() + "<br>");
+         buffer.append(name + "<br>");
       }
       return buffer.toString();
    }
 
    public String bindings()
    {
-      Map factories = AspectManager.instance().getBindings();
-      Iterator it = factories.keySet().iterator();
+      Map<String, AdviceBinding> factories = AspectManager.instance().getBindings();
       StringBuffer buffer = new StringBuffer("");
-      while (it.hasNext())
+      for (String name : factories.keySet())
       {
-         buffer.append(it.next() + "<br>");
+         buffer.append(name + "<br>");
       }
       return buffer.toString();
    }
 
    public String registeredClassLoaders()
    {
-      Map factories = AspectManager.instance().getRegisteredCLs();
-      Iterator it = factories.keySet().iterator();
+      Map<ClassLoader, ClassPool> loaders = AspectManager.getRegisteredCLs();
       StringBuffer buffer = new StringBuffer("");
-      while (it.hasNext())
+      for (ClassLoader loader : loaders.keySet())
       {
-         buffer.append(it.next() + "<br>");
+         buffer.append(loader + "<br>");
       }
       return buffer.toString();
    }

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectManagerServiceMBean.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectManagerServiceMBean.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/deployment/AspectManagerServiceMBean.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -110,6 +110,10 @@
    String getInclude();
 
    void setInclude(String include);
+   
+   String getIncludedInvisibleAnnotations();
+   
+   void setIncludedInvisibleAnnotations(String ia);
 
    boolean getPrune();
 

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializer.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializer.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializer.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -22,6 +22,7 @@
 package org.jboss.aop.domain;
 
 import org.jboss.aop.Domain;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 
 /**
  * 
@@ -30,5 +31,5 @@
  */
 public interface DomainInitializer
 {
-   Domain initializeDomain(DomainInitializerCallbackHandler handler);
+   Domain initializeDomain(VFSDeploymentUnit unit);
 }

Deleted: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallback.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallback.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallback.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -1,53 +0,0 @@
-/*
-* 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.aop.domain;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class DomainInitializerCallback<T>
-{
-   private Class<T> dataType;
-   T value;
-
-   public DomainInitializerCallback(Class<T> dataType)
-   {
-      this.dataType = dataType;
-   }
-   
-   public Class<T> getDataType()
-   {
-      return dataType;
-   }
-
-   public T getValue()
-   {
-      return value;
-   }
-
-   public void setValue(T value)
-   {
-      this.value = value;
-   }
-}

Deleted: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallbackHandler.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallbackHandler.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallbackHandler.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -1,32 +0,0 @@
-/*
-* 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.aop.domain;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public interface DomainInitializerCallbackHandler
-{
-   void handle(DomainInitializerCallback[] callbacks);
-}

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/ScopedRepositoryClassLoaderDomain.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/ScopedRepositoryClassLoaderDomain.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/domain/ScopedRepositoryClassLoaderDomain.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -75,7 +75,7 @@
             //The class has been loaded by a parent classloader, find out if we also have a copy
             try
             {
-               Class clazz = myRepository.loadClass(aspect.getClass().getName());
+               Class<?> clazz = myRepository.loadClass(aspect.getClass().getName());
                if (clazz == aspect.getClass())
                {
                   notMyPerVMAspects.put(def, Boolean.TRUE);

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/junit/AOPTest.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/junit/AOPTest.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/junit/AOPTest.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -39,7 +39,7 @@
     * @return the delegate
     * @throws Exception for any error
     */
-   public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+   public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
    {
       return new AOPTestDelegate(clazz);
    }

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/junit/AOPTestDelegate.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/junit/AOPTestDelegate.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/main/org/jboss/aop/junit/AOPTestDelegate.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -22,7 +22,6 @@
 package org.jboss.aop.junit;
 
 import java.net.URL;
-import java.util.Iterator;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.jboss.aop.AspectXmlLoader;
@@ -37,7 +36,7 @@
 public class AOPTestDelegate extends AbstractTestDelegate
 {
    /** The deployed urls */
-   private static final CopyOnWriteArrayList urls = new CopyOnWriteArrayList();
+   private static final CopyOnWriteArrayList<URL> urls = new CopyOnWriteArrayList<URL>();
    
    /**
     * Create a new AOPTestDelegate.
@@ -45,7 +44,7 @@
     * @param clazz the test class
     * @throws Exception for any error
     */
-   public AOPTestDelegate(Class clazz) throws Exception
+   public AOPTestDelegate(Class<?> clazz) throws Exception
    {
       super(clazz);
    }
@@ -100,9 +99,8 @@
    
    protected void undeploy()
    {
-      for (Iterator i = urls.iterator(); i.hasNext();)
+      for (URL url : urls)
       {
-         URL url = (URL) i.next();
          undeploy(url);
       }
    }

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTest.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTest.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTest.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -60,7 +60,7 @@
    public static Test suite(Class<?> clazz, boolean importAll, Class<?>... packages)
    {
       helper = new IsolatedClassLoaderTestHelper();
-      ClassFilter aopFilter = new PatternClassFilter(new String[] { "org\\.jboss\\.aop\\..+", "org\\.jboss\\.metadata\\..+"}, new String[] { "org/jboss/aop/.+", "org/jboss/metadata/.+"});
+      ClassFilter aopFilter = new PatternClassFilter(new String[] { "org\\.jboss\\.aop\\..+", "org\\.jboss\\.metadata\\..+"}, new String[] { "org/jboss/aop/.+", "org/jboss/metadata/.+"}, null);
       Class<?> newClass = helper.initializeClassLoader(clazz, aopFilter, importAll, packages);
       return AbstractTestCaseWithSetup.suite(newClass);
    }

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTestDelegate.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTestDelegate.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTestDelegate.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -53,7 +53,7 @@
     * @param weaveClasses Whether or not we should weave loaded classes
     * @param system the classloader system
     */
-   public AOPIntegrationTestDelegate(Class clazz, boolean weaveClasses, ClassLoaderSystem system) 
+   public AOPIntegrationTestDelegate(Class<?> clazz, boolean weaveClasses, ClassLoaderSystem system) 
    {
       super(clazz);
       this.system = system;

Modified: projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersionsUnitTestCase.java
===================================================================
--- projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersionsUnitTestCase.java	2008-03-24 04:11:52 UTC (rev 71188)
+++ projects/aop/branches/joinpoint_graph/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersionsUnitTestCase.java	2008-03-24 04:17:13 UTC (rev 71189)
@@ -88,12 +88,12 @@
                   System.out.println("--------------> A1\t\t" + a1);
                   System.out.println("--------------> Support2\t" + support2);
                   System.out.println("--------------> A2\t\t" + a2);
-                  Class clazz = Thread.currentThread().getContextClassLoader().loadClass("org.jboss.test.aop.integration.complex.support.TestInterceptor");
+                  Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass("org.jboss.test.aop.integration.complex.support.TestInterceptor");
                   System.out.println("====== " + clazz + " " + clazz.getClassLoader());
                   
-                  Class clazz1 = a1.loadClass("org.jboss.test.aop.integration.complex.support.TestInterceptor"); 
+                  Class<?> clazz1 = a1.loadClass("org.jboss.test.aop.integration.complex.support.TestInterceptor"); 
                   System.out.println("====== " + clazz1 + " " + clazz1.getClassLoader());
-                  Class clazz2 = a2.loadClass("org.jboss.test.aop.integration.complex.support.TestInterceptor"); 
+                  Class<?> clazz2 = a2.loadClass("org.jboss.test.aop.integration.complex.support.TestInterceptor"); 
                   System.out.println("====== " + clazz2 + " " + clazz2.getClassLoader());
                   
                   try
@@ -102,6 +102,7 @@
                      try
                      {
                         Class<?> classA1 = a1.loadClass(CLASS_A);
+                        @SuppressWarnings("unused")
                         Object instanceA1 = classA1.newInstance();
 
                         Class<?> classA2 = a2.loadClass(CLASS_A);




More information about the jboss-cvs-commits mailing list