Methods Summary |
---|
private org.jboss.mx.loading.LoaderRepository | getAspectRepository(java.lang.Object aspect)
ClassLoader cl = aspect.getClass().getClassLoader();
ClassLoader parent = cl;
while (parent != null)
{
if (parent instanceof RepositoryClassLoader)
{
return ((RepositoryClassLoader)parent).getLoaderRepository();
}
parent = parent.getParent();
}
return null;
|
protected java.lang.ClassLoader | getClassLoader()
ClassLoader cl = (ClassLoader)loader.get();
if (cl != null)
{
return cl;
}
return null;
|
public java.lang.Object | getPerVMAspect(org.jboss.aop.advice.AspectDefinition def)
return getPerVMAspect(def.getName());
|
public java.lang.Object | getPerVMAspect(java.lang.String def)
if (parentDelegation == true)
{
//We will alway be loading up the correct class
Object aspect = super.getPerVMAspect(def);
return aspect;
}
else
{
return getPerVmAspectWithNoParentDelegation(def);
}
|
private java.lang.Object | getPerVmAspectWithNoParentDelegation(java.lang.String def)
Object aspect = myPerVMAspects.get(def);
if (aspect != null)
{
return aspect;
}
aspect = super.getPerVMAspect(def);
if (aspect != null)
{
LoaderRepository loadingRepository = getAspectRepository(aspect);
LoaderRepository myRepository = getScopedRepository();
if (loadingRepository == myRepository)
{
//The parent does not load this class
myPerVMAspects.put(def, aspect);
}
else
{
//The class has been loaded by a parent classloader, find out if we also have a copy
try
{
Class clazz = myRepository.loadClass(aspect.getClass().getName());
if (clazz == aspect.getClass())
{
notMyPerVMAspects.put(def, Boolean.TRUE);
}
else
{
//We have a different version of the class deployed
AspectDefinition aspectDefinition = getAspectDefinition(def);
//Override the classloader to create the aspect instance
aspect = createPerVmAspect(def, aspectDefinition, getClassLoader());
myPerVMAspects.put(def, aspect);
}
}
catch (ClassNotFoundException e)
{
throw new RuntimeException(e);
}
}
}
return aspect;
|
private org.jboss.mx.loading.HeirarchicalLoaderRepository3 | getScopedRepository()
HeirarchicalLoaderRepository3 myRepository = (HeirarchicalLoaderRepository3)((RepositoryClassLoader)getClassLoader()).getLoaderRepository();
return myRepository;
|
public void | removeAspectDefinition(java.lang.String name)
AspectDefinition def = super.internalRemoveAspectDefintion(name);
if (def != null)
{
Object o = myPerVMAspects.remove(name);
}
|