[jboss-cvs] JBossAS SVN: r101497 - in projects/jboss-classpool/trunk: classpool/src/main/java/org/jboss/classpool/plugins and 9 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 25 18:17:08 EST 2010
Author: flavia.rainone at jboss.com
Date: 2010-02-25 18:17:05 -0500 (Thu, 25 Feb 2010)
New Revision: 101497
Modified:
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/base/BaseClassPool.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/AbstractJBossClassPoolFactory.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/DelegatingClassPool.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/NonDelegatingClassPool.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempClassPoolFactory.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempJBossClassPool.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempJBossDelegatingClassPool.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/AbstractClassPool.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/AbstractClassPoolFactory.java
projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/ClassPoolRepository.java
projects/jboss-classpool/trunk/classpool/src/test/java/org/jboss/test/classpool/support/ClassFactory.java
projects/jboss-classpool/trunk/classpool/src/test/java/org/jboss/test/classpool/support/ClassPoolTestScenario.java
projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBoss5ClassPool.java
projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBoss5ClassPoolFactory.java
projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClClassPoolDomain.java
projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClClassPoolToClassPoolDomainAdapter.java
projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPool.java
projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPoolFactory.java
projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPoolRepository.java
projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/ScopedJBoss5ClassPool.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ArchiveClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/CtClassCreationTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/HierarchicalDomainClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/HierarchicalParentLoaderClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/JBossClClassPoolTest.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ModuleDependencyClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/PackageDependencyClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReExportModuleClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReExportPackageClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReplaceReferencesClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/RepositoryClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/UsesPackageClassPoolTestCase.java
projects/jboss-classpool/trunk/jbosscl/src/test/resources/org/jboss/test/classpool/jbosscl/Common.xml
projects/jboss-classpool/trunk/scopedpool/src/main/java/org/jboss/classpool/scoped/ScopedClassPoolRepositoryImpl.java
projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/JBossClassPool.java
projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/JBossClassPoolFactory.java
projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/ScopedJBossClassPool.java
projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/UclDelegatingClassPool.java
projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/UclDelegatingClassPoolFactory.java
projects/jboss-classpool/trunk/ucl/src/test/java/org/jboss/test/classpool/ucl/test/CtClassCreationTestCase.java
Log:
[JBREFLECT-96] Replaced all references to javassist.scopedpool package by org.jboss.classpool.scoped package.
In jbosscl/src/test/java module, parameterized all references to ClassPoolRepository.getInstance(), in a way that the ClassPoolRepository configured in Common.xml can be retrieved instead.
In jbosscl/src/main/java, replaced references to ClassPoolRepository by JBossClDelegatingClassPoolRepository.
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/base/BaseClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/base/BaseClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/base/BaseClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,30 +1,30 @@
/*
-* 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.
-*/
+ * 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.classpool.base;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.NotFoundException;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.spi.AbstractClassPool;
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/AbstractJBossClassPoolFactory.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/AbstractJBossClassPoolFactory.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/AbstractJBossClassPoolFactory.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,30 +1,30 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPoolRepository;
import org.jboss.classpool.plugins.temp.TempJBossClassPool;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.spi.AbstractClassPool;
import org.jboss.classpool.spi.AbstractClassPoolFactory;
import org.jboss.logging.Logger;
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/DelegatingClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/DelegatingClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/DelegatingClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,38 +1,38 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.NotFoundException;
-import javassist.scopedpool.ScopedClassPoolRepository;
import org.jboss.classpool.base.BaseClassPool;
+import org.jboss.classpool.base.CtClassCache;
import org.jboss.classpool.base.CtClassCacheFactory;
-import org.jboss.classpool.base.CtClassCache;
import org.jboss.classpool.domain.AbstractClassPoolDomain;
import org.jboss.classpool.domain.ClassPoolDomain;
import org.jboss.classpool.helpers.ClassLoaderUtils;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
/**
* Base class for classpools backed by a domain
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/NonDelegatingClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/NonDelegatingClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/NonDelegatingClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins;
import org.jboss.classpool.base.BaseClassPool;
@@ -26,7 +26,7 @@
import javassist.ClassPool;
import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
/**
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempClassPoolFactory.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempClassPoolFactory.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempClassPoolFactory.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,31 +1,31 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.temp;
import org.jboss.classpool.plugins.AbstractJBossClassPoolFactory;
import org.jboss.classpool.spi.AbstractClassPool;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
/**
*
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempJBossClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempJBossClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempJBossClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,33 +1,33 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.temp;
-import org.jboss.classpool.spi.AbstractClassPool;
-
import javassist.ClassPool;
import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
+import org.jboss.classpool.spi.AbstractClassPool;
+
/**
* The temporary classpool used by the instrumentor. It's main job is to delegate to the parent classpool
*
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempJBossDelegatingClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempJBossDelegatingClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/temp/TempJBossDelegatingClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,35 +1,35 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.temp;
-import org.jboss.classpool.base.BaseClassPool;
-import org.jboss.classpool.spi.AbstractClassPool;
-
import javassist.ClassPool;
import javassist.CtClass;
import javassist.NotFoundException;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.base.BaseClassPool;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
+import org.jboss.classpool.spi.AbstractClassPool;
+
/**
*
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/AbstractClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/AbstractClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/AbstractClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -28,8 +28,8 @@
import javassist.ClassPool;
import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPool;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPool;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.helpers.ClassLoaderUtils;
import org.jboss.logging.Logger;
@@ -270,7 +270,6 @@
// NOTE: identical to ScopedClassPoolRepository, with two differences:
// 1. This method uses the shortcuts isLocalResource and getResourceName
// 2. This method uses the Repository.includeInGlobalSearch method
- @SuppressWarnings("unchecked")
private class SearchAllRegisteredLoadersSearchStrategy implements ClassPoolSearchStrategy
{
Logger logger = Logger.getLogger(this.getClass());
@@ -285,7 +284,7 @@
!isLocalResource(getResourceName(classname), trace) &&
!generatedClasses.containsKey(classname))
{
- Map<ClassLoader, ClassPool> registeredCLs = repository.getRegisteredCLs();
+ Map<ClassLoader, ScopedClassPool> registeredCLs = repository.getRegisteredCLs();
synchronized (registeredCLs)
{
for(ClassPool pl : registeredCLs.values())
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/AbstractClassPoolFactory.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/AbstractClassPoolFactory.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/AbstractClassPoolFactory.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -22,9 +22,10 @@
package org.jboss.classpool.spi;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPoolFactory;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolFactory;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
+
/**
* A factory that creates ClassPool instances based on a corresponding ClassLoader.
*
Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/ClassPoolRepository.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/ClassPoolRepository.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/spi/ClassPoolRepository.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -21,34 +21,30 @@
*/
package org.jboss.classpool.spi;
-import java.lang.reflect.Field;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPool;
-import javassist.scopedpool.ScopedClassPoolFactory;
-import javassist.scopedpool.ScopedClassPoolRepository;
-import javassist.scopedpool.ScopedClassPoolRepositoryImpl;
+import org.jboss.classpool.scoped.ScopedClassPool;
+import org.jboss.classpool.scoped.ScopedClassPoolRepositoryImpl;
+
/**
* Singleton classpool repository.
*
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
* @version $Revision$
*/
-public class ClassPoolRepository implements ScopedClassPoolRepository
+public class ClassPoolRepository extends ScopedClassPoolRepositoryImpl
{
private final static ClassPoolRepository instance = new ClassPoolRepository();
- protected final ScopedClassPoolRepository delegate;
-
private volatile List<ClassPoolRepositoryCallback> callbacks;
private final ConcurrentMap<ClassLoader, Boolean> currentClassLoaders = new ConcurrentHashMap<ClassLoader, Boolean>();
@@ -68,57 +64,10 @@
*/
protected ClassPoolRepository()
{
- this.delegate = ScopedClassPoolRepositoryImpl.getInstance();
- ClassPool classPool = AbstractClassPoolFactory.getSystemClassPool();
- // FIXME we need a way to define the classpool field of ScopedClassPoolRepository
- Field cpField = null;
- try
- {
- cpField = ScopedClassPoolRepositoryImpl.class.getDeclaredField("classpool");
- } catch (SecurityException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoSuchFieldException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- throw new RuntimeException(e);
- }
- cpField.setAccessible(true);
- try
- {
- cpField.set(ScopedClassPoolRepositoryImpl.getInstance(), classPool);
- } catch (IllegalArgumentException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- throw new RuntimeException(e);
- }
+ super(AbstractClassPoolFactory.getSystemClassPool());
}
/**
- * Sets the classpool factory that should be used. This method should always
- * be called before the repository is used.
- */
- public void setClassPoolFactory(ScopedClassPoolFactory factory)
- {
- delegate.setClassPoolFactory(factory);
- }
-
- /**
- * Returns the classpool factory.
- */
- public ScopedClassPoolFactory getClassPoolFactory()
- {
- return delegate.getClassPoolFactory();
- }
-
- /**
* Adds a callback object for notifications on classloader registration.
*
* @param callback the callback object
@@ -167,59 +116,7 @@
return callbacks.remove(callback);
}
- public boolean isPrune()
- {
- return delegate.isPrune();
- }
-
- public void setPrune(boolean prune)
- {
- delegate.setPrune(prune);
- }
-
/**
- * Creates a ClassPool corresponding to {@code classLoader}.
- *
- * @param classLoader the classLoader corresponding to the created ClassPool
- * @param parent the parent of the class pool to be created.
- * @return the created ClassPool.
- */
- public ScopedClassPool createScopedClassPool(ClassLoader classLoader, ClassPool parent)
- {
- return delegate.createScopedClassPool(classLoader, parent);
- }
-
- /**
- * Finds the ClassPool corresponding to {@code classLoader}
- *
- * @param classLoader the classLoader
- * @return the ClassPoool that corresponds to {@classLoader}
- */
- public ClassPool findClassPool(ClassLoader classLoader)
- {
- return delegate.findClassPool(classLoader);
- }
-
- /**
- * Get the registered classloaders
- *
- * @return the registered classloaders
- */
- @SuppressWarnings("unchecked")
- public Map<ClassLoader, ClassPool> getRegisteredCLs()
- {
- return delegate.getRegisteredCLs();
- }
-
- /**
- * This method will check to see if a register classloader has been undeployed (as in JBoss)
- */
- public void clearUnregisteredClassLoaders()
- {
- delegate.clearUnregisteredClassLoaders();
- }
-
- /**
* Registers {@code classLoader} and returns the corresponding {@code ClassPool}.
*
* @param classLoader the ClassLoader to be added to this repository
@@ -237,7 +134,7 @@
return null;
}
- ScopedClassPool classPool = (ScopedClassPool) delegate.registerClassLoader(classLoader);
+ ScopedClassPool classPool = (ScopedClassPool) super.registerClassLoader(classLoader);
currentClassLoaders.remove(classLoader);
// TODO review classPool != null check for AOP tests
@@ -258,7 +155,7 @@
*/
public void unregisterClassLoader(ClassLoader classLoader)
{
- delegate.unregisterClassLoader(classLoader);
+ super.unregisterClassLoader(classLoader);
if (callbacks != null && callbacks.size() > 0)
{
for (ClassPoolRepositoryCallback callback : callbacks)
Modified: projects/jboss-classpool/trunk/classpool/src/test/java/org/jboss/test/classpool/support/ClassFactory.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/test/java/org/jboss/test/classpool/support/ClassFactory.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/test/java/org/jboss/test/classpool/support/ClassFactory.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -41,7 +41,7 @@
private static final String CLASS = "Proxy";
private static int counter = 0;
- public static Object create(Class<?> parent, ClassLoader loader) throws Exception
+ public static Object create(Class<?> parent, ClassLoader loader, ClassPoolRepository repository) throws Exception
{
String packageName = parent.getPackage().getName();
if (!packageName.startsWith("java.") && !packageName.startsWith("sun."))
@@ -53,7 +53,7 @@
packageName = PACKAGE + ".";
}
String className = packageName + CLASS + counter++;
- ClassPool pool = ClassPoolRepository.getInstance().getRegisteredCLs().get(loader);
+ ClassPool pool = repository.getRegisteredCLs().get(loader);
try
{
registerGeneratedClass(pool, className);
Modified: projects/jboss-classpool/trunk/classpool/src/test/java/org/jboss/test/classpool/support/ClassPoolTestScenario.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/test/java/org/jboss/test/classpool/support/ClassPoolTestScenario.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/classpool/src/test/java/org/jboss/test/classpool/support/ClassPoolTestScenario.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -52,7 +52,7 @@
/**
* Constructor.
*
- * @param classLoaderFactory creates class loaders for the loader scenario.
+ * @param classLoaderFactory creates class loaders for the loader scenario.
* @param <I> the info that {@code classLoaderFactory} uses to create a class loader
*/
public ClassPoolTestScenario(ClassLoaderFactory<I> classLoaderFactory)
@@ -61,6 +61,19 @@
repository = ClassPoolRepository.getInstance();
}
+ /**
+ * Constructor.
+ *
+ * @param classLoaderFactory creates class loaders for the loader scenario.
+ * @param classPoolRepository repository that should be used for registering of ClassPools
+ * @param <I> the info that {@code classLoaderFactory} uses to create a class loader
+ */
+ public ClassPoolTestScenario(ClassLoaderFactory<I> classLoaderFactory, ClassPoolRepository classPoolRepository)
+ {
+ super(classLoaderFactory);
+ repository = classPoolRepository;
+ }
+
@Override
public ClassPool getLoader(CtClass clazz)
{
Modified: projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBoss5ClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBoss5ClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBoss5ClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.jbosscl;
import java.net.URL;
@@ -27,8 +27,8 @@
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.spi.AbstractClassPool;
/**
Modified: projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBoss5ClassPoolFactory.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBoss5ClassPoolFactory.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBoss5ClassPoolFactory.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,37 +1,37 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.classpool.plugins.jbosscl;
import java.net.URL;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPoolFactory;
-import javassist.scopedpool.ScopedClassPoolRepository;
import org.jboss.classloader.spi.ClassLoaderDomain;
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloading.spi.RealClassLoader;
import org.jboss.classloading.spi.dependency.Module;
import org.jboss.classpool.plugins.AbstractJBossClassPoolFactory;
+import org.jboss.classpool.scoped.ScopedClassPoolFactory;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.spi.AbstractClassPool;
import org.jboss.classpool.spi.ClassPoolRepository;
Modified: projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClClassPoolDomain.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClClassPoolDomain.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClClassPoolDomain.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -44,7 +44,6 @@
import org.jboss.classpool.helpers.ClassLoaderUtils;
import org.jboss.classpool.plugins.DelegatingClassPool;
import org.jboss.classpool.spi.AbstractClassPoolFactory;
-import org.jboss.classpool.spi.ClassPoolRepository;
/**
* JBoss Cl class pool domain.
@@ -276,7 +275,7 @@
return null;
}
ClassLoader foundLoader = registry.getClassLoader(found);
- ClassPool pool = ClassPoolRepository.getInstance().registerClassLoader(foundLoader);
+ ClassPool pool = JBossClDelegatingClassPoolRepository.getInstance().registerClassLoader(foundLoader);
try
{
if (pool instanceof BaseClassPool)
Modified: projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClClassPoolToClassPoolDomainAdapter.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClClassPoolToClassPoolDomainAdapter.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClClassPoolToClassPoolDomainAdapter.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -25,7 +25,6 @@
import org.jboss.classloader.spi.base.BaseClassLoaderDomain;
import org.jboss.classpool.domain.ClassPoolToClassPoolDomainAdapter;
-import org.jboss.classpool.spi.ClassPoolRepository;
/**
*
@@ -49,6 +48,6 @@
@Override
public ClassPool initialiseParentClassLoader()
{
- return ClassPoolRepository.getInstance().registerClassLoader(BaseClassLoaderDomain.class.getClassLoader());
+ return JBossClDelegatingClassPoolRepository.getInstance().registerClassLoader(BaseClassLoaderDomain.class.getClassLoader());
}
}
Modified: projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.jbosscl;
import java.lang.ref.WeakReference;
@@ -27,11 +27,11 @@
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPoolRepository;
import org.jboss.classloading.spi.dependency.Module;
import org.jboss.classpool.domain.ClassPoolDomain;
import org.jboss.classpool.plugins.DelegatingClassPool;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
/**
*
Modified: projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPoolFactory.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPoolFactory.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPoolFactory.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.jbosscl;
import java.security.AccessController;
@@ -27,8 +27,8 @@
import java.util.HashSet;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPoolFactory;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolFactory;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classloader.spi.ClassLoaderDomain;
import org.jboss.classloader.spi.ClassLoaderSystem;
Modified: projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPoolRepository.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPoolRepository.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/JBossClDelegatingClassPoolRepository.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -28,10 +28,10 @@
import java.util.WeakHashMap;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPool;
import org.jboss.classloading.spi.dependency.ClassLoading;
import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.classpool.scoped.ScopedClassPool;
import org.jboss.classpool.spi.ClassPoolRepository;
/**
@@ -66,7 +66,8 @@
ScopedClassPool classPool = (ScopedClassPool) super.registerClassLoader(classLoader);
if (classPool == null)
{
- delegate.unregisterClassLoader(classLoader);
+ // TODO check this works; was delegate before
+ super.unregisterClassLoader(classLoader);
}
else
{
Modified: projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/ScopedJBoss5ClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/ScopedJBoss5ClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/main/java/org/jboss/classpool/plugins/jbosscl/ScopedJBoss5ClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.jbosscl;
import java.lang.ref.WeakReference;
@@ -28,7 +28,7 @@
import javassist.ClassPool;
import javassist.CtClass;
import javassist.NotFoundException;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classloader.spi.ClassLoaderDomain;
import org.jboss.classloader.spi.Loader;
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ArchiveClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ArchiveClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ArchiveClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -44,6 +44,7 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
}
\ No newline at end of file
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/CtClassCreationTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/CtClassCreationTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/CtClassCreationTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -33,6 +33,7 @@
import javassist.ClassPool;
import javassist.CtClass;
+import org.jboss.classpool.spi.ClassPoolRepository;
import org.jboss.test.classpool.jbosscl.support.CLDeploymentBuilder;
import org.jboss.test.classpool.support.ClassFactory;
import org.jboss.test.classpool.support.ClassPoolTestScenario;
@@ -54,7 +55,8 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
public void testCreatedClassInSamePackage() throws Exception
@@ -68,8 +70,9 @@
Class<?> classA = loaderA.loadClass(CLASS_A);
Class<?> classB = loaderB.loadClass(CLASS_B);
- Object createdA = ClassFactory.create(classA, loaderA);
- Object createdB = ClassFactory.create(classB, loaderB);
+ ClassPoolRepository repository = getClassPoolRepository();
+ Object createdA = ClassFactory.create(classA, loaderA, repository);
+ Object createdB = ClassFactory.create(classB, loaderB, repository);
Class<?> createdClassA = createdA.getClass();
Class<?> createdClassB = createdB.getClass();
@@ -185,8 +188,9 @@
ClassLoader loaderA = poolA.getClassLoader();
ClassLoader loaderB = poolB.getClassLoader();
- Object createdA = ClassFactory.create(ArrayList.class, loaderA);
- Object createdB = ClassFactory.create(ArrayList.class, loaderB);
+ ClassPoolRepository repository = getClassPoolRepository();
+ Object createdA = ClassFactory.create(ArrayList.class, loaderA, repository);
+ Object createdB = ClassFactory.create(ArrayList.class, loaderB, repository);
Class<?> createdClassA = createdA.getClass();
Class<?> createdClassB = createdB.getClass();
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/HierarchicalDomainClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/HierarchicalDomainClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/HierarchicalDomainClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -45,6 +45,7 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
}
\ No newline at end of file
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/HierarchicalParentLoaderClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/HierarchicalParentLoaderClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/HierarchicalParentLoaderClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -46,6 +46,7 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
}
\ No newline at end of file
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/JBossClClassPoolTest.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/JBossClClassPoolTest.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/JBossClClassPoolTest.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -27,6 +27,7 @@
import org.jboss.classloader.plugins.jdk.AbstractJDKChecker;
import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.classpool.spi.ClassPoolRepository;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.kernel.spi.deployment.KernelDeployment;
import org.jboss.test.AbstractTestCaseWithSetup;
@@ -116,6 +117,11 @@
return new JBossCLFactory(getMicrocontainerFacade());
}
+ protected ClassPoolRepository getClassPoolRepository()
+ {
+ return (ClassPoolRepository) getBean("ClassPoolRepository");
+ }
+
private MicrocontainerFacade getMicrocontainerFacade()
{
return new MicrocontainerFacadeImpl();
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ModuleDependencyClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ModuleDependencyClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ModuleDependencyClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -45,6 +45,7 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
}
\ No newline at end of file
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/PackageDependencyClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/PackageDependencyClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/PackageDependencyClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -44,6 +44,7 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
}
\ No newline at end of file
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReExportModuleClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReExportModuleClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReExportModuleClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -46,6 +46,7 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
}
\ No newline at end of file
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReExportPackageClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReExportPackageClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReExportPackageClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -44,6 +44,7 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
}
\ No newline at end of file
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReplaceReferencesClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReplaceReferencesClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/ReplaceReferencesClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.test.classpool.jbosscl.test;
@@ -39,9 +39,9 @@
import javassist.CtMethod;
import javassist.CtNewMethod;
import javassist.Modifier;
-import javassist.scopedpool.ScopedClassPool;
import org.jboss.classloading.spi.DomainClassLoader;
+import org.jboss.classpool.scoped.ScopedClassPool;
import org.jboss.classpool.spi.ClassPoolRepository;
import org.jboss.test.classpool.jbosscl.support.CLDeploymentBuilder;
import org.jboss.test.classpool.jbosscl.support.SupportClasses;
@@ -62,7 +62,7 @@
public final String x = "org.jboss.test.classpool.support.excluded";
- private final static Translator TRANSLATOR = new MyTranslator();
+ private final Translator TRANSLATOR = new MyTranslator();
public ReplaceReferencesClassPoolTestCase(String name)
{
@@ -72,7 +72,8 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
@Override
@@ -141,7 +142,7 @@
{});
}
- final static class MyTranslator implements Translator
+ final class MyTranslator implements Translator
{
public void unregisterClassLoader(DomainClassLoader loader)
{
@@ -159,7 +160,7 @@
return null;
}
- ClassPool pool = ClassPoolRepository.getInstance().registerClassLoader(loader);
+ ClassPool pool = getClassPoolRepository().registerClassLoader(loader);
CtClass clazz = pool.get(className);
if (className.endsWith("Caller"))
{
@@ -264,8 +265,9 @@
private void replaceReferences(final CtClass clazz) throws Exception
{
CodeConverter conv = new CodeConverter();
- ScopedClassPool pool = ClassPoolRepository.getInstance().getClassPoolFactory().
- create(clazz.getClassPool(), ClassPoolRepository.getInstance());
+ ClassPoolRepository repository = getClassPoolRepository();
+ ScopedClassPool pool = repository.getClassPoolFactory().create(
+ clazz.getClassPool(), repository);
Collection<String> refs = AccessController.doPrivileged(new PrivilegedAction<Collection<String>>() {
@SuppressWarnings("all")
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/RepositoryClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/RepositoryClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/RepositoryClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -49,7 +49,8 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
public void testCanLoadArrayCtClass() throws Exception
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/UsesPackageClassPoolTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/UsesPackageClassPoolTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/java/org/jboss/test/classpool/jbosscl/test/UsesPackageClassPoolTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -45,6 +45,7 @@
@Override
protected TestScenario<CtClass, ClassPool, CLDeploymentBuilder> getTestScenario()
{
- return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory());
+ return new ClassPoolTestScenario<CLDeploymentBuilder>(getClassLoaderFactory(),
+ getClassPoolRepository());
}
}
\ No newline at end of file
Modified: projects/jboss-classpool/trunk/jbosscl/src/test/resources/org/jboss/test/classpool/jbosscl/Common.xml
===================================================================
--- projects/jboss-classpool/trunk/jbosscl/src/test/resources/org/jboss/test/classpool/jbosscl/Common.xml 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/jbosscl/src/test/resources/org/jboss/test/classpool/jbosscl/Common.xml 2010-02-25 23:17:05 UTC (rev 101497)
@@ -33,7 +33,6 @@
<parameter><inject bean="RegisterModuleCallback"/></parameter>
</constructor>
</bean>
-
<bean name="ClassPoolRepository" class="org.jboss.classpool.plugins.jbosscl.JBossClDelegatingClassPoolRepository">
<constructor factoryMethod="getInstance"/>
<property name="classPoolFactory"><inject bean="ClassPoolFactory"/></property>
Modified: projects/jboss-classpool/trunk/scopedpool/src/main/java/org/jboss/classpool/scoped/ScopedClassPoolRepositoryImpl.java
===================================================================
--- projects/jboss-classpool/trunk/scopedpool/src/main/java/org/jboss/classpool/scoped/ScopedClassPoolRepositoryImpl.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/scopedpool/src/main/java/org/jboss/classpool/scoped/ScopedClassPoolRepositoryImpl.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -35,6 +35,7 @@
* It is an singleton.
*
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
* @version $Revision$
*/
public abstract class ScopedClassPoolRepositoryImpl implements ScopedClassPoolRepository {
@@ -82,16 +83,22 @@
}
/**
- * Create a scoped classpool.
+ * Creates a ClassPool corresponding to {@code classLoader}.
*
- * @param cl the classloader.
- * @param src the original classpool.
- * @return the classpool
+ * @param classLoader the classLoader corresponding to the created ClassPool
+ * @param parent the parent of the class pool to be created
+ * @return the created ClassPool
*/
public ScopedClassPool createScopedClassPool(ClassLoader cl, ClassPool src) {
return factory.create(cl, src, this);
}
+ /**
+ * Finds the ClassPool corresponding to {@code classLoader}
+ *
+ * @param classLoader the classLoader
+ * @return the ClassPoool that corresponds to {@classLoader}
+ */
public ClassPool findClassPool(ClassLoader cl) {
if (cl == null)
return registerClassLoader(ClassLoader.getSystemClassLoader());
@@ -122,7 +129,9 @@
}
/**
- * Get the registered classloaders.
+ * Get the registered classloaders
+ *
+ * @return the registered classloaders
*/
public Map<ClassLoader, ScopedClassPool> getRegisteredCLs() {
clearUnregisteredClassLoaders();
@@ -170,10 +179,17 @@
// Noop - this is the end
}
+ /**
+ * Sets the classpool factory that should be used. This method should always
+ * be called before the repository is used.
+ */
public void setClassPoolFactory(ScopedClassPoolFactory factory) {
this.factory = factory;
}
+ /**
+ * Returns the classpool factory.
+ */
public ScopedClassPoolFactory getClassPoolFactory() {
return factory;
}
Modified: projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/JBossClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/JBossClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/JBossClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.classpool.plugins.ucl;
import java.io.File;
@@ -28,8 +28,8 @@
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.spi.AbstractClassPool;
import org.jboss.mx.loading.RepositoryClassLoader;
Modified: projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/JBossClassPoolFactory.java
===================================================================
--- projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/JBossClassPoolFactory.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/JBossClassPoolFactory.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.classpool.plugins.ucl;
import java.io.File;
@@ -26,9 +26,9 @@
import java.net.URL;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPoolRepository;
import org.jboss.classpool.plugins.AbstractJBossClassPoolFactory;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.spi.AbstractClassPool;
import org.jboss.mx.loading.RepositoryClassLoader;
Modified: projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/ScopedJBossClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/ScopedJBossClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/ScopedJBossClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.classpool.plugins.ucl;
import java.io.File;
@@ -28,7 +28,7 @@
import javassist.ClassPool;
import javassist.CtClass;
import javassist.NotFoundException;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.plugins.ucl.LoaderRepositoryUrlUtil.UrlInfo;
import org.jboss.classpool.spi.AbstractClassPool;
Modified: projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/UclDelegatingClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/UclDelegatingClassPool.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/UclDelegatingClassPool.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.ucl;
import java.io.File;
@@ -28,7 +28,7 @@
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.domain.ClassPoolDomain;
import org.jboss.classpool.plugins.DelegatingClassPool;
Modified: projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/UclDelegatingClassPoolFactory.java
===================================================================
--- projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/UclDelegatingClassPoolFactory.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/ucl/src/main/java/org/jboss/classpool/plugins/ucl/UclDelegatingClassPoolFactory.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.classpool.plugins.ucl;
import java.io.File;
@@ -26,7 +26,7 @@
import java.net.URL;
import javassist.ClassPool;
-import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
import org.jboss.classpool.base.BaseClassPoolDomain;
import org.jboss.classpool.domain.ClassPoolDomain;
Modified: projects/jboss-classpool/trunk/ucl/src/test/java/org/jboss/test/classpool/ucl/test/CtClassCreationTestCase.java
===================================================================
--- projects/jboss-classpool/trunk/ucl/src/test/java/org/jboss/test/classpool/ucl/test/CtClassCreationTestCase.java 2010-02-25 23:09:45 UTC (rev 101496)
+++ projects/jboss-classpool/trunk/ucl/src/test/java/org/jboss/test/classpool/ucl/test/CtClassCreationTestCase.java 2010-02-25 23:17:05 UTC (rev 101497)
@@ -34,6 +34,7 @@
import javassist.ClassPool;
import javassist.CtClass;
+import org.jboss.classpool.spi.ClassPoolRepository;
import org.jboss.test.classpool.support.ClassFactory;
import org.jboss.test.classpool.support.ClassPoolTestScenario;
import org.jboss.test.classpool.support.TestScenario;
@@ -189,8 +190,9 @@
Class<?> classA = loaderA.loadClass(CLASS_A);
Class<?> classB = loaderB.loadClass(CLASS_B);
- Object createdA = ClassFactory.create(classA, loaderA);
- Object createdB = ClassFactory.create(classB, loaderB);
+ ClassPoolRepository repository = ClassPoolRepository.getInstance();
+ Object createdA = ClassFactory.create(classA, loaderA, repository);
+ Object createdB = ClassFactory.create(classB, loaderB, repository);
Class<?> createdClassA = createdA.getClass();
Class<?> createdClassB = createdB.getClass();
@@ -214,8 +216,9 @@
ClassLoader loaderA = globalPoolA.getClassLoader();
ClassLoader loaderB = globalPoolB.getClassLoader();
- Object createdA = ClassFactory.create(ArrayList.class, loaderA);
- Object createdB = ClassFactory.create(ArrayList.class, loaderB);
+ ClassPoolRepository repository = ClassPoolRepository.getInstance();
+ Object createdA = ClassFactory.create(ArrayList.class, loaderA, repository);
+ Object createdB = ClassFactory.create(ArrayList.class, loaderB, repository);
Class<?> createdClassA = createdA.getClass();
Class<?> createdClassB = createdB.getClass();
More information about the jboss-cvs-commits
mailing list