[jboss-cvs] JBossAS SVN: r64126 - in projects/aop/trunk/asintegration/src/main/org/jboss/aop: deployment and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 18 14:39:49 EDT 2007


Author: adrian at jboss.org
Date: 2007-07-18 14:39:49 -0400 (Wed, 18 Jul 2007)
New Revision: 64126

Added:
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBoss4Integration.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossIntegration.java
Modified:
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/AspectManagerService.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/AspectManagerServiceJDK5.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassLoaderValidator.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassPool.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassPoolFactory.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossScopedClassLoaderHelper.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/LoaderRepositoryUrlUtil.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/ScopedClassLoaderDomain.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/ScopedJBossClassPool.java
Log:
[JBAOP-107] - Refactoring in preparation for new integration via jboss classloading spi.

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -24,7 +24,7 @@
 import org.jboss.aop.AspectAnnotationLoader;
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.AspectXmlLoader;
-import org.jboss.aop.deployment.JBossScopedClassLoaderHelper;
+import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
 import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
 import org.jboss.deployers.spi.deployer.DeploymentUnit;
 import org.jboss.deployers.spi.DeploymentException;
@@ -307,9 +307,11 @@
       //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
       //It can contain an aop.xml file, or it can be part of a .aop file
       //Linking a standalone -aop.xml file onto a scoped deployment is not possible at the moment
-      if (JBossScopedClassLoaderHelper.isScopedClassLoader(unit.getClassLoader()))
+      AOPClassLoaderScopingPolicy policy = AspectManager.instance().getClassLoaderScopingPolicy();
+      ClassLoader cl = unit.getClassLoader();
+      if (policy != null && policy.isScoped(cl))
       {
-         return unit.getClassLoader();
+         return cl;
       }
       
       return null;

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/AspectManagerService.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/AspectManagerService.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/AspectManagerService.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -31,14 +31,8 @@
 
 import javassist.scopedpool.ScopedClassPoolFactory;
 
-import javax.management.Attribute;
-import javax.management.AttributeNotFoundException;
-import javax.management.InstanceNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.MBeanException;
 import javax.management.Notification;
 import javax.management.ObjectName;
-import javax.management.ReflectionException;
 
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.AspectNotificationHandler;
@@ -47,9 +41,6 @@
 import org.jboss.aop.ClassicWeavingStrategy;
 import org.jboss.aop.Deployment;
 import org.jboss.aop.SuperClassesFirstWeavingStrategy;
-import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
-import org.jboss.aop.classpool.AOPScopedClassLoaderHelper;
-import org.jboss.aop.classpool.AOPScopedClassLoaderHelperBridge;
 import org.jboss.aop.hook.JDK14Transformer;
 import org.jboss.aop.hook.JDK14TransformerManager;
 import org.jboss.aop.instrument.InstrumentorFactory;
@@ -64,7 +55,6 @@
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @author adrian at jboss.org
  * @version $Revision$
- * @jmx:mbean extends="org.jboss.system.ServiceMBean"
  */
 public class AspectManagerService
         extends ServiceMBeanSupport
@@ -75,6 +65,7 @@
       //pre-load necessary classes so that we avoid NoClassDefFoundErrors on JRockit when using the RepositoryClassloader hook
       //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;
       clazz = SuperClassesFirstWeavingStrategy.class;
       clazz = ClassicWeavingStrategy.class;
@@ -98,6 +89,9 @@
    //When running with JBoss 5 registration with MBeanServer happens after the service has been started
    boolean registerHappensAfterStart;
    boolean hasBeenStarted;
+   
+   /** The encapsulation of the integration */
+   private JBossIntegration integration;
 
    // Static -------------------------------------------------------
 
@@ -108,6 +102,8 @@
 
    /**
     * Ctor called wehen running in JBoss 5. In JBoss 5 we take control of registering this service in JMX ourselves
+    * 
+    * @param baseXml the base xml for aspects
     */
    public AspectManagerService(String baseXml)
    {
@@ -117,19 +113,53 @@
 
    // Public -------------------------------------------------------
 
-   protected ScopedClassPoolFactory createFactory() throws Exception
+   /**
+    * Get the integration
+    * 
+    * @return the integration
+    */
+   public JBossIntegration getJBossIntegration()
    {
-      return new JBossClassPoolFactory(tmpClassesDir);
+      return integration;
    }
+   
+   /**
+    * Set the integration
+    * 
+    * @param integration the integration 
+    */
+   public void setJBossIntegration(JBossIntegration integration)
+   {
+      this.integration = integration;
+   }
 
+   protected ScopedClassPoolFactory createFactory() throws Exception
+   {
+      return initIntegration().createScopedClassPoolFactory(tmpClassesDir);
+   }
+   
    protected ClassLoaderValidation createClassLoaderValidation()
    {
-      return new JBossClassLoaderValidator();
+      return initIntegration();
    }
 
+   /**
+    * Initialize the integration if not alreday done so
+    * 
+    * @return the integration
+    */
+   protected JBossIntegration initIntegration()
+   {
+      // Default to old JBoss4 integration when not configured
+      if (integration == null)
+         integration = new JBoss4Integration();
+      return integration;
+   }
+   
    protected void createService()
            throws Exception
    {
+      initIntegration();
       if (hasBeenStarted)
       {
          return;
@@ -164,9 +194,7 @@
       created = true;
       AspectManager.notificationHandler = this;
 
-      AOPScopedClassLoaderHelper helper = new JBossScopedClassLoaderHelper();
-      AOPClassLoaderScopingPolicy policy = new AOPScopedClassLoaderHelperBridge(helper);
-      AspectManager.setClassLoaderScopingPolicy(policy);
+      AspectManager.setClassLoaderScopingPolicy(integration.createAOPClassLoaderScopingPolicy());
 
       baseAop();
    }
@@ -204,59 +232,12 @@
    protected void attachDeprecatedTranslator()
    {
       log.warn("EnableTransformer has been deprecated, please use EnableLoadtimeWeaving.  See docs for more details");
-      AspectManager mgr = AspectManager.instance();
-      try
-      {
-         server.setAttribute(DEFAULT_LOADER_REPOSITORY, new Attribute("Translator", mgr));
-      }
-      catch (InstanceNotFoundException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (AttributeNotFoundException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (InvalidAttributeValueException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (MBeanException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (ReflectionException e)
-      {
-         throw new RuntimeException(e);
-      }
+      initIntegration().attachDeprecatedTranslator();
    }
 
    protected void detachDeprecatedTranslator()
    {
-      try
-      {
-         server.setAttribute(DEFAULT_LOADER_REPOSITORY, new Attribute("Translator", null));
-      }
-      catch (InstanceNotFoundException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (AttributeNotFoundException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (InvalidAttributeValueException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (MBeanException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (ReflectionException e)
-      {
-         throw new RuntimeException(e);
-      }
+      initIntegration().detachDeprecatedTranslator();
    }
 
    protected void attachTranslator()
@@ -308,7 +289,7 @@
    public void setExclude(String exclude)
    {
       this.exclude = exclude;
-      ArrayList list = new ArrayList();
+      ArrayList<String> list = new ArrayList<String>();
       if (exclude != null)
       {
          StringTokenizer tokenizer = new StringTokenizer(exclude, ",");
@@ -328,7 +309,7 @@
    public void setInclude(String include)
    {
       this.include = include;
-      ArrayList list = new ArrayList();
+      ArrayList<String> list = new ArrayList<String>();
       if (include != null)
       {
          StringTokenizer tokenizer = new StringTokenizer(include, ",");
@@ -348,7 +329,7 @@
    public void setIgnore(String ignore)
    {
       this.ignore = ignore;
-      ArrayList list = new ArrayList();
+      ArrayList<String> list = new ArrayList<String>();
       if (ignore != null)
       {
          StringTokenizer tokenizer = new StringTokenizer(ignore, ",");
@@ -363,8 +344,6 @@
 
    /**
     * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-attribute
     */
    public File getTmpClassesDir()
    {
@@ -373,8 +352,6 @@
 
    /**
     * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-attribute
     */
    public void setTmpClassesDir(File tmpClassesDir)
    {
@@ -383,8 +360,6 @@
 
    /**
     * Set the verbosity of aop logging.  It doesn't use log4j
-    *
-    * @jmx:managed-attribute
     */
    public boolean getVerbose()
    {
@@ -393,8 +368,6 @@
 
    /**
     * Set the verbosity of aop logging.  It doesn't use log4j
-    *
-    * @jmx:managed-attribute
     */
    public void setVerbose(boolean verbose)
    {
@@ -403,8 +376,6 @@
 
    /**
     * Use aop optimizations.  Optional just in case there is a bug
-    *
-    * @jmx:managed-attribute
     */
    public boolean getOptimized()
    {
@@ -413,42 +384,28 @@
 
    /**
     * Use aop optimizations.  Optional just in case there is a bug
-    *
-    * @jmx:managed-attribute
     */
    public void setOptimized(boolean verbose)
    {
       AspectManager.optimize = verbose;
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public boolean getSuppressTransformationErrors()
    {
       return suppressTransformationErrors;
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public void setSuppressTransformationErrors(boolean suppressTransformationErrors)
    {
       this.suppressTransformationErrors = suppressTransformationErrors;
       AspectManager.suppressTransformationErrors = suppressTransformationErrors;
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public boolean getSuppressReferenceErrors()
    {
       return suppressReferenceErrors;
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public void setSuppressReferenceErrors(boolean suppressReferenceErrors)
    {
       this.suppressReferenceErrors = suppressReferenceErrors;
@@ -457,8 +414,6 @@
 
    /**
     * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-attribute
     */
    public boolean getEnableTransformer()
    {
@@ -467,8 +422,6 @@
 
    /**
     * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-operation
     */
    public String interceptorFactories()
    {
@@ -484,8 +437,6 @@
 
    /**
     * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-operation
     */
    public String aspectDefinitions()
    {
@@ -499,9 +450,6 @@
       return buffer.toString();
    }
 
-   /**
-    * @jmx:managed-operation
-    */
    public String introductions()
    {
       Map factories = AspectManager.instance().getInterfaceIntroductions();
@@ -514,11 +462,6 @@
       return buffer.toString();
    }
 
-   /**
-    * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-operation
-    */
    public String stacks()
    {
       Map factories = AspectManager.instance().getInterceptorStacks();
@@ -531,11 +474,6 @@
       return buffer.toString();
    }
 
-   /**
-    * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-operation
-    */
    public String bindings()
    {
       Map factories = AspectManager.instance().getBindings();
@@ -548,11 +486,6 @@
       return buffer.toString();
    }
 
-   /**
-    * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-operation
-    */
    public String registeredClassLoaders()
    {
       Map factories = AspectManager.instance().getRegisteredCLs();
@@ -565,11 +498,6 @@
       return buffer.toString();
    }
 
-   /**
-    * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-attribute
-    */
    public void setEnableTransformer(boolean enableTransformer)
    {
       // Testsuite uses enableTransformer, we may be testing new loadtime features though.
@@ -599,11 +527,6 @@
       return enableLoadtimeWeaving;
    }
 
-   /**
-    * The temporary directory to which dyn class files are written
-    *
-    * @jmx:managed-attribute
-    */
    public void setEnableLoadtimeWeaving(boolean enableTransformer)
    {
       if (this.enableLoadtimeWeaving == enableTransformer) return;

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/AspectManagerServiceJDK5.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/AspectManagerServiceJDK5.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/AspectManagerServiceJDK5.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -27,7 +27,6 @@
 /**
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision: 57692 $
- * @jmx:mbean extends="org.jboss.system.ServiceMBean"
  */
 public class AspectManagerServiceJDK5 extends AspectManagerService
 {

Added: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBoss4Integration.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBoss4Integration.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBoss4Integration.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -0,0 +1,159 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.aop.deployment;
+
+import java.io.File;
+
+import javax.management.Attribute;
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceNotFoundException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.ReflectionException;
+
+import javassist.ClassPool;
+import javassist.scopedpool.ScopedClassPool;
+import javassist.scopedpool.ScopedClassPoolFactory;
+import javassist.scopedpool.ScopedClassPoolRepository;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
+import org.jboss.aop.classpool.AOPScopedClassLoaderHelper;
+import org.jboss.aop.classpool.AOPScopedClassLoaderHelperBridge;
+import org.jboss.mx.loading.RepositoryClassLoader;
+import org.jboss.mx.util.MBeanServerLocator;
+
+/**
+ * JBoss4Integration.<p>
+ * 
+ * This class and its associated classes are
+ * for the old JBoss4 integration with the LoaderRepository<p>
+ * 
+ * <ul>Related Classes:
+ * <li> {@link JBossClassPool}
+ * <li> {@link JBossClassPoolFactory}
+ * <li> {@link JBossScopedClassLoaderHelper}
+ * <li> {@link LoaderRepositoryUrlUtil}
+ * <li> {@link ScopedClassLoaderDomain}
+ * <li> {@link ScopedJBossClassPool}
+ * </ul>
+ * 
+ * @deprecated TODO JBAOP-107 need to write a JBoss5 version 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+public class JBoss4Integration implements JBossIntegration
+{
+   /** The delegate classpool factory */
+   private ScopedClassPoolFactory delegateClassPoolFactory;
+   
+   public boolean isValidClassLoader(ClassLoader loader)
+   {
+      if (!(loader instanceof RepositoryClassLoader)) return false;
+      return ((RepositoryClassLoader) loader).getLoaderRepository() != null;
+   }
+
+   public AOPClassLoaderScopingPolicy createAOPClassLoaderScopingPolicy()
+   {
+      AOPScopedClassLoaderHelper helper = new JBossScopedClassLoaderHelper();
+      return new AOPScopedClassLoaderHelperBridge(helper);
+   }
+
+   public ScopedClassPoolFactory createScopedClassPoolFactory(File tmpDir) throws Exception
+   {
+      delegateClassPoolFactory = new JBossClassPoolFactory(tmpDir);
+      return this;
+   }
+   
+   public ScopedClassPool create(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
+   {
+      return delegateClassPoolFactory.create(cl, src, repository);
+   }
+
+   public ScopedClassPool create(ClassPool src, ScopedClassPoolRepository repository)
+   {
+      return delegateClassPoolFactory.create(src, repository);
+   }
+   
+   public void attachDeprecatedTranslator()
+   {
+      AspectManager mgr = AspectManager.instance();
+      MBeanServer server = MBeanServerLocator.locateJBoss();
+      try
+      {
+         server.setAttribute(AspectManagerService.DEFAULT_LOADER_REPOSITORY, new Attribute("Translator", mgr));
+      }
+      catch (InstanceNotFoundException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (AttributeNotFoundException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (InvalidAttributeValueException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (MBeanException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (ReflectionException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void detachDeprecatedTranslator()
+   {
+      MBeanServer server = MBeanServerLocator.locateJBoss();
+      try
+      {
+         server.setAttribute(AspectManagerService.DEFAULT_LOADER_REPOSITORY, new Attribute("Translator", null));
+      }
+      catch (InstanceNotFoundException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (AttributeNotFoundException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (InvalidAttributeValueException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (MBeanException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (ReflectionException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassLoaderValidator.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassLoaderValidator.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassLoaderValidator.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -27,9 +27,12 @@
 /**
  * Comment
  *
+ * TODO Is this used anywhere anymore? {@link JBoss4Integration} contains the real implementation
+ * @Deprecated use JBossIntegration
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
  */
+ at Deprecated
 public class JBossClassLoaderValidator implements ClassLoaderValidation
 {
    public boolean isValidClassLoader(ClassLoader loader)

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassPool.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassPool.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassPool.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -36,9 +36,12 @@
 /**
  * Comment
  *
+ * @deprecated TODO JBAOP-107 Need a different version for the JBoss5 classloader 
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author adrian at jboss.org
  * @version $Revision$
  */
+ at Deprecated
 public class JBossClassPool extends AOPClassPool
 {
    /**

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassPoolFactory.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassPoolFactory.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossClassPoolFactory.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -37,11 +37,12 @@
 /**
  * Comment
  *
+ * @deprecated TODO JBAOP-107 Need a different version for the JBoss5 classloader 
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @author adrian at jboss.org
  * @version $Revision$
- *
  **/
+ at Deprecated
 public class JBossClassPoolFactory implements ScopedClassPoolFactory
 {
    protected File tmpClassesDir;

Added: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossIntegration.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossIntegration.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossIntegration.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.aop.deployment;
+
+import java.io.File;
+
+import javassist.scopedpool.ScopedClassPoolFactory;
+
+import org.jboss.aop.ClassLoaderValidation;
+import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
+
+/**
+ * AOPIntegration.<p>
+ * 
+ * This class is intended to identify all the integration
+ * points AOP is making with the JBoss appserver.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JBossIntegration extends ClassLoaderValidation, ScopedClassPoolFactory
+{
+   /**
+    * Create the AOPClassLoaderScopingPolicy
+    * 
+    * @return the policy
+    */
+   AOPClassLoaderScopingPolicy createAOPClassLoaderScopingPolicy();
+
+   /**
+    * Create a scoped classpool factory
+    *
+    * TODO JBAOP-107 need to review whether ScopedClassPool should also be replaced with
+    *      some other policy, e.g. javassist ClassPath notion is closer to new classloader?
+    * @param tmpDir the temporary directory for classes
+    * @return the factory
+    * @throws Exception for any error
+    */
+   ScopedClassPoolFactory createScopedClassPoolFactory(File tmpDir) throws Exception;
+   
+   /**
+    * Attach the depreacted translator
+    */
+   void attachDeprecatedTranslator();
+
+   /**
+    * Detach the deprecated translator
+    */
+   void detachDeprecatedTranslator();
+}

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossScopedClassLoaderHelper.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossScopedClassLoaderHelper.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/JBossScopedClassLoaderHelper.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -23,6 +23,7 @@
 
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.Domain;
+import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
 import org.jboss.aop.classpool.AOPScopedClassLoaderHelper;
 import org.jboss.mx.loading.HeirarchicalLoaderRepository3;
 import org.jboss.mx.loading.LoaderRepository;
@@ -30,9 +31,13 @@
 
 /**
  * 
+ * TODO JBAOP-107 Need a different version for the JBoss5 classloader
+ * @deprecated use {@link AOPClassLoaderScopingPolicy}
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @autor adrian at jboss.org
  * @version $Revision$
  */
+ at Deprecated
 public class JBossScopedClassLoaderHelper implements AOPScopedClassLoaderHelper
 {
    public ClassLoader ifScopedDeploymentGetScopedParentUclForCL(ClassLoader loader)

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/LoaderRepositoryUrlUtil.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/LoaderRepositoryUrlUtil.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/LoaderRepositoryUrlUtil.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -35,9 +35,11 @@
 
 /**
  * 
+ * @deprecated JBAOP-??? Need a different version for the JBoss5 classloader 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
+ at Deprecated
 public class LoaderRepositoryUrlUtil implements NotificationListener
 {
    final static MBeanServer SERVER;

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/ScopedClassLoaderDomain.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/ScopedClassLoaderDomain.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/ScopedClassLoaderDomain.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -36,9 +36,12 @@
 /**
  * A domain that is used for scoped classloaders
  * 
+ * @deprecated TODO JBAOP-107 Need a different version for the JBoss5 classloader 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @author adrian at jboss.org
  * @version $Revision: 1.1 $
  */
+ at Deprecated
 public class ScopedClassLoaderDomain extends Domain
 {
    

Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/ScopedJBossClassPool.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/ScopedJBossClassPool.java	2007-07-18 17:00:22 UTC (rev 64125)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployment/ScopedJBossClassPool.java	2007-07-18 18:39:49 UTC (rev 64126)
@@ -42,9 +42,11 @@
 /**
  * A classpool in JBoss backed by a scoped (HierarchicalLoaderRepository) loader repository
  * 
+ * @deprecated JBAOP-??? Need a different version for the JBoss5 classloader 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
+ at Deprecated
 public class ScopedJBossClassPool extends JBossClassPool 
 {
    final static LoaderRepositoryUrlUtil LOADER_REPOSITORY_UTIL = new LoaderRepositoryUrlUtil();




More information about the jboss-cvs-commits mailing list