[jboss-cvs] JBossAS SVN: r66575 - in trunk: aspects/src/main/org/jboss/aop/asintegration/jboss5 and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 30 12:24:09 EDT 2007
Author: kabir.khan at jboss.com
Date: 2007-10-30 12:24:09 -0400 (Tue, 30 Oct 2007)
New Revision: 66575
Added:
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/IntegrationStrategy.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/RepositoryIntegrationStrategy.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ScopedVFSClassLoaderDomain.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSClassLoaderDomainRegistry.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSClassLoaderScopingPolicy.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSIntegrationStrategy.java
Removed:
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/NewClassLoaderDomainRegistry.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/NewClassLoaderScopingPolicy.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ScopedNewClassLoaderDomain.java
Modified:
trunk/aspects/build.xml
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/JBoss5Integration.java
trunk/build/build-distr.xml
trunk/server/src/etc/conf/default/bootstrap-beans.xml
Log:
[JBAOP-107] Update packaging of aop integration
Modified: trunk/aspects/build.xml
===================================================================
--- trunk/aspects/build.xml 2007-10-30 16:21:10 UTC (rev 66574)
+++ trunk/aspects/build.xml 2007-10-30 16:24:09 UTC (rev 66575)
@@ -231,6 +231,15 @@
</fileset>
</jar>
+ <!-- Build jboss-aop-jboss5.jar -->
+ <jar destfile="${build.lib}/jboss-aop-jboss5.jar" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset dir="${build.classes}">
+ <!--include name="org/jboss/aop/deployers/JBossAspectLibrary.class"/-->
+ <include name="org/jboss/aop/asintegration/jboss5/**"/>
+ </fileset>
+ </jar>
+
<!-- Build client jar containing the minimum needed for ejb 3 -->
<jar destfile="${build.lib}/jboss-aspect-jdk50-client.jar" manifest="${build.etc}/default.mf"
update="${jar.update}" index="${jar.index}">
@@ -272,6 +281,26 @@
</fileset>
</jar>
<delete dir="${build.meta.inf}"/>
+
+ <!-- FIXME Temporary until after JBoss AOP 2.0.0.beta2
+ 1) Make jboss-aop-jboss4-jdk50.jar
+ 2) Get rid of the org.jboss.aop.asintegration.jboss5 classes from jboss-aop-deployer-jdk50.jar
+
+ Use these jars in build-distr.xml under 'ASPECTS'
+ -->
+ <mkdir dir="${build.lib}/temp"/>
+ <unjar dest="${build.lib}/temp" src="${jboss.aop.lib}/jboss-aop-deployer-jdk50.jar"/>
+ <jar destfile="${build.lib}/jboss-aop-jboss4-jdk50.jar" manifest="${build.lib}/temp/META-INF/MANIFEST.MF">
+ <fileset dir="${build.lib}/temp">
+ <include name="org/jboss/aop/asintegration/jboss4/**"/>
+ </fileset>
+ </jar>
+ <jar destfile="${build.lib}/jboss-aop-deployer-jdk50.jar" manifest="${build.lib}/temp/META-INF/MANIFEST.MF">
+ <fileset dir="${build.lib}/temp">
+ <exclude name="org/jboss/aop/asintegration/jboss*/**"/>
+ </fileset>
+ </jar>
+ <delete dir="${build.lib}/temp"/>
</target>
Added: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/IntegrationStrategy.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/IntegrationStrategy.java (rev 0)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/IntegrationStrategy.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -0,0 +1,41 @@
+/*
+* 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.asintegration.jboss5;
+
+import java.io.File;
+
+import javassist.scopedpool.ScopedClassPoolFactory;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IntegrationStrategy
+{
+ void start();
+ void stop();
+ ScopedClassPoolFactory createScopedClassPoolFactory(File tmpDir) throws Exception;
+ void attachDeprecatedTranslator();
+ void detachDeprecatedTranslator();
+
+}
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/JBoss5Integration.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/JBoss5Integration.java 2007-10-30 16:21:10 UTC (rev 66574)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/JBoss5Integration.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -31,7 +31,6 @@
import org.jboss.aop.AspectManager;
import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
import org.jboss.aop.asintegration.JBossIntegration;
-import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.mx.loading.RepositoryClassLoader;
/**
@@ -47,26 +46,14 @@
private AspectManager manager = AspectManager.getTopLevelAspectManager();
DefaultTranslator translator = new DefaultTranslator(manager);
- NewClassLoaderDomainRegistry registry;
-
- public NewClassLoaderDomainRegistry getRegistry()
- {
- return registry;
- }
-
- public void setRegistry(NewClassLoaderDomainRegistry registry)
- {
- this.registry = registry;
- }
-
public void start()
{
- ClassLoaderSystem.getInstance().setTranslator(translator);
+ getIntegrationStrategy().start();
}
public void stop()
{
- ClassLoaderSystem.getInstance().setTranslator(null);
+ getIntegrationStrategy().stop();
}
public boolean isValidClassLoader(ClassLoader loader)
@@ -90,9 +77,12 @@
return policy;
}
- public ScopedClassPoolFactory createScopedClassPoolFactory(File tmpDir) throws Exception
+ public synchronized ScopedClassPoolFactory createScopedClassPoolFactory(File tmpDir) throws Exception
{
- delegateClassPoolFactory = new JBoss5ClassPoolFactory();
+ if (delegateClassPoolFactory == null)
+ {
+ delegateClassPoolFactory = getIntegrationStrategy().createScopedClassPoolFactory(tmpDir);
+ }
return this;
}
@@ -108,11 +98,28 @@
public void attachDeprecatedTranslator()
{
- translator.setTranslate(true);
+ getIntegrationStrategy().attachDeprecatedTranslator();
}
public void detachDeprecatedTranslator()
{
- translator.setTranslate(false);
+ getIntegrationStrategy().detachDeprecatedTranslator();
}
+
+ private IntegrationStrategy integrationStrategy;
+ private synchronized IntegrationStrategy getIntegrationStrategy()
+ {
+ if (integrationStrategy == null)
+ {
+ if (policy.getClass().getName().endsWith("RepositoryClassLoaderScopingPolicy"))
+ {
+ integrationStrategy = new RepositoryIntegrationStrategy();
+ }
+ else
+ {
+ integrationStrategy = new VFSIntegrationStrategy(manager);
+ }
+ }
+ return integrationStrategy;
+ }
}
Deleted: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/NewClassLoaderDomainRegistry.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/NewClassLoaderDomainRegistry.java 2007-10-30 16:21:10 UTC (rev 66574)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/NewClassLoaderDomainRegistry.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -1,92 +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.asintegration.jboss5;
-
-import java.lang.ref.WeakReference;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.jboss.aop.Domain;
-import org.jboss.classloader.spi.ClassLoaderDomain;
-import org.jboss.classloader.spi.ClassLoaderSystem;
-import org.jboss.deployers.plugins.classloading.Module;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class NewClassLoaderDomainRegistry
-{
- final static ClassLoaderDomain domain = new ClassLoaderDomain("NOT_USED_PLACEHOLDER");
-
- /** classloader domains by their classloaders */
- private Map<ClassLoader, WeakReference<ClassLoaderDomain>> classLoaderDomainsByLoader = new WeakHashMap<ClassLoader, WeakReference<ClassLoaderDomain>>();
-
- /** aopDomains by classloader domain */
- private Map<ClassLoaderDomain, ScopedNewClassLoaderDomain> aopDomainsByClassLoaderDomain = new WeakHashMap<ClassLoaderDomain, ScopedNewClassLoaderDomain>();
-
- synchronized void initMapsForLoader(ClassLoader loader, Module module, ScopedNewClassLoaderDomain domain)
- {
- ClassLoaderSystem system = ClassLoaderSystem.getInstance();
-
- String domainName = module.getDomainName();
- ClassLoaderDomain clDomain = system.getDomain(domainName);
- classLoaderDomainsByLoader.put(loader, new WeakReference<ClassLoaderDomain>(clDomain));
-
- if (domain != null)
- {
- aopDomainsByClassLoaderDomain.put(clDomain, domain);
- }
- }
-
- synchronized Domain getRegisteredDomain(ClassLoader cl)
- {
- ClassLoaderDomain clDomain = getClassLoaderDomainForLoader(cl);
- if (clDomain != null)
- {
- return aopDomainsByClassLoaderDomain.get(clDomain);
- }
- return null;
- }
-
- synchronized ClassLoaderDomain getClassLoaderDomainForLoader(ClassLoader cl)
- {
- WeakReference<ClassLoaderDomain> clDomainRef = classLoaderDomainsByLoader.get(cl);
- if (clDomainRef != null)
- {
- return clDomainRef.get();
- }
-
- ClassLoader parent = cl.getParent();
- if (parent != null)
- {
- ClassLoaderDomain domain = getClassLoaderDomainForLoader(parent);
- if (domain != null)
- {
- classLoaderDomainsByLoader.put(parent, new WeakReference<ClassLoaderDomain>(domain));
- return domain;
- }
- }
- return null;
- }
-}
Deleted: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/NewClassLoaderScopingPolicy.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/NewClassLoaderScopingPolicy.java 2007-10-30 16:21:10 UTC (rev 66574)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/NewClassLoaderScopingPolicy.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -1,124 +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.asintegration.jboss5;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.Domain;
-import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
-import org.jboss.aop.classpool.ExtraClassPoolFactoryParameters;
-import org.jboss.aop.domain.DomainInitializer;
-import org.jboss.aop.domain.DomainInitializerCallback;
-import org.jboss.aop.domain.DomainInitializerCallbackHandler;
-import org.jboss.classloader.spi.ClassLoaderDomain;
-import org.jboss.classloader.spi.ClassLoaderSystem;
-import org.jboss.deployers.plugins.classloading.Module;
-import org.jboss.deployers.structure.spi.classloading.ClassLoaderMetaData;
-import org.jboss.logging.Logger;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class NewClassLoaderScopingPolicy implements AOPClassLoaderScopingPolicy, DomainInitializer
-{
- static Logger log = Logger.getLogger(NewClassLoaderScopingPolicy.class);
- NewClassLoaderDomainRegistry registry;
-
- public NewClassLoaderDomainRegistry getRegistry()
- {
- return registry;
- }
-
- public void setRegistry(NewClassLoaderDomainRegistry registry)
- {
- this.registry = registry;
- }
-
-
- public Domain initializeDomain(DomainInitializerCallbackHandler handler)
- {
- DomainInitializerCallback<ClassLoader> loaderCb = new DomainInitializerCallback<ClassLoader>(ClassLoader.class);
- DomainInitializerCallback<Module> moduleCb = new DomainInitializerCallback<Module>(Module.class);
- DomainInitializerCallback[] callbacks = new DomainInitializerCallback[]{loaderCb, moduleCb};
- handler.handle(callbacks);
-
- ClassLoader loader = loaderCb.getValue();
- Module module = moduleCb.getValue();
-
- ScopedNewClassLoaderDomain scopedDomain = (ScopedNewClassLoaderDomain)registry.getRegisteredDomain(loader);
- if (scopedDomain == null)
- {
- if (module.getParentDomain() != null/* && module.getParentDomain().equals(ClassLoaderSystem.DEFAULT_DOMAIN_NAME)*/)
- {
- ClassLoaderSystem system = ClassLoaderSystem.getInstance();
- String domainName = module.getDomainName();
- ClassLoaderDomain domain = system.getDomain(domainName);
-
- ClassLoaderMetaData cmd = module.getMetadata();
- boolean parentDelegation = cmd.isJ2seClassLoadingCompliance();
- String name = String.valueOf(System.identityHashCode(loader));
-
- scopedDomain = new ScopedNewClassLoaderDomain(loader, name, parentDelegation, AspectManager.getTopLevelAspectManager(), false, domain, registry);
- }
-
- registry.initMapsForLoader(loader, module, scopedDomain);
-
- //Need to pass some data through to the classpoolfactory here
- Map properties = new HashMap();
- //The module is needed by the JBoss5ClassPoolFactory, the legacy JBossClassPoolFactory will ignore this
- properties.put(Module.class, module);
- ExtraClassPoolFactoryParameters.pushThreadProperties(properties);
- try
- {
- AspectManager.instance().registerClassLoader(loader); //Ends up in classpool factory create method
- }
- finally
- {
- ExtraClassPoolFactoryParameters.popThreadProperties();
- }
- }
- return scopedDomain;
- }
-
- public Domain getDomain(ClassLoader classLoader, AspectManager parent)
- {
- //Check the stored domains
- Domain domain = registry.getRegisteredDomain(classLoader);
- if (domain != null)
- {
- return domain;
- }
-
- return null;
- }
-
- public Domain getTopLevelDomain(AspectManager parent)
- {
- Thread.currentThread().getContextClassLoader();
- return null;
- }
-}
-
\ No newline at end of file
Added: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/RepositoryIntegrationStrategy.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/RepositoryIntegrationStrategy.java (rev 0)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/RepositoryIntegrationStrategy.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -0,0 +1,122 @@
+/*
+* 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.asintegration.jboss5;
+
+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 org.jboss.aop.AspectManager;
+import org.jboss.aop.asintegration.jboss4.JBossClassPoolFactory;
+import org.jboss.aop.deployment.AspectManagerService;
+import org.jboss.mx.util.MBeanServerLocator;
+
+import javassist.scopedpool.ScopedClassPoolFactory;
+
+/**
+ * Takes care of the specifics in JBoss 5 when the RepositoryClassLoaders are used.
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class RepositoryIntegrationStrategy implements IntegrationStrategy
+{
+ public void start()
+ {
+ }
+
+ public void stop()
+ {
+ }
+
+ public ScopedClassPoolFactory createScopedClassPoolFactory(File tmpDir) throws Exception
+ {
+ //This is the classpool factory from jboss-aop-jboss4-jdk50.jar
+ return new JBossClassPoolFactory(tmpDir);
+ }
+
+ 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);
+ }
+ }
+
+}
Deleted: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ScopedNewClassLoaderDomain.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ScopedNewClassLoaderDomain.java 2007-10-30 16:21:10 UTC (rev 66574)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ScopedNewClassLoaderDomain.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -1,150 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.asintegration.jboss5;
-
-
-import java.lang.ref.WeakReference;
-
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.advice.AspectDefinition;
-import org.jboss.aop.domain.ScopedClassLoaderDomain;
-import org.jboss.classloader.spi.ClassLoaderDomain;
-
-
-/**
- * A domain that is used for scoped classloaders with the new JBoss 5 classloaders
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @author adrian at jboss.org
- * @version $Revision: 1.1 $
- */
-public class ScopedNewClassLoaderDomain extends ScopedClassLoaderDomain
-{
- WeakReference<ClassLoaderDomain> classLoaderDomainRef;
- NewClassLoaderDomainRegistry registry;
-
- public ScopedNewClassLoaderDomain(ClassLoader loader, String name, boolean parentDelegation, AspectManager manager, boolean parentFirst,
- ClassLoaderDomain classLoaderDomain, NewClassLoaderDomainRegistry registry)
- {
- super(loader, name, parentDelegation, manager, parentFirst);
- classLoaderDomainRef = new WeakReference<ClassLoaderDomain>(classLoaderDomain);
- this.registry = registry;
- }
-
- private ClassLoaderDomain getClassLoaderDomain()
- {
- if (classLoaderDomainRef != null)
- {
- return classLoaderDomainRef.get();
- }
- return null;
- }
-
- // FIXME: JBAOP-107 REMOVE THIS HACK
- public boolean isValid()
- {
- ClassLoader cl = getClassLoader();
- if (cl == null)
- return false;
-
- ClassLoaderDomain domain = getClassLoaderDomain();
- if (domain == null)
- return false;
-
- if (domain.hasClassLoaders())
- {
- return true;
- }
-
- return false;
-// return cl.getLoaderRepository() != null;
- }
-
- protected Object getPerVmAspectWithNoParentDelegation(String def)
- {
- Object aspect = myPerVMAspects.get(def);
- if (aspect != null)
- {
- return aspect;
- }
-
- aspect = super.getSuperPerVmAspect(def);
- if (aspect != null)
- {
- Class superAspectClass = aspect.getClass();
- ClassLoaderDomain loadingDomain = getAspectRepository(superAspectClass);
-
- ClassLoaderDomain myDomain = getClassLoaderDomain();
-
- if (loadingDomain == myDomain)
- {
- //The parent does not load this class
- myPerVMAspects.put(def, aspect);
- }
- else
- {
- //The class has been loaded by a parent domain, find out if we also have a copy
- Class myAspectClazz = myDomain.loadClass(aspect.getClass().getName());
-
- if (myAspectClazz == superAspectClass)
- {
- notMyPerVMAspects.put(def, Boolean.TRUE);
- }
- else
- {
- //We have a different version of the class deployed
- AspectDefinition aspectDefinition = getAspectDefinition(def);
- //Override the classloader to create the aspect instance
- aspect = createPerVmAspect(def, aspectDefinition, getClassLoader());
- myPerVMAspects.put(def, aspect);
- }
- }
- }
-
- return aspect;
- }
-
-
-
- private ClassLoaderDomain getAspectRepository(Class clazz)
- {
- ClassLoader cl = clazz.getClassLoader();
- ClassLoaderDomain domain = registry.getClassLoaderDomainForLoader(cl);
- return domain;
- }
-
-// private HeirarchicalLoaderRepository3 getScopedRepository()
-// {
-// ClassLoader classloader = getClassLoader();
-// if (classloader == null)
-// throw new IllegalStateException("ClassLoader no longer exists: " + classLoaderString);
-// if (classloader instanceof RepositoryClassLoader == false)
-// throw new IllegalStateException("ClassLoader is not an instanceof RepositoryClassLoader " + classLoaderString);
-// RepositoryClassLoader repositoryClassLoader = (RepositoryClassLoader) classloader;
-// LoaderRepository loaderRepository = repositoryClassLoader.getLoaderRepository();
-// if (loaderRepository == null)
-// throw new IllegalStateException("ClassLoader has been undeployed: " + classLoaderString);
-// if (loaderRepository instanceof HeirarchicalLoaderRepository3 == false)
-// throw new IllegalStateException("Repository " + loaderRepository + " for classlaoder " + classLoaderString + " is not an HeirarchicalLoaderRepository3");
-// return (HeirarchicalLoaderRepository3) loaderRepository;
-// }
-}
Added: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ScopedVFSClassLoaderDomain.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ScopedVFSClassLoaderDomain.java (rev 0)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ScopedVFSClassLoaderDomain.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -0,0 +1,150 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, 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.asintegration.jboss5;
+
+
+import java.lang.ref.WeakReference;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.AspectDefinition;
+import org.jboss.aop.domain.ScopedClassLoaderDomain;
+import org.jboss.classloader.spi.ClassLoaderDomain;
+
+
+/**
+ * A domain that is used for scoped classloaders with the new JBoss 5 classloaders
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @author adrian at jboss.org
+ * @version $Revision: 1.1 $
+ */
+public class ScopedVFSClassLoaderDomain extends ScopedClassLoaderDomain
+{
+ WeakReference<ClassLoaderDomain> classLoaderDomainRef;
+ VFSClassLoaderDomainRegistry registry;
+
+ public ScopedVFSClassLoaderDomain(ClassLoader loader, String name, boolean parentDelegation, AspectManager manager, boolean parentFirst,
+ ClassLoaderDomain classLoaderDomain, VFSClassLoaderDomainRegistry registry)
+ {
+ super(loader, name, parentDelegation, manager, parentFirst);
+ classLoaderDomainRef = new WeakReference<ClassLoaderDomain>(classLoaderDomain);
+ this.registry = registry;
+ }
+
+ private ClassLoaderDomain getClassLoaderDomain()
+ {
+ if (classLoaderDomainRef != null)
+ {
+ return classLoaderDomainRef.get();
+ }
+ return null;
+ }
+
+ // FIXME: JBAOP-107 REMOVE THIS HACK
+ public boolean isValid()
+ {
+ ClassLoader cl = getClassLoader();
+ if (cl == null)
+ return false;
+
+ ClassLoaderDomain domain = getClassLoaderDomain();
+ if (domain == null)
+ return false;
+
+ if (domain.hasClassLoaders())
+ {
+ return true;
+ }
+
+ return false;
+// return cl.getLoaderRepository() != null;
+ }
+
+ protected Object getPerVmAspectWithNoParentDelegation(String def)
+ {
+ Object aspect = myPerVMAspects.get(def);
+ if (aspect != null)
+ {
+ return aspect;
+ }
+
+ aspect = super.getSuperPerVmAspect(def);
+ if (aspect != null)
+ {
+ Class superAspectClass = aspect.getClass();
+ ClassLoaderDomain loadingDomain = getAspectRepository(superAspectClass);
+
+ ClassLoaderDomain myDomain = getClassLoaderDomain();
+
+ if (loadingDomain == myDomain)
+ {
+ //The parent does not load this class
+ myPerVMAspects.put(def, aspect);
+ }
+ else
+ {
+ //The class has been loaded by a parent domain, find out if we also have a copy
+ Class myAspectClazz = myDomain.loadClass(aspect.getClass().getName());
+
+ if (myAspectClazz == superAspectClass)
+ {
+ notMyPerVMAspects.put(def, Boolean.TRUE);
+ }
+ else
+ {
+ //We have a different version of the class deployed
+ AspectDefinition aspectDefinition = getAspectDefinition(def);
+ //Override the classloader to create the aspect instance
+ aspect = createPerVmAspect(def, aspectDefinition, getClassLoader());
+ myPerVMAspects.put(def, aspect);
+ }
+ }
+ }
+
+ return aspect;
+ }
+
+
+
+ private ClassLoaderDomain getAspectRepository(Class clazz)
+ {
+ ClassLoader cl = clazz.getClassLoader();
+ ClassLoaderDomain domain = registry.getClassLoaderDomainForLoader(cl);
+ return domain;
+ }
+
+// private HeirarchicalLoaderRepository3 getScopedRepository()
+// {
+// ClassLoader classloader = getClassLoader();
+// if (classloader == null)
+// throw new IllegalStateException("ClassLoader no longer exists: " + classLoaderString);
+// if (classloader instanceof RepositoryClassLoader == false)
+// throw new IllegalStateException("ClassLoader is not an instanceof RepositoryClassLoader " + classLoaderString);
+// RepositoryClassLoader repositoryClassLoader = (RepositoryClassLoader) classloader;
+// LoaderRepository loaderRepository = repositoryClassLoader.getLoaderRepository();
+// if (loaderRepository == null)
+// throw new IllegalStateException("ClassLoader has been undeployed: " + classLoaderString);
+// if (loaderRepository instanceof HeirarchicalLoaderRepository3 == false)
+// throw new IllegalStateException("Repository " + loaderRepository + " for classlaoder " + classLoaderString + " is not an HeirarchicalLoaderRepository3");
+// return (HeirarchicalLoaderRepository3) loaderRepository;
+// }
+}
Added: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSClassLoaderDomainRegistry.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSClassLoaderDomainRegistry.java (rev 0)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSClassLoaderDomainRegistry.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -0,0 +1,92 @@
+/*
+* 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.asintegration.jboss5;
+
+import java.lang.ref.WeakReference;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.jboss.aop.Domain;
+import org.jboss.classloader.spi.ClassLoaderDomain;
+import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.deployers.plugins.classloading.Module;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSClassLoaderDomainRegistry
+{
+ final static ClassLoaderDomain domain = new ClassLoaderDomain("NOT_USED_PLACEHOLDER");
+
+ /** classloader domains by their classloaders */
+ private Map<ClassLoader, WeakReference<ClassLoaderDomain>> classLoaderDomainsByLoader = new WeakHashMap<ClassLoader, WeakReference<ClassLoaderDomain>>();
+
+ /** aopDomains by classloader domain */
+ private Map<ClassLoaderDomain, ScopedVFSClassLoaderDomain> aopDomainsByClassLoaderDomain = new WeakHashMap<ClassLoaderDomain, ScopedVFSClassLoaderDomain>();
+
+ synchronized void initMapsForLoader(ClassLoader loader, Module module, ScopedVFSClassLoaderDomain domain)
+ {
+ ClassLoaderSystem system = ClassLoaderSystem.getInstance();
+
+ String domainName = module.getDomainName();
+ ClassLoaderDomain clDomain = system.getDomain(domainName);
+ classLoaderDomainsByLoader.put(loader, new WeakReference<ClassLoaderDomain>(clDomain));
+
+ if (domain != null)
+ {
+ aopDomainsByClassLoaderDomain.put(clDomain, domain);
+ }
+ }
+
+ synchronized Domain getRegisteredDomain(ClassLoader cl)
+ {
+ ClassLoaderDomain clDomain = getClassLoaderDomainForLoader(cl);
+ if (clDomain != null)
+ {
+ return aopDomainsByClassLoaderDomain.get(clDomain);
+ }
+ return null;
+ }
+
+ synchronized ClassLoaderDomain getClassLoaderDomainForLoader(ClassLoader cl)
+ {
+ WeakReference<ClassLoaderDomain> clDomainRef = classLoaderDomainsByLoader.get(cl);
+ if (clDomainRef != null)
+ {
+ return clDomainRef.get();
+ }
+
+ ClassLoader parent = cl.getParent();
+ if (parent != null)
+ {
+ ClassLoaderDomain domain = getClassLoaderDomainForLoader(parent);
+ if (domain != null)
+ {
+ classLoaderDomainsByLoader.put(parent, new WeakReference<ClassLoaderDomain>(domain));
+ return domain;
+ }
+ }
+ return null;
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSClassLoaderScopingPolicy.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSClassLoaderScopingPolicy.java (rev 0)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSClassLoaderScopingPolicy.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -0,0 +1,113 @@
+/*
+* 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.asintegration.jboss5;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.Domain;
+import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
+import org.jboss.aop.classpool.ExtraClassPoolFactoryParameters;
+import org.jboss.aop.domain.DomainInitializer;
+import org.jboss.aop.domain.DomainInitializerCallback;
+import org.jboss.aop.domain.DomainInitializerCallbackHandler;
+import org.jboss.classloader.spi.ClassLoaderDomain;
+import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.deployers.plugins.classloading.Module;
+import org.jboss.deployers.structure.spi.classloading.ClassLoaderMetaData;
+import org.jboss.logging.Logger;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSClassLoaderScopingPolicy implements AOPClassLoaderScopingPolicy, DomainInitializer
+{
+ static Logger log = Logger.getLogger(VFSClassLoaderScopingPolicy.class);
+ VFSClassLoaderDomainRegistry registry = new VFSClassLoaderDomainRegistry();
+
+ public Domain initializeDomain(DomainInitializerCallbackHandler handler)
+ {
+ DomainInitializerCallback<ClassLoader> loaderCb = new DomainInitializerCallback<ClassLoader>(ClassLoader.class);
+ DomainInitializerCallback<Module> moduleCb = new DomainInitializerCallback<Module>(Module.class);
+ DomainInitializerCallback[] callbacks = new DomainInitializerCallback[]{loaderCb, moduleCb};
+ handler.handle(callbacks);
+
+ ClassLoader loader = loaderCb.getValue();
+ Module module = moduleCb.getValue();
+
+ ScopedVFSClassLoaderDomain scopedDomain = (ScopedVFSClassLoaderDomain)registry.getRegisteredDomain(loader);
+ if (scopedDomain == null)
+ {
+ if (module.getParentDomain() != null/* && module.getParentDomain().equals(ClassLoaderSystem.DEFAULT_DOMAIN_NAME)*/)
+ {
+ ClassLoaderSystem system = ClassLoaderSystem.getInstance();
+ String domainName = module.getDomainName();
+ ClassLoaderDomain domain = system.getDomain(domainName);
+
+ ClassLoaderMetaData cmd = module.getMetadata();
+ boolean parentDelegation = cmd.isJ2seClassLoadingCompliance();
+ String name = String.valueOf(System.identityHashCode(loader));
+
+ scopedDomain = new ScopedVFSClassLoaderDomain(loader, name, parentDelegation, AspectManager.getTopLevelAspectManager(), false, domain, registry);
+ }
+
+ registry.initMapsForLoader(loader, module, scopedDomain);
+
+ //Need to pass some data through to the classpoolfactory here
+ Map properties = new HashMap();
+ //The module is needed by the JBoss5ClassPoolFactory, the legacy JBossClassPoolFactory will ignore this
+ properties.put(Module.class, module);
+ ExtraClassPoolFactoryParameters.pushThreadProperties(properties);
+ try
+ {
+ AspectManager.instance().registerClassLoader(loader); //Ends up in classpool factory create method
+ }
+ finally
+ {
+ ExtraClassPoolFactoryParameters.popThreadProperties();
+ }
+ }
+ return scopedDomain;
+ }
+
+ public Domain getDomain(ClassLoader classLoader, AspectManager parent)
+ {
+ //Check the stored domains
+ Domain domain = registry.getRegisteredDomain(classLoader);
+ if (domain != null)
+ {
+ return domain;
+ }
+
+ return null;
+ }
+
+ public Domain getTopLevelDomain(AspectManager parent)
+ {
+ Thread.currentThread().getContextClassLoader();
+ return null;
+ }
+}
+
\ No newline at end of file
Added: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSIntegrationStrategy.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSIntegrationStrategy.java (rev 0)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/VFSIntegrationStrategy.java 2007-10-30 16:24:09 UTC (rev 66575)
@@ -0,0 +1,71 @@
+/*
+* 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.asintegration.jboss5;
+
+import java.io.File;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.classloader.spi.ClassLoaderSystem;
+
+import javassist.scopedpool.ScopedClassPoolFactory;
+
+/**
+ * Takes care of the specifics in JBoss 5 when the RepositoryClassLoaders are used.
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSIntegrationStrategy implements IntegrationStrategy
+{
+ DefaultTranslator translator;
+
+ public VFSIntegrationStrategy(AspectManager manager)
+ {
+ this.translator = new DefaultTranslator(manager);
+ }
+
+ public void start()
+ {
+ ClassLoaderSystem.getInstance().setTranslator(translator);
+ }
+
+ public void stop()
+ {
+ ClassLoaderSystem.getInstance().setTranslator(null);
+ }
+
+ public ScopedClassPoolFactory createScopedClassPoolFactory(File tmpDir) throws Exception
+ {
+ return new JBoss5ClassPoolFactory();
+ }
+
+ public void attachDeprecatedTranslator()
+ {
+ translator.setTranslate(true);
+ }
+
+ public void detachDeprecatedTranslator()
+ {
+ translator.setTranslate(false);
+ }
+
+}
Modified: trunk/build/build-distr.xml
===================================================================
--- trunk/build/build-distr.xml 2007-10-30 16:21:10 UTC (rev 66574)
+++ trunk/build/build-distr.xml 2007-10-30 16:24:09 UTC (rev 66575)
@@ -213,12 +213,36 @@
<unjar src="${_module.output}/lib/${aop.deployer}" dest="${install.server}/all/deployers/${aop.deployer}"/>
<mkdir dir="${install.lib}"/>
+ <!-- FIXME Temporary until after JBoss AOP 2.0.0.beta2
+ Should use the jboss.aop.lib version
<copy todir="${install.lib}" filtering="no">
<fileset dir="${jboss.aop.lib}">
<include name="jboss-aop-deployer-jdk50.jar"/>
</fileset>
</copy>
+ -->
+ <copy todir="${install.lib}" filtering="no">
+ <fileset dir="${_module.output}/lib">
+ <include name="jboss-aop-deployer-jdk50.jar"/>
+ </fileset>
+ </copy>
+ <!-- FIXME Temporary until after JBoss AOP 2.0.0.beta2
+ Should use the jboss.aop.lib versions
+ -->
+ <copy todir="${install.lib}" filtering="no">
+ <fileset dir="${_module.output}/lib">
+ <include name="jboss-aop-jboss4-jdk50.jar"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${install.lib}" filtering="no">
+ <fileset dir="${_module.output}/lib">
+ <include name="jboss-aop-jboss5.jar"/>
+ </fileset>
+ </copy>
+
+
<!-- Copy across client jars -->
<mkdir dir="${install.client}"/>
<copy todir="${install.client}" filtering="no">
Modified: trunk/server/src/etc/conf/default/bootstrap-beans.xml
===================================================================
--- trunk/server/src/etc/conf/default/bootstrap-beans.xml 2007-10-30 16:21:10 UTC (rev 66574)
+++ trunk/server/src/etc/conf/default/bootstrap-beans.xml 2007-10-30 16:24:09 UTC (rev 66575)
@@ -6,63 +6,66 @@
$Id:$
-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <!-- All beans use the bootstrap classloader -->
- <classloader><inject bean="BootstrapClassLoader"/></classloader>
-
- <!-- TODO Should split this file up and use the new classloader -->
- <bean name="BootstrapClassLoader" class="org.jboss.system.NoAnnotationURLClassLoader">
- <classloader><null/></classloader>
- <constructor factoryClass="org.jboss.system.NoAnnotationURLClassLoader" factoryMethod="createClassLoader">
- <parameter>
- <array elementClass="java.net.URL">
- <!-- VFS -->
- <value>${jboss.lib.url}/jboss-vfs.jar</value>
- <!-- ClassLoader -->
- <value>${jboss.lib.url}/jboss-classloading-spi.jar</value>
- <value>${jboss.lib.url}/jboss-classloader.jar</value>
- <!-- Deployers -->
- <value>${jboss.lib.url}/jboss-metatype.jar</value>
- <value>${jboss.lib.url}/jboss-managed.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-core-spi.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-core.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-client-spi.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-client.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-structure-spi.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-spi.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-impl.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-vfs-spi.jar</value>
- <value>${jboss.lib.url}/jboss-deployers-vfs.jar</value>
- <!-- System -->
- <value>${jboss.lib.url}/jboss-system.jar</value>
- <!-- JMX -->
- <value>${jboss.lib.url}/jboss-j2se.jar</value>
- <value>${jboss.lib.url}/jboss-mbeans.jar</value>
- <value>${jboss.lib.url}/jboss-jmx.jar</value>
- <value>${jboss.lib.url}/jboss-system-jmx.jar</value>
- <value>${jboss.lib.url}/dom4j.jar</value>
- <!-- AOP -->
- <value>${jboss.lib.url}/jboss-aop-jdk50.jar</value>
- <value>${jboss.lib.url}/jboss-aop-deployer-jdk50.jar</value>
- <value>${jboss.lib.url}/jboss-aop-mc-int.jar</value>
- <value>${jboss.lib.url}/trove.jar</value>
- <!-- JAXB - shouldn't this be in endorsed? -->
- <value>${jboss.lib.url}/jaxb-api.jar</value>
- <value>${jboss.lib.url}/jaxb-impl.jar</value>
- <value>${jboss.lib.url}/stax-api.jar</value>
- <value>${jboss.lib.url}/activation.jar</value>
- </array>
- </parameter>
- </constructor>
- </bean>
-
- <!-- FIXME REMOVE THIS -->
- <bean name="AOPMCFIX" class="org.jboss.aop.deployers.temp.Hack">
- <constructor>
- <parameter><inject bean="jboss.kernel:service=Kernel"/></parameter>
- </constructor>
- </bean>
+ <!-- All beans use the bootstrap classloader -->
+ <classloader><inject bean="BootstrapClassLoader"/></classloader>
+
+ <!-- TODO Should split this file up and use the new classloader -->
+ <bean name="BootstrapClassLoader" class="org.jboss.system.NoAnnotationURLClassLoader">
+ <classloader><null/></classloader>
+ <constructor factoryClass="org.jboss.system.NoAnnotationURLClassLoader" factoryMethod="createClassLoader">
+ <parameter>
+ <array elementClass="java.net.URL">
+ <!-- VFS -->
+ <value>${jboss.lib.url}/jboss-vfs.jar</value>
+ <!-- ClassLoader -->
+ <value>${jboss.lib.url}/jboss-classloading-spi.jar</value>
+ <value>${jboss.lib.url}/jboss-classloader.jar</value>
+ <!-- Deployers -->
+ <value>${jboss.lib.url}/jboss-metatype.jar</value>
+ <value>${jboss.lib.url}/jboss-managed.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-core-spi.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-core.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-client-spi.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-client.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-structure-spi.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-spi.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-impl.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-vfs-spi.jar</value>
+ <value>${jboss.lib.url}/jboss-deployers-vfs.jar</value>
+ <!-- System -->
+ <value>${jboss.lib.url}/jboss-system.jar</value>
+ <!-- JMX -->
+ <value>${jboss.lib.url}/jboss-j2se.jar</value>
+ <value>${jboss.lib.url}/jboss-mbeans.jar</value>
+ <value>${jboss.lib.url}/jboss-jmx.jar</value>
+ <value>${jboss.lib.url}/jboss-system-jmx.jar</value>
+ <value>${jboss.lib.url}/dom4j.jar</value>
+ <!-- AOP -->
+ <value>${jboss.lib.url}/jboss-aop-jdk50.jar</value>
+ <value>${jboss.lib.url}/jboss-aop-deployer-jdk50.jar</value>
+ <value>${jboss.lib.url}/jboss-aop-mc-int.jar</value>
+ <!-- Kill once we use the new classloaders -->
+ <value>${jboss.lib.url}/jboss-aop-jboss4-jdk50.jar</value>
+ <value>${jboss.lib.url}/jboss-aop-jboss5.jar</value>
+ <value>${jboss.lib.url}/trove.jar</value>
+ <!-- JAXB - shouldn't this be in endorsed? -->
+ <value>${jboss.lib.url}/jaxb-api.jar</value>
+ <value>${jboss.lib.url}/jaxb-impl.jar</value>
+ <value>${jboss.lib.url}/stax-api.jar</value>
+ <value>${jboss.lib.url}/activation.jar</value>
+ </array>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <!-- FIXME REMOVE THIS -->
+ <bean name="AOPMCFIX" class="org.jboss.aop.deployers.temp.Hack">
+ <constructor>
+ <parameter><inject bean="jboss.kernel:service=Kernel"/></parameter>
+ </constructor>
+ </bean>
+
<!-- The basic profile service which relies on vfs scanners
to determine the profile deployments. This version does not
support the full ProfileService spi.
@@ -73,18 +76,28 @@
</constructor>
<property name="profileRoot">${jboss.server.home.dir}</property>
</bean>
-
- <bean name="ProfileServiceBootstrap" class="org.jboss.system.server.profileservice.ProfileServiceBootstrap">
+
+ <bean name="ProfileServiceBootstrap" class="org.jboss.system.server.profileservice.ProfileServiceBootstrap">
<property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
- </bean>
+ </bean>
<!-- The legacy JMX kernel -->
<bean name="JMXKernel" class="org.jboss.system.server.jmx.JMXKernel">
<property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
- <property name="serverImpl"><inject bean="JBossServer"/></property>
+ <property name="serverImpl"><inject bean="JBossServer"/></property>
<property name="oldClassLoader">true</property>
</bean>
+
+ <!-- Repository classloader -->
+ <bean name="AOPClassLoaderScopingPolicy" class="org.jboss.aop.asintegration.jboss4.RepositoryClassLoaderScopingPolicy"/>
+ <!-- VFS ClassLoader -->
+ <!-- bean name="AOPClassLoaderScopingPolicy" class="org.jboss.aop.asintegration.jboss5.VFSClassLoaderScopingPolicy"/-->
+
+ <!-- Integration -->
+ <bean name="AOPJBossIntegration" class="org.jboss.aop.asintegration.jboss5.JBoss5Integration">
+ <property name="scopingPolicy"><inject bean="AOPClassLoaderScopingPolicy"/></property>
+ </bean>
<!--
Valid values for the AspectManager bean for use with enableTransformer=true are:
* org.jboss.aop.deployers.AspectManagerJDK5 - works with the -javaagent:pluggable-instrumentor.jar switch
@@ -106,6 +119,8 @@
</parameter>
</constructor>
+ <property name="jbossIntegration"><inject bean="AOPJBossIntegration"/></property>
+
<property name="enableLoadtimeWeaving">false</property>
<!-- only relevant when EnableLoadtimeWeaving is true.
When transformer is on, every loaded class gets
@@ -135,10 +150,10 @@
<property name="deployers"><inject bean="Deployers"/></property>
<property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
</bean>
-
+
<!-- The ManagedDeploymentCreator implementation -->
<bean name="ManagedDeploymentCreator" class="org.jboss.deployers.plugins.managed.DefaultManagedDeploymentCreator" />
-
+
<!-- The holder for deployers that determine structure -->
<bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
<property name="structureBuilder">
@@ -149,7 +164,7 @@
<incallback method="addDeployer"/>
<uncallback method="removeDeployer"/>
</bean>
-
+
<!-- The holder for deployers that do real deployment -->
<bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
<constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
More information about the jboss-cvs-commits
mailing list