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

@Description(value="Classpath Monitor to be able to inspect the classpath and to find doublets") public interface ClasspathMonitorMBean
All the methods which might help you to find classpath problems are collected in this JMX interface. Most of the methods returns a String because this can be easily shown in the JConsole.
| Method Summary | |
|---|---|
void |
addMeAsShutdownHook()
To be able to register the instance as shutdown hook you can use this (non static) method. |
void |
dumpMe()
This operation dumps the different MBean attributes to a temporary file with the prefix "cpmon" (for ClasspathMonitor) and the extension ".txt". |
String[] |
getBootClasspath()
Gets the boot classpath. |
String |
getClassloaderInfo()
Returns some information about the classloader. |
String[] |
getClasspath()
Gets the normal classpath which is also available by the system property "java.class.path". |
String[] |
getClasspathClasses()
Looks in the normal classpath after all classes and returns it as String array. |
URL |
getDoublet(String name,
int n)
Returns the n'th doublet of the given classname or resource |
String[] |
getDoubletClasspath()
Looks for each found doublet in which classpath it was found. |
String[] |
getDoublets()
Looks for each loaded class if it is a doublet or not. |
URL |
getFirstDoublet(String name)
Returns the first doublet of the given classname or resource. |
String[] |
getIncompatibleClasses()
Incompatible classes are doublets with different serialVersionUID. |
String[] |
getIncompatibleClasspath()
|
String[] |
getLoadedClasses()
Returns the classes which were loaded by the classloader. |
String[] |
getLoadedPackages()
Returns the packages which were loaded by the classloader. |
String[] |
getManifestEntries(String classname)
If a MANIFEST is found for a given class the attributes in this file should be returned as a string array. |
int |
getNoClasses(String classname)
Get the number of different versions of the given class. |
int |
getNoResources(String name)
Get number of resources. |
Long |
getSerialVersionUID(String classname)
|
String[] |
getUnusedClasses()
Returns the classes which are not yet loaded. |
String[] |
getUnusedClasspath()
The unused classpath is this path which are not used in past. |
String[] |
getUsedClasspath()
Gets the loaded classpath (without the bootclasspath) as URI array. |
boolean |
isClassloaderSupported()
|
boolean |
isDoublet(String name)
Is the given classname or resource a doublet, e.g. can it be found several times in the classpath? |
boolean |
isLoaded(String classname)
Is the given classname already loaded? |
boolean |
isMultiThreadingEnabled()
Is multi threading enabled? |
boolean |
isShutdownHook()
Here you can ask if the ClasspathMonitor was already registeres ad shutdown hook. |
void |
logMe()
Prints the different MBean attributes to the log output. |
void |
removeMeAsShutdownHook()
If you want to unregister the instance as shutdown hook you can use this method. |
void |
setMultiThreadingEnabled(boolean enabled)
Here you can enable or disable the multi threading mode. |
URI |
whichClass(String name)
Looks if the given classname can be found in the classpath. |
URI |
whichResource(String name)
Looks if the given resource can be found in the classpath. |
| Method Detail |
|---|
@Description(value="returns the URI of the given resource") URI whichResource(String name)
name - of a resource e.g. "log4j.properties"
@Description(value="return the URI if the given class") URI whichClass(String name)
name - of a class e.g. "java.lang.String"
@Description(value="how often the given resource is found in the classpath") int getNoResources(String name)
name - of the resource
@Description(value="how often the given class is found in the classpath") int getNoClasses(String classname)
classname - the name of the class
@Description(value="is the given classname or resource found more than once in the classpath?")
boolean isDoublet(String name)
throws NoSuchElementException
name - a classname or resource
NoSuchElementException - if no classname or resource was found@Description(value="returns the first doublet of the given classname or resource") URL getFirstDoublet(String name)
name - a classname or resource
@Description(value="returns a sorted array of all found doublets") String[] getDoublets()
@Description(value="returns the classpath where doublets were found") String[] getDoubletClasspath()
@Description(value="returns the n\'th doublet of the given classname or resource")
URL getDoublet(String name,
int n)
name - a classname or resourcen - number of wanted doublet
@Description(value="returns an array of all loaded packages") String[] getLoadedPackages()
@Description(value="returns an array of all loaded classes") String[] getLoadedClasses()
@Description(value="is the given classname already loaded?") boolean isLoaded(String classname)
classname - the name of the class
@Description(value="returns all classes which are not yet loaded") String[] getUnusedClasses()
@Description(value="returns the classpath with the loaded classes") String[] getUsedClasspath()
@Description(value="returns the classpath which were not yet used") String[] getUnusedClasspath()
@Description(value="return ths boot classpath") String[] getBootClasspath()
@Description(value="returns the complete classpath which is seen by the application") String[] getClasspath()
@Description(value="returns all classes of the classpath") String[] getClasspathClasses()
@Description(value="returns the servialSerialVersionUID of the given class")
Long getSerialVersionUID(String classname)
throws IllegalAccessException
classname - the name of the class
IllegalAccessException - e.g. if there is no SerialVersionUID@Description(value="return the manifest entries for the given class") String[] getManifestEntries(String classname)
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.3.1_09-85 ("Apple Computer, Inc.")
Package: org.apache.commons.lang
Extension-Name: commons-lang
Specification-Version: 2.3
Specification-Vendor: Apache Software Foundation
Specification-Title: Commons Lang
Implementation-Version: 2.3
Implementation-Vendor: Apache Software Foundation
Implementation-Title: Commons Lang
Implementation-Vendor-Id: org.apache
X-Compile-Source-JDK: 1.3
X-Compile-Target-JDK: 1.1
classname - the name of the class
@Description(value="returns the doublet classes with different serialVersionUIDs") String[] getIncompatibleClasses()
@Description(value="returns the classpath where incompatible classes were found") String[] getIncompatibleClasspath()
@Description(value="returns true for classloader which are known and tested") boolean isClassloaderSupported()
@Description(value="retuns some infos about the found classloader") String getClassloaderInfo()
@Description(value="logs all attributes to the log output") void logMe()
@Description(value="dumps all attributs to the temporary file \'cpmon...txt\'") void dumpMe()
@Description(value="to register ClasspathMonitor as shutdown hook") void addMeAsShutdownHook()
@Description(value="to de-register ClasspathMonitor as shutdown hook") void removeMeAsShutdownHook()
@Description(value="returns true if ClasspathMonitor was registered as shutdown hook") boolean isShutdownHook()
boolean isMultiThreadingEnabled()
@Description(value="expermimental, don\'t change it!") void setMultiThreadingEnabled(boolean enabled)
enabled - true, if multithreading should be enabled
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||