Methods Summary |
---|
public java.lang.String | aspectDefinitions()The temporary directory to which dyn class files are written
Map factories = AspectManager.instance().getAspectDefinitions();
Iterator it = factories.keySet().iterator();
StringBuffer buffer = new StringBuffer("");
while (it.hasNext())
{
buffer.append(it.next() + "<br>");
}
return buffer.toString();
|
public void | attachClass(java.lang.String classname)
Notification msg = new Notification("AOP class attached", this, getNextNotificationSequenceNumber());
msg.setUserData(classname);
sendNotification(msg);
|
protected void | attachDeprecatedTranslator()
log.warn("EnableTransformer has been deprecated, please use EnableLoadtimeWeaving. See docs for more details");
AspectManager mgr = AspectManager.instance();
try
{
server.setAttribute(DEFAULT_LOADER_REPOSITORY, new Attribute("Translator", mgr));
}
catch (InstanceNotFoundException e)
{
throw new RuntimeException(e);
}
catch (AttributeNotFoundException e)
{
throw new RuntimeException(e);
}
catch (InvalidAttributeValueException e)
{
throw new RuntimeException(e);
}
catch (MBeanException e)
{
throw new RuntimeException(e);
}
catch (ReflectionException e)
{
throw new RuntimeException(e);
}
|
protected void | attachTranslator()
JDK14TransformerManager.transformer = new JDK14Transformer()
{
public byte[] transform(ClassLoader loader, String classname, byte[] classBytes)
{
try
{
//Make sure that we use the correct classloader, in order to get the correct domain if it is a scoped loader
return AspectManager.instance(loader).translate(classname, loader, classBytes);
}
catch (Exception e)
{
throw new RuntimeException("Error converting " + classname + " on " + loader, e);
}
}
};
|
protected void | baseAop()
try
{
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL base = cl.getResource("base-aop.xml");
AspectXmlLoader.deployXML(base);
}
catch (Exception ex)
{
ex.printStackTrace();
}
|
public java.lang.String | bindings()The temporary directory to which dyn class files are written
Map factories = AspectManager.instance().getBindings();
Iterator it = factories.keySet().iterator();
StringBuffer buffer = new StringBuffer("");
while (it.hasNext())
{
buffer.append(it.next() + "<br>");
}
return buffer.toString();
|
protected org.jboss.aop.ClassLoaderValidation | createClassLoaderValidation()
return new JBossClassLoaderValidator();
|
protected javassist.scopedpool.ScopedClassPoolFactory | createFactory()
return new JBossClassPoolFactory(tmpClassesDir);
|
protected void | createService()
// Set a default tmp classes dir to the jboss tmp dir/aopclasses
if (tmpClassesDir == null)
{
String jbossTmpDir = System.getProperty(ServerConfig.SERVER_TEMP_DIR);
if (jbossTmpDir == null)
jbossTmpDir = System.getProperty("java.io.tmpdir");
tmpClassesDir = new File(jbossTmpDir, "aopdynclasses");
}
// Validate the the tmp dir exists
if (tmpClassesDir.exists() == false && tmpClassesDir.mkdirs() == false)
throw new FileNotFoundException("Failed to create tmpClassesDir: " + tmpClassesDir.getAbsolutePath());
AspectManager.setClassPoolFactory(createFactory());
AspectManager.classLoaderValidator = createClassLoaderValidation();
// Add the tmp classes dir to our UCL classpath
Deployment.searchClasspath = false; // turn off dynamic finding of DDs
AspectManager.suppressTransformationErrors = suppressTransformationErrors;
if (enableTransformer && enableLoadtimeWeaving) throw new RuntimeException("Cannot set both EnableTransformer and EnableLoadtimeWeaving");
if (enableTransformer)
{
attachDeprecatedTranslator();
}
if (enableLoadtimeWeaving)
{
attachTranslator();
}
created = true;
AspectManager.notificationHandler = this;
AspectManager.scopedCLHelper = new JBossScopedClassLoaderHelper();
baseAop();
|
protected void | detachDeprecatedTranslator()
try
{
server.setAttribute(DEFAULT_LOADER_REPOSITORY, new Attribute("Translator", null));
}
catch (InstanceNotFoundException e)
{
throw new RuntimeException(e);
}
catch (AttributeNotFoundException e)
{
throw new RuntimeException(e);
}
catch (InvalidAttributeValueException e)
{
throw new RuntimeException(e);
}
catch (MBeanException e)
{
throw new RuntimeException(e);
}
catch (ReflectionException e)
{
throw new RuntimeException(e);
}
|
protected void | detachTranslator()
JDK14TransformerManager.transformer = null;
|
public boolean | getEnableLoadtimeWeaving()
return enableLoadtimeWeaving;
|
public boolean | getEnableTransformer()The temporary directory to which dyn class files are written
return enableTransformer;
|
public java.lang.String | getExclude()
return exclude;
|
public java.lang.String | getIgnore()
return ignore;
|
public java.lang.String | getInclude()
return include;
|
public java.lang.String | getInstrumentor()
return InstrumentorFactory.getInstrumentorName();
|
public boolean | getOptimized()Use aop optimizations. Optional just in case there is a bug
return AspectManager.optimize;
|
public boolean | getPrune()
return AspectManager.getPrune();
|
public boolean | getSuppressReferenceErrors()
return suppressReferenceErrors;
|
public boolean | getSuppressTransformationErrors()
return suppressTransformationErrors;
|
public java.io.File | getTmpClassesDir()The temporary directory to which dyn class files are written
return tmpClassesDir;
|
public boolean | getVerbose()Set the verbosity of aop logging. It doesn't use log4j
return AspectManager.verbose;
|
public java.lang.String | interceptorFactories()The temporary directory to which dyn class files are written
Map factories = AspectManager.instance().getInterceptorFactories();
Iterator it = factories.keySet().iterator();
StringBuffer buffer = new StringBuffer("");
while (it.hasNext())
{
buffer.append(it.next() + "<br>");
}
return buffer.toString();
|
public java.lang.String | introductions()
Map factories = AspectManager.instance().getInterfaceIntroductions();
Iterator it = factories.keySet().iterator();
StringBuffer buffer = new StringBuffer("");
while (it.hasNext())
{
buffer.append(it.next() + "<br>");
}
return buffer.toString();
|
public java.lang.String | registeredClassLoaders()The temporary directory to which dyn class files are written
Map factories = AspectManager.instance().getRegisteredCLs();
Iterator it = factories.keySet().iterator();
StringBuffer buffer = new StringBuffer("");
while (it.hasNext())
{
buffer.append(it.next() + "<br>");
}
return buffer.toString();
|
public void | setEnableLoadtimeWeaving(boolean enableTransformer)The temporary directory to which dyn class files are written
if (this.enableLoadtimeWeaving == enableTransformer) return;
if (this.getState() == STARTED)
{
if (enableTransformer)
{
attachTranslator();
}
else
{
detachTranslator();
}
}
this.enableLoadtimeWeaving = enableTransformer;
|
public void | setEnableTransformer(boolean enableTransformer)The temporary directory to which dyn class files are written
// Testsuite uses enableTransformer, we may be testing new loadtime features though.
if (enableLoadtimeWeaving)
{
log.warn("enabledLoadtimeWeaving alread set");
return;
}
if (this.enableTransformer == enableTransformer) return;
if (this.getState() == STARTED)
{
if (enableTransformer)
{
attachDeprecatedTranslator();
}
else
{
detachDeprecatedTranslator();
}
}
this.enableTransformer = enableTransformer;
|
public void | setExclude(java.lang.String exclude)
this.exclude = exclude;
ArrayList list = new ArrayList();
if (exclude != null)
{
StringTokenizer tokenizer = new StringTokenizer(exclude, ",");
while (tokenizer.hasMoreTokens())
{
list.add(tokenizer.nextToken().trim());
}
}
AspectManager.instance().setExclude(list);
|
public void | setIgnore(java.lang.String ignore)
this.ignore = ignore;
ArrayList list = new ArrayList();
if (ignore != null)
{
StringTokenizer tokenizer = new StringTokenizer(ignore, ",");
while (tokenizer.hasMoreTokens())
{
list.add(tokenizer.nextToken().trim());
}
}
AspectManager.instance().setIgnore(list);
|
public void | setInclude(java.lang.String include)
this.include = include;
ArrayList list = new ArrayList();
if (include != null)
{
StringTokenizer tokenizer = new StringTokenizer(include, ",");
while (tokenizer.hasMoreTokens())
{
list.add(tokenizer.nextToken().trim());
}
}
AspectManager.instance().setInclude(list);
|
public void | setInstrumentor(java.lang.String instrumentor)
InstrumentorFactory.initialise(instrumentor);
|
public void | setOptimized(boolean verbose)Use aop optimizations. Optional just in case there is a bug
AspectManager.optimize = verbose;
|
public void | setPrune(boolean prune)
AspectManager.setPrune(prune);
|
public void | setSuppressReferenceErrors(boolean suppressReferenceErrors)
this.suppressReferenceErrors = suppressReferenceErrors;
AspectManager.suppressReferenceErrors = suppressReferenceErrors;
|
public void | setSuppressTransformationErrors(boolean suppressTransformationErrors)
this.suppressTransformationErrors = suppressTransformationErrors;
AspectManager.suppressTransformationErrors = suppressTransformationErrors;
|
public void | setTmpClassesDir(java.io.File tmpClassesDir)The temporary directory to which dyn class files are written
this.tmpClassesDir = tmpClassesDir;
|
public void | setVerbose(boolean verbose)Set the verbosity of aop logging. It doesn't use log4j
AspectManager.verbose = verbose;
|
public java.lang.String | stacks()The temporary directory to which dyn class files are written
Map factories = AspectManager.instance().getInterceptorStacks();
Iterator it = factories.keySet().iterator();
StringBuffer buffer = new StringBuffer("");
while (it.hasNext())
{
buffer.append(it.next() + "<br>");
}
return buffer.toString();
|
protected void | startService()
|
protected void | stopService()
|