[jboss-cvs] JBossAS SVN: r59830 - branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jan 19 10:16:09 EST 2007
Author: kabir.khan at jboss.com
Date: 2007-01-19 10:16:08 -0500 (Fri, 19 Jan 2007)
New Revision: 59830
Modified:
branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop/AspectManager.java
Log:
Should not have committed call to CtClass.debugWriteFile()
Modified: branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop/AspectManager.java
===================================================================
--- branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop/AspectManager.java 2007-01-19 14:41:11 UTC (rev 59829)
+++ branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop/AspectManager.java 2007-01-19 15:16:08 UTC (rev 59830)
@@ -108,13 +108,13 @@
protected final WeakHashMap advisors = new WeakHashMap();
/** A map of domains by classloader, maintaned by the top level AspectManager */
protected final WeakHashMap scopedClassLoaderDomains = new WeakHashMap();
-
+
/** A map of domains by class, maintaned by the top level AspectManager */
protected final WeakHashMap subDomainsPerClass = new WeakHashMap();
-
+
/** Each domain may have sub domains interested in changes happening in this manager/domain */
protected final WeakHashMap subscribedSubDomains = new WeakHashMap();
-
+
/** A queue for adding new subscribed subdomains to */
protected final WeakHashMap subscribedSubDomainsQueue = new WeakHashMap();
protected int subscribedDomainQueueRef;
@@ -132,15 +132,15 @@
protected final ConcurrentReaderHashMap aspectDefinitions = new ConcurrentReaderHashMap();
protected final ConcurrentReaderHashMap perVMAspects = new ConcurrentReaderHashMap();
- /** class name prefixes to explicitly exclude unless contained in include. Maintained by top-level AspectManager */
+ /** class name prefixes to explicitly exclude unless contained in include. Maintained by top-level AspectManager */
protected final ArrayList exclude = new ArrayList();
-
- /** class name prefixes to explicitly include, this overrides whatever was set in exclude. Maintained by top-level AspectManager */
+
+ /** class name prefixes to explicitly include, this overrides whatever was set in exclude. Maintained by top-level AspectManager */
protected final ArrayList include = new ArrayList();
-
+
/** A set of wildcard enabled classnames that will be ignored no matter if they have been included. Maintained by top-level AspectManager */
protected final ArrayList ignore = new ArrayList();
-
+
/** ClassExpressions built from ignore. Maintained by top-level AspectManager */
protected ClassExpression[] ignoreExpressions = new ClassExpression[0];
@@ -173,7 +173,7 @@
protected DynamicAOPStrategy dynamicStrategy = new LoadInterceptedClassesStrategy();
// indicates that the transformation process has begun
protected boolean transformationStarted = false;
-
+
//This will be set by the AspectManagerService if running in JBoss
public static AOPScopedClassLoaderHelper scopedCLHelper;
@@ -247,9 +247,9 @@
}
ClassLoader topUcl = scopedCLHelper.getTopLevelJBossClassLoader();
return instance(topUcl);
-
+
}
-
+
public static synchronized AspectManager instance()
{
return instance(Thread.currentThread().getContextClassLoader());
@@ -257,7 +257,7 @@
public static synchronized AspectManager instance(ClassLoader loadingClassLoader)
{
- if (manager == null)
+ if (manager == null)
{
AccessController.doPrivileged(new PrivilegedAction()
{
@@ -275,7 +275,7 @@
}
manager = new AspectManager();
AOPClassPoolRepository.getInstance().setAspectManager(manager);
-
+
if (!verbose)
{
verbose = (new Boolean(System.getProperty("jboss.aop.verbose", "false"))).booleanValue();
@@ -313,22 +313,22 @@
}
manager.setIgnore(list);
}
-
+
String instrument = System.getProperty("jboss.aop.instrumentor", null);
InstrumentorFactory.initialise(instrument);
-
+
String debugClass = System.getProperty("jboss.aop.debug-classes", null);
if (debugClass != null)
{
debugClasses = (new Boolean(debugClass)).booleanValue();
}
-
+
Deployment.deploy();
return null;
}
});
}
-
+
if (scopedCLHelper != null)
{
ClassLoader scopedClassLoader = scopedCLHelper.ifScopedDeploymentGetScopedParentUclForCL(loadingClassLoader);
@@ -343,21 +343,21 @@
scopedManager = scopedCLHelper.getScopedClassLoaderDomain(scopedClassLoader, manager);
if (verbose)
{
- System.out.println("Created domain " + scopedManager + " for scoped deployment on: " +
+ System.out.println("Created domain " + scopedManager + " for scoped deployment on: " +
loadingClassLoader + "; identifying scoped ucl: " + scopedClassLoader);
}
scopedManager.setInheritsBindings(true);
scopedManager.setInheritsDeclarations(true);
manager.scopedClassLoaderDomains.put(scopedClassLoader, scopedManager);
}
- }
+ }
return scopedManager;
}
- }
+ }
return manager;
}
-
+
public LinkedHashMap getPointcuts()
{
return pointcuts;
@@ -386,15 +386,15 @@
public DynamicCFlow getDynamicCFlow(String name)
{
DynamicCFlowDefinition def = (DynamicCFlowDefinition) dynamicCFlows.get(name);
-
+
if (def != null)
{
return def.create();
}
return null;
}
-
+
/* (non-Javadoc)
* @see org.jboss.aop.Manager#addDynamicCFlow(java.lang.String, org.jboss.aop.advice.DynamicCFlowDefinition)
*/
@@ -489,7 +489,7 @@
{
return subDomainsPerClass;
}
-
+
public Advisor findAdvisor(Class clazz)
{
if (getSubDomainsPerClass().size() > 0)
@@ -528,7 +528,7 @@
{
return (ClassAdvisor)getAnyAdvisorIfAdvised(clazz);
}
-
+
/**
* Take into account that an advisor may be a container
*/
@@ -650,7 +650,7 @@
{
return (ClassPool)getRegisteredCLs().get(cl);
}
-
+
public ClassPool registerClassLoader(ClassLoader ucl)
{
return AOPClassPoolRepository.getInstance().registerClassLoader(ucl);
@@ -665,7 +665,7 @@
{
return scopedClassLoaderDomains;
}
-
+
public void unregisterClassLoader(ClassLoader cl)
{
AOPClassPoolRepository.getInstance().unregisterClassLoader(cl);
@@ -699,7 +699,7 @@
{
return ignore;
}
-
+
public ClassExpression[] getIgnoreExpressions()
{
return ignoreExpressions;
@@ -909,7 +909,6 @@
if (transformed)
{
pool.lockInCache(clazz);
- clazz.debugWriteFile();
byte[] rtn = clazz.toBytecode();
if (AspectManager.getPrune()) clazz.prune();
return rtn;
@@ -985,18 +984,18 @@
}
forceResortPrecedenceDefs();
}
-
+
public void removePrecedence(String name)
{
synchronized (precedenceDefs)
{
precedenceDefs.remove(name);
}
-
+
forceResortPrecedenceDefs();
}
-
+
protected void forceResortPrecedenceDefs()
{
synchronized (precedenceDefs)
@@ -1122,7 +1121,7 @@
if (advisor != null) return advisor;
if (Advised.class.isAssignableFrom(clazz))
{
-
+
Class superClass = clazz;
try
{
@@ -1315,10 +1314,10 @@
synchronized (bindings)
{
int bindSize = binds.size();
-
+
for (int i = 0; i < bindSize; i++)
{
-
+
AdviceBinding binding = (AdviceBinding) bindings.get(binds.get(i));
if (binding == null)
{
@@ -1340,7 +1339,7 @@
if (!isAdvisorRegistered(advisor))
{
//Check sub domains in case of generated advisors
-
+
WeakReference ref = (WeakReference)getSubDomainsPerClass().get(advisor.getClazz());
Domain domain = null;
if (ref != null) domain = (Domain)ref.get();
@@ -1390,7 +1389,7 @@
this.dynamicStrategy.interceptorChainsUpdated();
}
-
+
public void updateAdvisorsForAddedBinding(AdviceBinding binding)
{
synchronized (advisors)
@@ -1404,7 +1403,7 @@
{
Advisor advisor = getAdvisorFromAdvisorsKeySetIterator(it);
if (advisor == null) continue;
-
+
if (binding.getPointcut().softMatch(advisor))
{
if (AspectManager.verbose)
@@ -1454,15 +1453,15 @@
public void addClassMetaData(ClassMetaDataBinding meta)
{
removeClassMetaData(meta.getName());
-
+
updateAdvisorsForAddedClassMetaData(meta);
-
+
synchronized (classMetaData)
{
classMetaData.put(meta.getName(), meta);
}
}
-
+
protected void updateAdvisorsForAddedClassMetaData(ClassMetaDataBinding meta)
{
synchronized (advisors)
@@ -1512,7 +1511,7 @@
}
}
}
-
+
//--- Introductions
/**
@@ -1671,7 +1670,7 @@
{
Advisor advisor = getAdvisorFromAdvisorsKeySetIterator(it);
if (advisor == null) continue;
-
+
advisor.deployAnnotationOverride(introduction);
}
}
@@ -1690,8 +1689,8 @@
}
}
}
-
-
+
+
/**
* remove an annotation pointcut
*/
@@ -1729,7 +1728,7 @@
}
return aspect;
}
-
+
protected Object createPerVmAspect(String def, AspectDefinition adef, ClassLoader scopedClassLoader)
{
Object instance = null;
@@ -1952,7 +1951,7 @@
subscribedSubDomains.remove(domain);
}
}
-
+
private Advisor getAdvisorFromAdvisorsKeySetIterator(Iterator it)
{
Class clazz = (Class) it.next();
@@ -1974,7 +1973,7 @@
/**
* When running in the microcontainer with aspects installed as beans, a ClassProxyContainer will be created per bean
- * to check if this bean needs interceptors, each container creates a sunscribed domain for matching. This subscribed
+ * to check if this bean needs interceptors, each container creates a sunscribed domain for matching. This subscribed
* domain is added to a queue, which is checked when we need to iterate over the subscribed domains.
*/
private boolean copySubDomainsFromQueue(boolean increment)
@@ -1983,18 +1982,18 @@
synchronized (subscribedSubDomains)
{
if (!increment && subscribedDomainQueueRef > 0) subscribedDomainQueueRef--;
-
+
if (subscribedDomainQueueRef == 0 && subscribedSubDomainsQueue.size() > 0){
subscribedSubDomains.putAll(subscribedSubDomainsQueue);
subscribedSubDomainsQueue.clear();
copied = true;
}
-
+
if (increment) subscribedDomainQueueRef++;
- }
+ }
return copied;
- }
-
+ }
+
/*
public void dumpSubDomainsAndAdvisors(int indent)
{
@@ -2018,7 +2017,7 @@
indent--;
indent(indent);
System.out.println("</Advisors>");
-
+
indent(indent);
System.out.println("<Sub domains>");
indent++;
@@ -2031,9 +2030,9 @@
indent(indent);
System.out.println("</Sub domains>");
indent--;
-
+
}
-
+
private void indent(int indent)
{
for (int i = 0 ; i < indent ; i++) System.out.print(" ");
More information about the jboss-cvs-commits
mailing list