public AbstractClassPool create(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
{
ClassPool parent = getCreateParentClassPools(cl, src, repository);
AbstractClassPool pool = null;
if (cl instanceof RealClassLoader)
{
Module module = registry.getModule(cl);
if (module != null && module.getDeterminedParentDomainName() != null)
{
//It is scoped
ClassLoaderSystem sys = registry.getSystem();
ClassLoaderDomain domain = sys.getDomain(module.getDeterminedDomainName());
boolean parentFirst = module.isJ2seClassLoadingCompliance();
ClassPool parentDomainPool = getParentUnitClassPool(cl);
pool = new ScopedJBoss5ClassPool(cl, parent, parentDomainPool, repository, getTempURL(module), parentFirst, domain);
}
else
{
pool = new JBoss5ClassPool(cl, parent, repository, getTempURL(module));
}
}
if (pool == null)
{
pool = new AbstractClassPool(cl, parent, repository);
}
log.debug("Created pool " + pool + " for loader " + cl);
return pool;
}