Interface ClasspathAgentMBean
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ClasspathAgent
This is the MBean for the
ClasspathAgent
to be able to register
this class for a JMX console like jconsole or visualvm.
Originally this interface was part of patterntesting-agent.- Author:
- oliver
-
Method Summary
Modifier and TypeMethodDescriptionThis operation dumps the loaded classes to a temporary file with the prefix "dumpLoadedClasses" and the extension ".txt".void
dumpLoadedClasses
(String filename) This operation dumps the loaded classes to the given file.getArgs()
Get the arguments from the call as agent.Class<?>[]
Returns the classes which were loaded by the classloader.Class<?>[]
getLoadedClasses
(ClassLoader classloader) Gets the loaded classes.String[]
Returns the classes which were loaded by the classloader.boolean
isActive()
Checks if agent is active.void
Prints the loaded classes to the log output.
-
Method Details
-
isActive
boolean isActive()Checks if agent is active. This is true if this class here was started as Java agent.- Returns:
- true, if started as Java agent
-
getArgs
-
getLoadedClasses
Class<?>[] getLoadedClasses()Returns the classes which were loaded by the classloader. NOTE: Although the 'jconsole' displays the classes as 'unavailable' do not remove it. It is needed by the ClasspathDigger class in PatternTesting Runtime to get the loaded classes.- Returns:
- the classes as string array
-
getLoadedClassnames
String[] getLoadedClassnames()Returns the classes which were loaded by the classloader. The loaded packages are returned as string array so that it can be displayed by the 'jconsole'.- Returns:
- the classnames as string array
-
getLoadedClasses
Gets the loaded classes.- Parameters:
classloader
- the classloader- Returns:
- the loaded classes
-
logLoadedClasses
void logLoadedClasses()Prints the loaded classes to the log output.- Since:
- 1.5
-
dumpLoadedClasses
This operation dumps the loaded classes to a temporary file with the prefix "dumpLoadedClasses" and the extension ".txt". To be able to see the name of the temporary file in the 'jconsole' it should be returned as value.- Returns:
- the temporary file
- Throws:
IOException
- Signals that an I/O exception has occurred.- Since:
- 1.5
-
dumpLoadedClasses
This operation dumps the loaded classes to the given file.- Parameters:
filename
- the file where the classes are dumped to.- Throws:
IOException
- Signals that an I/O exception has occurred.- Since:
- 1.5
-