[jboss-cvs] JBossAS SVN: r69574 - in projects/aop/trunk/asintegration/src/main/org/jboss/aop: deployers and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Feb 4 07:39:49 EST 2008
Author: kabir.khan at jboss.com
Date: 2008-02-04 07:39:49 -0500 (Mon, 04 Feb 2008)
New Revision: 69574
Removed:
projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallback.java
projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallbackHandler.java
Modified:
projects/aop/trunk/asintegration/src/main/org/jboss/aop/asintegration/jboss4/RepositoryClassLoaderScopingPolicy.java
projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java
projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializer.java
Log:
Pass in the VFSDeploymentUnit directly to the DomainInitializer
Modified: projects/aop/trunk/asintegration/src/main/org/jboss/aop/asintegration/jboss4/RepositoryClassLoaderScopingPolicy.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/asintegration/jboss4/RepositoryClassLoaderScopingPolicy.java 2008-02-04 12:15:19 UTC (rev 69573)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/asintegration/jboss4/RepositoryClassLoaderScopingPolicy.java 2008-02-04 12:39:49 UTC (rev 69574)
@@ -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/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java 2008-02-04 12:15:19 UTC (rev 69573)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployer.java 2008-02-04 12:39:49 UTC (rev 69574)
@@ -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/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializer.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializer.java 2008-02-04 12:15:19 UTC (rev 69573)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializer.java 2008-02-04 12:39:49 UTC (rev 69574)
@@ -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/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallback.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallback.java 2008-02-04 12:15:19 UTC (rev 69573)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallback.java 2008-02-04 12:39:49 UTC (rev 69574)
@@ -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/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallbackHandler.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallbackHandler.java 2008-02-04 12:15:19 UTC (rev 69573)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/domain/DomainInitializerCallbackHandler.java 2008-02-04 12:39:49 UTC (rev 69574)
@@ -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);
-}
More information about the jboss-cvs-commits
mailing list