|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.monitor.ClasspathDigger
public final class ClasspathDigger
This helper class digs into found classloader for information like used classpath and other things. It was extracted from ClasspathMonitor to separate the classloader specific part of it into its own class. If you want to support an unknown classloader you can subclass this class and together with ClasspathMonitor.
| Field Summary | |
|---|---|
protected static ObjectName |
AGENT_MBEAN
The ClasspathAgent as MBean. |
| Constructor Summary | |
|---|---|
ClasspathDigger()
Instantiates a new classpath digger. |
|
ClasspathDigger(ClassLoader cloader)
Instantiates a new classpath digger. |
|
| Method Summary | |
|---|---|
String[] |
getBootClasspath()
To get the boot classpath the sytem property "sun.boot.class.path" is used to get them. |
ClassLoader |
getClassLoader()
Gets the class loader. |
String[] |
getClasspath()
We can use the system property "java.class.path" to get the classpath. |
protected static String[] |
getClasspath(String key)
Gets the classpath. |
protected String[] |
getClasspathFromPackages()
Here we use the loaded packages to calculate the classpath. |
List<Class<?>> |
getLoadedClassList()
Returns a list of classes which were loaded by the given classloader. |
protected List<Class<?>> |
getLoadedClassListFromAgent()
Gets the loaded class list from patterntesting-agent. |
Package[] |
getLoadedPackageArray()
Returns the packages which were loaded by the classloader. |
static boolean |
isAgentAvailable()
Checks if the ClasspathAgent is available as MBean. |
boolean |
isClassloaderSupported()
Checks if is classloader supported. |
boolean |
isLoaded(String classname)
Checks if the given classname is loaded. |
String |
toString()
Puts also the classloader in the toString representation. |
URI |
whichResource(String name)
Returns the URI of the given resource and the given classloader. |
static URI |
whichResource(String name,
ClassLoader cloader)
Returns the URI of the given resource and the given classloader. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final ObjectName AGENT_MBEAN
| Constructor Detail |
|---|
public ClasspathDigger()
public ClasspathDigger(ClassLoader cloader)
cloader - the cloader| Method Detail |
|---|
public ClassLoader getClassLoader()
public boolean isClassloaderSupported()
public static boolean isAgentAvailable()
public String[] getBootClasspath()
public String[] getClasspath()
protected static String[] getClasspath(String key)
key - the key
public Package[] getLoadedPackageArray()
protected String[] getClasspathFromPackages()
public URI whichResource(String name)
name - resource name (e.g. "log4j.properties")
public static URI whichResource(String name,
ClassLoader cloader)
name - resource name (e.g. "log4j.properties")cloader - class loader
public boolean isLoaded(String classname)
classname - name of the class
public String toString()
toString in class ObjectObject.toString()public List<Class<?>> getLoadedClassList()
protected List<Class<?>> getLoadedClassListFromAgent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||