public synchronized Domain getDomain(ClassLoader classLoader, AspectManager parent)
{
ClassLoader scopedClassLoader = delegate.ifScopedDeploymentGetScopedParentUclForCL(classLoader);
if (scopedClassLoader != null)
{
Domain scopedManager = null;
synchronized (AOPClassPoolRepository.getInstance().getRegisteredCLs())
{
Object loaderRepository = delegate.getLoaderRepository(classLoader);
scopedManager = scopedClassLoaderDomains.get(loaderRepository);
// FIXME: JBAOP-107 REMOVE THIS HACK
if (scopedManager != null && scopedManager.isValid() == false)
{
scopedClassLoaderDomains.remove(loaderRepository);
scopedManager = null;
}
if (scopedManager == null)
{
scopedManager = delegate.getScopedClassLoaderDomain(scopedClassLoader, parent);
log.debug("Created domain " + scopedManager + " for scoped deployment on: " +
classLoader + "; identifying scoped ucl: " + scopedClassLoader);
scopedManager.setInheritsBindings(true);
scopedManager.setInheritsDeclarations(true);
scopedClassLoaderDomains.put(loaderRepository, scopedManager);
}
return scopedManager;
}