[jboss-cvs] JBossAS SVN: r102347 - projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 12 08:40:55 EST 2010


Author: flavia.rainone at jboss.com
Date: 2010-03-12 08:40:54 -0500 (Fri, 12 Mar 2010)
New Revision: 102347

Added:
   projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/WeavingRegistry.java
Log:
[JBAOP-771] Porting to trunk.

Added: projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/WeavingRegistry.java
===================================================================
--- projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/WeavingRegistry.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/WeavingRegistry.java	2010-03-12 13:40:54 UTC (rev 102347)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.aop.instrument;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javassist.ClassPool;
+
+/**
+ * Registers what has been loaded already but is not woven.
+ * 
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class WeavingRegistry
+{
+   private static final Map<ClassPool, Collection<String>> loadedButNotWovenClasses = new ConcurrentHashMap<ClassPool, Collection<String>>();
+   
+   public static void setClassLoadedButNotWoven(ClassPool classPool, String classname)
+   {
+      Collection<String> notWovenClasses = loadedButNotWovenClasses.get(classPool);
+      if (notWovenClasses == null)
+      {
+         notWovenClasses = new HashSet<String>();
+         loadedButNotWovenClasses.put(classPool, notWovenClasses);
+      }
+      notWovenClasses.add(classname);
+   }
+
+   public static boolean isClassLoadedButNotWoven(ClassPool classPool, String classname)
+   {
+      return loadedButNotWovenClasses.containsKey(classPool) &&
+         loadedButNotWovenClasses.get(classPool).contains(classname);
+   }
+}
\ No newline at end of file


Property changes on: projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/WeavingRegistry.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native




More information about the jboss-cvs-commits mailing list