Brooklyn

brooklyn.util.javalang
[Java] Class ReflectionScanner

java.lang.Object
  brooklyn.util.javalang.ReflectionScanner

public class ReflectionScanner

Facade on Reflections which logs warnings for unloadable classes but does not fail


Field Summary
protected java.lang.ClassLoader[] classLoaders

protected Reflections reflections

 
Constructor Summary
ReflectionScanner(java.lang.Iterable urlsToScan, java.lang.String optionalPrefix, java.lang.ClassLoader... classLoaders)

scanner which will look in the given urls (or if those are null attempt to infer from the first entry in the classloaders, although currently that seems to only pick up directories, not JAR's), optionally filtering for the given prefix; any or all arguments can be null to accept all (and use default classpath for classloading).

 
Method Summary
protected java.util.List forNames(java.util.Set classNames, java.lang.String context)

Store getStore()

java.util.Set getSubTypesOf(java.lang.Class type)

overrides delegate so as to log rather than throw exception if a class cannot be loaded

java.util.Set getTypesAnnotatedWith(java.lang.Class annotation)

overrides delegate so as to log rather than throw exception if a class cannot be loaded

protected java.lang.Class loadClass(java.lang.String className)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

classLoaders

protected final java.lang.ClassLoader[] classLoaders


reflections

protected final Reflections reflections


 
Constructor Detail

ReflectionScanner

public ReflectionScanner(java.lang.Iterable urlsToScan, java.lang.String optionalPrefix, java.lang.ClassLoader... classLoaders)
scanner which will look in the given urls (or if those are null attempt to infer from the first entry in the classloaders, although currently that seems to only pick up directories, not JAR's), optionally filtering for the given prefix; any or all arguments can be null to accept all (and use default classpath for classloading).


 
Method Detail

forNames

@SuppressWarnings("unchecked")
protected java.util.List forNames(java.util.Set classNames, java.lang.String context)


getStore

public Store getStore()


getSubTypesOf

public java.util.Set getSubTypesOf(java.lang.Class type)
overrides delegate so as to log rather than throw exception if a class cannot be loaded


getTypesAnnotatedWith

public java.util.Set getTypesAnnotatedWith(java.lang.Class annotation)
overrides delegate so as to log rather than throw exception if a class cannot be loaded


loadClass

protected java.lang.Class loadClass(java.lang.String className)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.