return ret;
}
private Object loadClassBytes(String className, ClassLoader classLoader)
{
ClassBytes classBytes = null;
if(className != null)
{
byte[] classDefinition = ClassUtil.getClassBytes(className, classLoader);
if (classDefinition == null && repositories != null)
{
Iterator it = repositories.iterator();
while (it.hasNext())
{
ObjectName name = (ObjectName) it.next();
log.debug("searching repository " + name);
try
{
Object o = server.getAttribute(name, "Instance");
LoaderRepository repository = (LoaderRepository) o;
Class c = repository.getCachedClass(className);
if (c == null)
{
continue;
}
log.debug("found class in repository " + name);
RepositoryClassLoader cl = (RepositoryClassLoader) c.getClassLoader();
classDefinition = loadByteCode(cl, className);
}
catch (Exception e)
{
log.debug("unable to get class from " + name + ": " + e.getMessage(), e);
}
}
}
if (classDefinition == null)
{
log.debug("unable to load class " + className);
}
classBytes = new ClassBytes(className, classDefinition);
}
return classBytes;
}