[jboss-cvs] JBossAS SVN: r91983 - in projects/aop/branches/classpool_JBAOP-742/asintegration-core/src: test/java/org/jboss/test/aop/classpool and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Aug 4 17:33:28 EDT 2009
Author: flavia.rainone at jboss.com
Date: 2009-08-04 17:33:28 -0400 (Tue, 04 Aug 2009)
New Revision: 91983
Removed:
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractClassPoolDomain.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractIsLocalResourcePlugin.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractJBossClassPoolFactory.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractJBossDelegatingClassPoolFactory.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractParentDelegationStrategy.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/BaseClassPool.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/BaseClassPoolDomain.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolDomain.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolDomainRegistry.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolToClassPoolDomainAdapter.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolToClassPoolDomainAdaptorFactory.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassLoaderIsLocalResourcePlugin.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassLoaderIsLocalResourcePluginFactory.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassPoolToClassPoolDomainAdaptorFactory.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultParentDelegationStrategy.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DelegatingClassPool.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePlugin.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePluginFactory.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePluginFactoryRegistry.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/NonDelegatingClassPool.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ParentDelegationStrategy.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/SecurityActions.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TempJBossClassPool.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TempJBossDelegatingClassPool.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TranslatableClassLoaderIsLocalResourcePlugin.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TranslatableClassLoaderIsLocalResourcePluginFactory.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/URLClassLoaderIsLocalResourcePlugin.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/URLClassLoaderIsLocalResourcePluginFactory.java
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/test/java/org/jboss/test/aop/classpool/support/a/
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/test/java/org/jboss/test/aop/classpool/support/b/
projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/test/java/org/jboss/test/aop/classpool/test/
Log:
[JBAOP-742] Removed classes from asintegration-core that have been moved to the jboss-classpool project.
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractClassPoolDomain.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractClassPoolDomain.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractClassPoolDomain.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -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.classpool;
-
-import org.jboss.logging.Logger;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.NotFoundException;
-
-
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractClassPoolDomain implements ClassPoolDomain
-{
- protected final Logger logger = Logger.getLogger(this.getClass());
-
- abstract CtClass getCachedOrCreate(DelegatingClassPool initiatingPool, String classname, boolean create);
-
- abstract CtClass getCachedOrCreate(DelegatingClassPool initiatingPool, String classname, String resourceName, boolean create, boolean trace);
-
- abstract CtClass getCachedOrCreateFromParent(DelegatingClassPool initiatingPool, String classname, String resourceName, boolean create, boolean trace);
-
- abstract void addClassPool(DelegatingClassPool pool);
-
- abstract void removeClassPool(DelegatingClassPool pool);
-
-
- protected CtClass getCachedOrCreateFromPoolParent(BaseClassPool initiatingPool, String classname, boolean create, boolean trace)
- {
- if (initiatingPool == null)
- {
- if (trace) logger.trace(this + " get cached or create " + classname + " from pool parent - no initiating pool");
- return null;
- }
- ClassPool parentPool = initiatingPool.getParent();
- if (parentPool == null)
- {
- if (trace) logger.trace(this + " get cached or create " + classname + " from pool parent - no parent pool");
- return null;
- }
-
- return getCachedOrCreateFromPool(parentPool, classname, create, trace);
- }
-
-
- protected CtClass getCachedOrCreateFromPool(ClassPool pool, String classname, boolean create, boolean trace)
- {
- if (pool instanceof BaseClassPool)
- {
- return getCachedOrCreateFromPool((BaseClassPool)pool, classname, create, trace);
- }
- try
- {
- //This will check the parents
- if (trace) logger.trace(this + " get cached or create " + classname + " from non-BaseClassPool pool " + pool);
- CtClass clazz = pool.get(classname);
- if (trace) logger.trace(this + " got cached or create " + classname + " from non-BaseClassPool pool " + clazz.getClassPool());
- return clazz;
- }
- catch(NotFoundException e)
- {
- return null;
- }
- }
-
- protected CtClass getCachedOrCreateFromPool(BaseClassPool pool, String classname, boolean create, boolean trace)
- {
- if (pool == null)
- {
- if (trace) logger.trace(this + " get cached or create " + classname + " from BaseClassPool - no pool");
- return null;
- }
-
- CtClass clazz = null;
- if (!pool.childFirstLookup)
- {
- if (trace) logger.trace(this + " get cached or create " + classname + " from BaseClassPool - checking parent (parentFirst)");
- clazz = getCachedOrCreateFromPoolParent(pool, classname, create, trace);
- }
-
- if (clazz == null)
- {
- //We can use the exposed methods directly to avoid the overhead of NotFoundException
- if (trace) logger.trace(this + " get cached or create " + classname + " from BaseClassPool - checking cache");
- clazz = pool.getCached(classname);
- if (clazz == null && create)
- {
- if (trace) logger.trace(this + " get cached or create " + classname + " from BaseClassPool - creating");
- clazz = pool.createCtClass(classname, true);
- }
- }
-
- if (clazz == null && pool.childFirstLookup)
- {
- if (trace) logger.trace(this + " get cached or create " + classname + " from BaseClassPool - checking parent (parentLast)");
- clazz = getCachedOrCreateFromPoolParent(pool, classname, create, trace);
- }
- return clazz;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractIsLocalResourcePlugin.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractIsLocalResourcePlugin.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractIsLocalResourcePlugin.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,77 +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.classpool;
-
-import java.net.URL;
-
-import javassist.ClassPool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractIsLocalResourcePlugin implements IsLocalResourcePlugin
-{
- private final BaseClassPool pool;
-
- public AbstractIsLocalResourcePlugin(BaseClassPool pool)
- {
- this.pool = pool;
- initialise();
- }
-
- protected void initialise()
- {
-
- }
-
- protected AOPClassPool getPool()
- {
- return pool;
- }
-
- /**
- * Checks if the resource can be found in the parent classpool's loader
- * and returns true if it either does not exist in the parent or if
- * the parent has a different URL for the resource
- */
- protected boolean isSameInParent(String classResourceName, URL foundURL)
- {
- ClassPool parent = pool.getParent();
- if (parent != null)
- {
- ClassLoader parentLoader = parent.getClassLoader();
- URL parentURL = parentLoader.getResource(classResourceName);
- if (parentURL == null)
- {
- return false;
- }
- if (parentURL.equals(foundURL))
- {
- return true;
- }
- }
-
- return false;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractJBossClassPoolFactory.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractJBossClassPoolFactory.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractJBossClassPoolFactory.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,62 +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.classpool;
-
-import org.jboss.logging.Logger;
-
-import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPool;
-import javassist.scopedpool.ScopedClassPoolFactory;
-import javassist.scopedpool.ScopedClassPoolRepository;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractJBossClassPoolFactory implements ScopedClassPoolFactory
-{
- protected final Logger log = Logger.getLogger(this.getClass().getName());
-
- protected ClassPool getCreateParentClassPools(final ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
- {
- //Make sure that we get classpools for all the parent classloaders
- if (cl == null)
- {
- return ClassPool.getDefault();
- }
- ClassLoader parent = SecurityActions.getParent(cl);
-
- if (parent != null)
- {
- return repository.registerClassLoader(parent);
- }
- return src;
- }
-
- public ScopedClassPool create(ClassPool src, ScopedClassPoolRepository repository)
- {
- return new TempJBossClassPool(src, repository);
- }
-
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractJBossDelegatingClassPoolFactory.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractJBossDelegatingClassPoolFactory.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractJBossDelegatingClassPoolFactory.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,39 +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.classpool;
-
-import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPool;
-import javassist.scopedpool.ScopedClassPoolRepository;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractJBossDelegatingClassPoolFactory extends AbstractJBossClassPoolFactory
-{
- public ScopedClassPool create(ClassPool src, ScopedClassPoolRepository repository)
- {
- return new TempJBossDelegatingClassPool(src, repository);
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractParentDelegationStrategy.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractParentDelegationStrategy.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/AbstractParentDelegationStrategy.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -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.classpool;
-
-import javassist.CtClass;
-
-import org.jboss.logging.Logger;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractParentDelegationStrategy implements ParentDelegationStrategy
-{
- protected final Logger logger = Logger.getLogger(this.getClass().getName());
- private AbstractClassPoolDomain domain;
- private AbstractClassPoolDomain parent;
-
- protected AbstractParentDelegationStrategy(ClassPoolDomain parent, ClassPoolToClassPoolDomainAdaptorFactory adaptorFactory)
- {
- if (parent == null)
- {
- if (adaptorFactory == null)
- {
- throw new IllegalStateException("Null parent and null adaptorFactory");
- }
- this.parent = adaptorFactory.createAdaptor();
- }
- else
- {
- if (parent instanceof AbstractClassPoolDomain == false)
- {
- throw new IllegalArgumentException("Parent must implement AbstractClassPoolDomain");
- }
- this.parent = (AbstractClassPoolDomain)parent;
- }
-
- if (this.parent == null)
- {
- throw new IllegalStateException("Parent was not set");
- }
- }
-
- protected boolean hasParent()
- {
- if (logger.isTraceEnabled()) logger.trace(this + " " + getDomain() + " hasParent " + parent != null);
- return parent != null;
- }
-
- protected AbstractClassPoolDomain getDomain()
- {
- return domain;
- }
-
- public CtClass getCachedOrCreateFromParent(DelegatingClassPool initiatingPool, String classname, String resourceName, boolean create, boolean trace)
- {
- return parent.getCachedOrCreate(initiatingPool, classname, resourceName, create, trace);
- }
-
- public void setDomain(AbstractClassPoolDomain domain)
- {
- if (domain == null)
- {
- throw new IllegalArgumentException("Null domain");
- }
- if (this.domain != null)
- {
- throw new IllegalArgumentException("Cannot change domain");
- }
- this.domain = domain;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/BaseClassPool.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/BaseClassPool.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/BaseClassPool.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,144 +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.classpool;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.NotFoundException;
-import javassist.scopedpool.ScopedClassPoolRepository;
-
-/**
- * Intermediate class containing commonly needed functionality for the new classpools. I don't want to
- * modify AOPClassPool too much
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BaseClassPool extends AOPClassPool
-{
- private IsLocalResourcePlugin isLocalResourcePlugin;
-
- public BaseClassPool(ClassLoader cl, ClassPool parent, ScopedClassPoolRepository repository)
- {
- super(cl, parent, repository);
- isLocalResourcePlugin = IsLocalResourcePluginFactoryRegistry.getPluginFactory(cl).create(this);
- if (logger.isTraceEnabled()) logger.trace(this + " isLocalResourcePlugin:" + isLocalResourcePlugin);
- }
-
- public BaseClassPool(ClassLoader cl, ClassPool parent, ScopedClassPoolRepository repository, Class<? extends AOPCLassPoolSearchStrategy> searchStrategy)
- {
- super(cl, parent, repository, searchStrategy);
- isLocalResourcePlugin = IsLocalResourcePluginFactoryRegistry.getPluginFactory(cl).create(this);
- if (logger.isTraceEnabled()) logger.trace(this + " isLocalResourcePlugin:" + isLocalResourcePlugin);
- }
-
- @Override
- public CtClass createCtClass(String classname, boolean useCache)
- {
- CtClass clazz = super.createCtClass(classname, useCache);
- if (clazz != null)
- {
- lockInCache(clazz);
- }
- return clazz;
- }
-
- protected CtClass createParentCtClass(String classname, boolean useCache, boolean trace)
- {
- if (parent == null)
- {
- return null;
- }
-
- //Make parent create class
- if (parent instanceof BaseClassPool)
- {
- return ((AOPClassPool)parent).createCtClass(classname, useCache);
- }
- else
- {
- return plainParentGet(classname);
- }
- }
-
- private CtClass plainParentGet(String classname)
- {
- try
- {
- return parent.get(classname);
- }
- catch (NotFoundException e)
- {
- }
- return null;
- }
-
- public ClassPool getParent()
- {
- return parent;
- }
-
- @Override
- protected boolean isLocalClassLoaderResource(String classResourceName)
- {
- return isLocalResourcePlugin.isMyResource(classResourceName);
- }
-
- @Override
- public final CtClass get(String classname) throws NotFoundException
- {
- boolean trace = logger.isTraceEnabled();
- if (trace) logger.trace(this + " initiating get of " + classname);
-
- try
- {
- CtClass clazz = super.get(classname);
- if (trace)
- {
- logger.trace(this + " completed get of " + classname + " " + getClassPoolLogStringForClass(clazz));
- }
- return clazz;
- }
- catch (NotFoundException e)
- {
- // AutoGenerated
- NotFoundException wrapped = new NotFoundException(e.getMessage() + " could not be found from " + this);
- wrapped.setStackTrace(e.getStackTrace());
- throw wrapped;
- }
- }
-
- @Override
- public CtClass get0(String classname, boolean useCache) throws NotFoundException
- {
- return super.get0(classname, useCache);
- }
-
- @Override
- public void close()
- {
- super.close();
-
- if (logger.isTraceEnabled()) logger.trace(this + " closing");
- }
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/BaseClassPoolDomain.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/BaseClassPoolDomain.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/BaseClassPoolDomain.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,154 +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.classpool;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javassist.CtClass;
-
-import org.jboss.aop.util.ClassLoaderUtils;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BaseClassPoolDomain extends AbstractClassPoolDomain
-{
- private String domainName;
-
- private List<DelegatingClassPool> delegatingPools = new ArrayList<DelegatingClassPool>();
-
- private ParentDelegationStrategy parentDelegationStrategy;
-
- public BaseClassPoolDomain(String domainName, ClassPoolDomain parent, boolean parentFirst)
- {
- this(domainName,
- new DefaultParentDelegationStrategy(
- parent,
- parentFirst,
- DefaultClassPoolToClassPoolDomainAdaptorFactory.getInstance())
- );
- }
-
- protected BaseClassPoolDomain(String domainName, ParentDelegationStrategy parentDelegationStrategy)
- {
- this.domainName = domainName;
- this.parentDelegationStrategy = parentDelegationStrategy;
- parentDelegationStrategy.setDomain(this);
- if (logger.isTraceEnabled()) logger.trace("Created " + this + " parentDelegationStrategy:" + parentDelegationStrategy);
- }
-
- @Override
- synchronized void addClassPool(DelegatingClassPool pool)
- {
- if (!delegatingPools.contains(pool))
- {
- if (logger.isTraceEnabled()) logger.trace(this + " adding pool " + pool);
- delegatingPools.add(pool);
- }
- }
-
- @Override
- protected synchronized void removeClassPool(DelegatingClassPool pool)
- {
- if (logger.isTraceEnabled()) logger.trace(this + " removing pool " + pool);
- delegatingPools.remove(pool);
- }
-
- @Override
- synchronized CtClass getCachedOrCreate(DelegatingClassPool initiatingPool, String classname, boolean create)
- {
- boolean trace = logger.isTraceEnabled();
- String resourceName = ClassLoaderUtils.getResourceName(classname);
-
- CtClass clazz = getCachedOrCreate(initiatingPool, classname, resourceName, create, trace);
-
- if (clazz == null)
- {
- clazz = getCachedOrCreateFromPoolParent(initiatingPool, classname, create, trace);
- }
- return clazz;
- }
-
- @Override
- protected CtClass getCachedOrCreate(DelegatingClassPool initiatingPool, String classname, String resourceName, boolean create, boolean trace)
- {
- if (trace) logger.trace(this + " looking for " + classname);
-
- CtClass clazz = null;
- if (isParentBefore(classname))
- {
- if (trace) logger.trace(this + " checking parent first for " + classname);
- clazz = getCachedOrCreateFromParent(initiatingPool, classname, resourceName, create, trace);
- }
- if (clazz == null)
- {
- List<DelegatingClassPool> pools = getPoolsForClassName(classname);
- if (pools.size() > 0)
- {
- for (DelegatingClassPool pool : pools)
- {
- clazz = pool.loadLocally(classname, resourceName, create);
- if (clazz != null)
- {
- break;
- }
- }
- }
- }
- if (clazz == null && isParentAfter(classname))
- {
- if (trace) logger.trace(this + " checking parent last for " + classname);
- clazz = getCachedOrCreateFromParent(initiatingPool, classname, resourceName, create, trace);
- }
- if (trace) logger.trace(this + " found " + classname + " in " + (clazz == null ? "null" : clazz.getClassPool()));
- return clazz;
- }
-
- @Override
- protected CtClass getCachedOrCreateFromParent(DelegatingClassPool initiatingPool, String classname, String resourceName, boolean create, boolean trace)
- {
- return parentDelegationStrategy.getCachedOrCreateFromParent(initiatingPool, classname, resourceName, create, trace);
- }
-
- public String toString()
- {
- return "[" + super.toString() + " name:" + domainName + "]";
- }
-
- protected boolean isParentBefore(String classname)
- {
- return parentDelegationStrategy.isParentBefore(classname);
- }
-
- protected boolean isParentAfter(String classname)
- {
- return parentDelegationStrategy.isParentAfter(classname);
- }
-
- protected List<DelegatingClassPool> getPoolsForClassName(String classname)
- {
- return delegatingPools;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolDomain.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolDomain.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolDomain.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,31 +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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public interface ClassPoolDomain
-{
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolDomainRegistry.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolDomainRegistry.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolDomainRegistry.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,59 +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.classpool;
-
-import java.lang.ref.WeakReference;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class ClassPoolDomainRegistry
-{
- final static ClassPoolDomainRegistry INSTANCE = new ClassPoolDomainRegistry();
-
- final Map<Object, WeakReference<ClassPoolDomain>> domains = new WeakHashMap<Object, WeakReference<ClassPoolDomain>>();
-
- public static ClassPoolDomainRegistry getInstance()
- {
- return INSTANCE;
- }
-
- public synchronized ClassPoolDomain getDomain(Object key)
- {
- WeakReference<ClassPoolDomain> ref = domains.get(key);
- if (ref == null)
- {
- return null;
- }
- return ref.get();
- }
-
- public synchronized void addClassPoolDomain(Object key, ClassPoolDomain domain)
- {
- domains.put(key, new WeakReference<ClassPoolDomain>(domain));
- }
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolToClassPoolDomainAdapter.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolToClassPoolDomainAdapter.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolToClassPoolDomainAdapter.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,96 +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.classpool;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class ClassPoolToClassPoolDomainAdapter extends AbstractClassPoolDomain
-{
- protected ClassPool pool;
-
- public ClassPoolToClassPoolDomainAdapter()
- {
- this.pool = initialiseParentClassLoader();
- if (logger.isTraceEnabled()) logger.trace("Created " + this);
- validate();
- }
-
- public ClassPoolToClassPoolDomainAdapter(ClassPool pool)
- {
- this.pool = pool;
- if (logger.isTraceEnabled()) logger.trace("Created " + this);
- validate();
- }
-
- private void validate()
- {
- if (pool == null)
- {
- throw new IllegalStateException("Null parent classpool");
- }
- }
-
- public ClassPool initialiseParentClassLoader()
- {
- return ClassPool.getDefault();
- }
-
- public void addClassPool(DelegatingClassPool pool)
- {
- throw new IllegalStateException("Cannot add pools to the domain adaptor");
- }
-
-
- synchronized CtClass getCachedOrCreate(DelegatingClassPool initiatingPool, String classname, String resourceName, boolean create, boolean trace)
- {
- return getCachedOrCreateFromPool(pool, classname, create, trace);
- }
-
- @Override
- CtClass getCachedOrCreateFromParent(DelegatingClassPool initiatingPool, String classname, String resourceName, boolean create, boolean trace)
- {
- return null;
- }
-
- void removeClassPool(DelegatingClassPool pool)
- {
- throw new IllegalStateException("Cannot remove pools from the domain adaptor");
- }
-
- public String toString()
- {
- return "ClassPoolToDomainAdapter[" + System.identityHashCode(this) + " " + pool.toString() + "]";
- }
-
- @Override
- CtClass getCachedOrCreate(DelegatingClassPool initiatingPool, String classname, boolean create)
- {
- throw new IllegalStateException("Should never be called");
- }
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolToClassPoolDomainAdaptorFactory.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolToClassPoolDomainAdaptorFactory.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ClassPoolToClassPoolDomainAdaptorFactory.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public interface ClassPoolToClassPoolDomainAdaptorFactory
-{
- ClassPoolToClassPoolDomainAdapter createAdaptor();
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassLoaderIsLocalResourcePlugin.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassLoaderIsLocalResourcePlugin.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassLoaderIsLocalResourcePlugin.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,42 +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.classpool;
-
-/**
- *
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class DefaultClassLoaderIsLocalResourcePlugin extends AbstractIsLocalResourcePlugin implements IsLocalResourcePlugin
-{
- public DefaultClassLoaderIsLocalResourcePlugin(BaseClassPool pool)
- {
- super(pool);
- }
-
- public boolean isMyResource(String resourceName)
- {
- return getPool().getClassLoader().getResource(resourceName) != null;
- }
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassLoaderIsLocalResourcePluginFactory.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassLoaderIsLocalResourcePluginFactory.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassLoaderIsLocalResourcePluginFactory.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,37 +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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class DefaultClassLoaderIsLocalResourcePluginFactory implements IsLocalResourcePluginFactory
-{
-
- public IsLocalResourcePlugin create(BaseClassPool pool)
- {
- return new DefaultClassLoaderIsLocalResourcePlugin(pool);
- }
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassPoolToClassPoolDomainAdaptorFactory.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassPoolToClassPoolDomainAdaptorFactory.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultClassPoolToClassPoolDomainAdaptorFactory.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,48 +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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class DefaultClassPoolToClassPoolDomainAdaptorFactory implements ClassPoolToClassPoolDomainAdaptorFactory
-{
- private static final DefaultClassPoolToClassPoolDomainAdaptorFactory INSTANCE = new DefaultClassPoolToClassPoolDomainAdaptorFactory();
-
- private DefaultClassPoolToClassPoolDomainAdaptorFactory()
- {
-
- }
-
- public static ClassPoolToClassPoolDomainAdaptorFactory getInstance()
- {
- return INSTANCE;
- }
-
- public ClassPoolToClassPoolDomainAdapter createAdaptor()
- {
- return new ClassPoolToClassPoolDomainAdapter();
- }
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultParentDelegationStrategy.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultParentDelegationStrategy.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DefaultParentDelegationStrategy.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,51 +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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-class DefaultParentDelegationStrategy extends AbstractParentDelegationStrategy
-{
- boolean parentFirst;
- DefaultParentDelegationStrategy(ClassPoolDomain parent, boolean parentFirst, ClassPoolToClassPoolDomainAdaptorFactory adaptorFactory)
- {
- super(parent, adaptorFactory);
- this.parentFirst = parentFirst;
- }
-
- public boolean isParentBefore(String classname)
- {
- boolean isParentBefore = hasParent() && parentFirst == true;
- if (logger.isTraceEnabled()) logger.trace(this + " " + getDomain() + " isParentBefore " + isParentBefore);
- return isParentBefore;
- }
-
- public boolean isParentAfter(String classname)
- {
- boolean isParentAfter = hasParent() && parentFirst == false;
- if (logger.isTraceEnabled()) logger.trace(this + " " + getDomain() + " isParentAfter " + isParentAfter);
- return isParentAfter;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DelegatingClassPool.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DelegatingClassPool.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/DelegatingClassPool.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,131 +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.classpool;
-
-import org.jboss.aop.util.ClassLoaderUtils;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.NotFoundException;
-import javassist.scopedpool.ScopedClassPoolRepository;
-
-/**
- * Base class for classpools backed by a domain
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class DelegatingClassPool extends BaseClassPool
-{
- private final AbstractClassPoolDomain domain;
-
- private boolean closed;
-
- public DelegatingClassPool(ClassPoolDomain domain, ClassLoader cl, ClassPool parent, ScopedClassPoolRepository repository)
- {
- super(cl, parent, repository);
- if (domain == null)
- {
- throw new IllegalArgumentException("Domain was null");
- }
- if (domain instanceof AbstractClassPoolDomain == false)
- {
- throw new IllegalArgumentException("Domain must implement AbstractClassPoolDomain");
- }
- this.domain = (AbstractClassPoolDomain)domain;
- if (logger.isTraceEnabled()) logger.trace(this + " domain:" + this);
- this.domain.addClassPool(this);
- }
-
- public CtClass loadLocally(String classname, String resourceName, boolean create)
- {
- boolean trace = logger.isTraceEnabled();
- if (trace) logger.trace(this + " attempt to load locally " + classname);
-
- CtClass clazz = null;
- if (isLocalResource(resourceName, trace))
- {
- clazz = getCachedLocally(classname);
- if (clazz == null && create)
- {
- clazz = createCtClass(classname, true);
- }
- }
- if (trace) logger.trace(this + " loaded locally " + classname + " " + getClassPoolLogStringForClass(clazz));
- return clazz;
- }
-
- /**
- * Overrides ClassPool.get0() so that we can look up classes without caching them in the initiating pool.
- * The DelgatingClassPool + DomainClassPool handle the caching in the correct pool + handles the
- * parentFirst functionality
- */
- @Override
- public synchronized CtClass get0(String classname, boolean useCache) throws NotFoundException
- {
- if (isGeneratedClass(classname))
- {
- return null;
- }
- CtClass clazz = domain.getCachedOrCreate(this, classname, true);
- if (clazz == null)
- {
- //It is probably a generated proxy. The package name can be different (for example if it is
- //a proxy for a java system class) than the package names exported by the loaders.
- //TODO It should be possible to remove this once these have been done:
- //https://jira.jboss.org/jira/browse/JBCL-25
- //https://jira.jboss.org/jira/browse/JBCL-92
- clazz = loadLocally(classname, ClassLoaderUtils.getResourceName(classname), true);
- }
- return clazz;
- }
-
- @Override
- public boolean isUnloadedClassLoader()
- {
- return closed;
- }
-
- @Override
- public void close()
- {
- closed = true;
- super.close();
- domain.removeClassPool(this);
- }
-
- @Override
- public CtClass getCached(String classname)
- {
- if (isGeneratedClass(classname))
- {
- return null;
- }
- return domain.getCachedOrCreate(this, classname, false);
- }
-
- @Override
- public String toString()
- {
- return "[" + super.toString() + " domain: " + domain + "]";
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePlugin.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePlugin.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePlugin.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public interface IsLocalResourcePlugin
-{
- boolean isMyResource(String resourceName);
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePluginFactory.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePluginFactory.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePluginFactory.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public interface IsLocalResourcePluginFactory
-{
- IsLocalResourcePlugin create(BaseClassPool pool);
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePluginFactoryRegistry.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePluginFactoryRegistry.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/IsLocalResourcePluginFactoryRegistry.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,90 +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.classpool;
-
-import java.net.URLClassLoader;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.jboss.util.loading.Translatable;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class IsLocalResourcePluginFactoryRegistry
-{
- private static Map<Class<?>, IsLocalResourcePluginFactory> plugins = new WeakHashMap<Class<?>, IsLocalResourcePluginFactory>();
-
- static
- {
- addPluginFactory(ClassLoader.class, new DefaultClassLoaderIsLocalResourcePluginFactory());
- addPluginFactory(URLClassLoader.class, new URLClassLoaderIsLocalResourcePluginFactory());
- addPluginFactory(Translatable.class, new TranslatableClassLoaderIsLocalResourcePluginFactory());
- }
-
- public static synchronized void addPluginFactory(Class<?> classLoaderClass, IsLocalResourcePluginFactory plugin)
- {
- plugins.put(classLoaderClass, plugin);
- }
-
- public static synchronized void removePluginFactory(Class<?> classLoaderClass, IsLocalResourcePluginFactory plugin)
- {
- plugins.remove(classLoaderClass);
- }
-
- public static synchronized IsLocalResourcePluginFactory getPluginFactory(ClassLoader classLoader)
- {
- if (classLoader != null)
- {
- return getPluginFactory(classLoader.getClass());
- }
- return getPluginFactory(ClassLoader.class);
- }
-
- public static synchronized IsLocalResourcePluginFactory getPluginFactory(Class<?> classLoaderClass)
- {
- IsLocalResourcePluginFactory plugin = plugins.get(classLoaderClass);
- if (plugin == null)
- {
- Class<?>[] interfaces = classLoaderClass.getInterfaces();
- if (interfaces.length > 0)
- {
- for (Class<?> iface : interfaces)
- {
- plugin = getPluginFactory(iface);
- if (plugin != null)
- {
- return plugin;
- }
- }
- }
- Class<?> superClass = classLoaderClass.getSuperclass();
- if (superClass != null && superClass != Object.class)
- {
- return getPluginFactory(superClass);
- }
- }
- return plugin;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/NonDelegatingClassPool.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/NonDelegatingClassPool.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/NonDelegatingClassPool.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,65 +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.classpool;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPoolRepository;
-
-/**
- * ClassPool for class loaders not backed by a repository/classloading domain
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class NonDelegatingClassPool extends BaseClassPool
-{
- public NonDelegatingClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository, boolean parentFirst)
- {
- super(cl, src, repository, AOPClassPool.SEARCH_LOCAL_ONLY_STRATEGY);
- super.childFirstLookup = !parentFirst;
- }
-
- @Override
- public CtClass createCtClass(String classname, boolean useCache)
- {
- boolean trace = logger.isTraceEnabled();
- CtClass clazz = null;
- if (!childFirstLookup)
- {
- if (trace)logger.trace(this + " attempting to create " + classname + " in parent pool (parentFirst)");
- clazz = createParentCtClass(classname, useCache, trace);
- }
- if (clazz == null && isLocalResource(getResourceName(classname), trace))
- {
- clazz = super.createCtClass(classname, useCache);
- }
- if (childFirstLookup && clazz == null)
- {
- if (trace)logger.trace(this + " attempting to create " + classname + " in parent pool (parentLast)");
- clazz = createParentCtClass(classname, useCache, trace);
- }
-
- if (trace)logger.trace(this + " created " + classname + " " + getClassPoolLogStringForClass(clazz));
- return clazz;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ParentDelegationStrategy.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ParentDelegationStrategy.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/ParentDelegationStrategy.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,40 +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.classpool;
-
-import javassist.CtClass;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public interface ParentDelegationStrategy
-{
- void setDomain(AbstractClassPoolDomain domain);
-
- CtClass getCachedOrCreateFromParent(DelegatingClassPool initiatingPool, String classname, String resourceName, boolean create, boolean trace);
-
- boolean isParentBefore(String classname);
-
- boolean isParentAfter(String classname);
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/SecurityActions.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/SecurityActions.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/SecurityActions.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,80 +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.classpool;
-
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-class SecurityActions
-{
- interface GetParentAction
- {
- ClassLoader getParent(ClassLoader loader);
-
- GetParentAction NON_PRIVILEGED = new GetParentAction()
- {
- public ClassLoader getParent(ClassLoader loader)
- {
- return loader.getParent();
- }
- };
-
- GetParentAction PRIVILEGED = new GetParentAction()
- {
- public ClassLoader getParent(final ClassLoader loader)
- {
- try
- {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<ClassLoader>()
- {
- public ClassLoader run() throws Exception
- {
- return loader.getParent();
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- throw new RuntimeException(e.getException());
- }
- }
- };
- }
-
- public static ClassLoader getParent(ClassLoader loader)
- {
- if (System.getSecurityManager() == null)
- {
- return GetParentAction.NON_PRIVILEGED.getParent(loader);
- }
- else
- {
- return GetParentAction.PRIVILEGED.getParent(loader);
- }
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TempJBossClassPool.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TempJBossClassPool.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TempJBossClassPool.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,70 +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.classpool;
-
-import org.jboss.aop.classpool.AOPClassPool;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPoolRepository;
-
-/**
- * The temporary classpool used by the instrumentor. It's main job is to delegate to the parent classpool
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class TempJBossClassPool extends AOPClassPool
-{
- boolean isParentPoolAOP;
- public TempJBossClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
- {
- super(cl, src, repository);
- if (src instanceof AOPClassPool)
- {
- isParentPoolAOP = true;
- }
- }
-
- public TempJBossClassPool(ClassPool src, ScopedClassPoolRepository repository)
- {
- super(src, repository);
- if (src instanceof AOPClassPool)
- {
- isParentPoolAOP = true;
- }
- }
-
- public CtClass getCached(String classname)
- {
- CtClass clazz = null;
- if (isParentPoolAOP)
- {
- clazz = ((AOPClassPool)parent).getCached(classname);
- }
- if (clazz == null)
- {
- clazz = super.getCached(classname);
- }
- return clazz;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TempJBossDelegatingClassPool.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TempJBossDelegatingClassPool.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TempJBossDelegatingClassPool.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,68 +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.classpool;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.NotFoundException;
-import javassist.scopedpool.ScopedClassPoolRepository;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class TempJBossDelegatingClassPool extends AOPClassPool
-{
- boolean isParentPoolDelegating;
- public TempJBossDelegatingClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
- {
- super(cl, src, repository);
- if (src instanceof BaseClassPool)
- {
- isParentPoolDelegating = true;
- }
- }
-
- public TempJBossDelegatingClassPool(ClassPool src, ScopedClassPoolRepository repository)
- {
- super(src, repository);
- if (src instanceof BaseClassPool)
- {
- isParentPoolDelegating = true;
- }
- }
- @Override
- public CtClass get0(String classname, boolean useCache) throws NotFoundException
- {
- CtClass clazz = null;
- if (isParentPoolDelegating)
- {
- clazz = ((BaseClassPool)parent).get0(classname, useCache);
- }
- if (clazz == null)
- {
- clazz = super.get0(classname, useCache);
- }
- return clazz;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TranslatableClassLoaderIsLocalResourcePlugin.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TranslatableClassLoaderIsLocalResourcePlugin.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TranslatableClassLoaderIsLocalResourcePlugin.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,59 +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.classpool;
-
-import java.net.URL;
-
-import org.jboss.util.loading.Translatable;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class TranslatableClassLoaderIsLocalResourcePlugin extends AbstractIsLocalResourcePlugin
-{
- public TranslatableClassLoaderIsLocalResourcePlugin(BaseClassPool pool)
- {
- super(pool);
- }
-
- public boolean isMyResource(String resourceName)
- {
- ClassLoader loader = getPool().getClassLoader();
- if (loader instanceof Translatable == false)
- {
- throw new IllegalStateException("ClassLoader is not instance of Translatable " + loader);
- }
- URL url = ((Translatable)getPool().getClassLoader()).getResourceLocally(resourceName);
- if (url == null)
- {
- return false;
- }
- if (isSameInParent(resourceName, url))
- {
- return false;
- }
- return true;
- }
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TranslatableClassLoaderIsLocalResourcePluginFactory.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TranslatableClassLoaderIsLocalResourcePluginFactory.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/TranslatableClassLoaderIsLocalResourcePluginFactory.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,36 +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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class TranslatableClassLoaderIsLocalResourcePluginFactory implements IsLocalResourcePluginFactory
-{
- public IsLocalResourcePlugin create(BaseClassPool pool)
- {
- return new TranslatableClassLoaderIsLocalResourcePlugin(pool);
- }
-
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/URLClassLoaderIsLocalResourcePlugin.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/URLClassLoaderIsLocalResourcePlugin.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/URLClassLoaderIsLocalResourcePlugin.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,54 +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.classpool;
-
-import java.net.URL;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class URLClassLoaderIsLocalResourcePlugin extends AbstractIsLocalResourcePlugin
-{
- public URLClassLoaderIsLocalResourcePlugin(BaseClassPool pool)
- {
- super(pool);
- }
-
- public boolean isMyResource(String classResourceName)
- {
- //TODO This should be moved into URLClassLoaderIsLocalResourcePlugin, and the -core tests should be updated to
- //not use the same urls
- ClassLoader myLoader = getPool().getClassLoader();
- URL myURL = myLoader.getResource(classResourceName);
- if (myURL == null)
- {
- return false;
- }
- if (isSameInParent(classResourceName, myURL))
- {
- return false;
- }
- return true;
- }
-}
Deleted: projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/URLClassLoaderIsLocalResourcePluginFactory.java
===================================================================
--- projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/URLClassLoaderIsLocalResourcePluginFactory.java 2009-08-04 21:31:27 UTC (rev 91982)
+++ projects/aop/branches/classpool_JBAOP-742/asintegration-core/src/main/java/org/jboss/aop/classpool/URLClassLoaderIsLocalResourcePluginFactory.java 2009-08-04 21:33:28 UTC (rev 91983)
@@ -1,37 +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.classpool;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class URLClassLoaderIsLocalResourcePluginFactory implements IsLocalResourcePluginFactory
-{
-
- public IsLocalResourcePlugin create(BaseClassPool pool)
- {
- return new URLClassLoaderIsLocalResourcePlugin(pool);
- }
-
-}
More information about the jboss-cvs-commits
mailing list