Interface ResourcepathMonitorMBean
- All Superinterfaces:
AbstractMonitorMBean
,Runnable
,Shutdownable
- All Known Implementing Classes:
ResourcepathMonitor
@Description("Resourcepath Monitor to be able to inspect the classpath for resources and to find doublets")
public interface ResourcepathMonitorMBean
extends AbstractMonitorMBean
All the methods which might help you to find classpath problems with
resources are collected in this JMX interface. Most of the methods returns a
String because this can be easily shown in the JConsole.
- Version:
- $
- Author:
- oliver
-
Method Summary
Modifier and TypeMethodDescriptiongetDoublet
(String name, int n) Returns the n'th doublet of the given classname or resource.String[]
Looks for each found doublet resource in which classpath it was found.String[]
Looks for each loaded resource if it has a doublet or not.getFirstDoublet
(String name) Returns the first doublet of the given classname or resource.String[]
Gets the incompatible classpath.String[]
Incompatible resources are doublets with different content.int
getNoResources
(String name) Get number of resources.String[]
Looks in the normal classpath after all resources and returns it as String array.boolean
Is the given classname or resource a doublet, e.g. can it be found several times in the classpath?whichResource
(String name) Looks if the given resource can be found in the classpath.Methods inherited from interface clazzfish.monitor.AbstractMonitorMBean
dumpMe, dumpMe, getDumpDir, logMe
Methods inherited from interface clazzfish.monitor.util.Shutdownable
addMeAsShutdownHook, isShutdownHook, removeMeAsShutdownHook
-
Method Details
-
whichResource
Looks if the given resource can be found in the classpath.To avoid problems like "java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object; nested exception is: java.io.IOException: unknown protocol: zip" no longer a URL but URI is now returned
- Parameters:
name
- of a resource e.g. "log4j.properties"- Returns:
- URI of the given resource (or null if resource was not found)
-
getResources
Looks in the normal classpath after all resources and returns it as String array.- Returns:
- all found resources in the classpath
-
getNoResources
@Description("how often the given resource is found in the classpath") int getNoResources(String name) Get number of resources.- Parameters:
name
- of the resource- Returns:
- how often the resource was found
-
isDoublet
@Description("is the given classname or resource found more than once in the classpath?") boolean isDoublet(String name) throws NoSuchElementException Is the given classname or resource a doublet, e.g. can it be found several times in the classpath? If the classname or resource is not in the classpath a java.util.NoSuchElementException will be thrown.- Parameters:
name
- a classname or resource- Returns:
- true if more than one classname or resource was found in the classpath
- Throws:
NoSuchElementException
- the no such element exceptionNoSuchElementException
- if no classname or resource was found
-
getFirstDoublet
@Description("returns the first doublet of the given classname or resource") URI getFirstDoublet(String name) Returns the first doublet of the given classname or resource.- Parameters:
name
- a classname or resource- Returns:
- the first doublet
-
getDoublet
@Description("returns the n'th doublet of the given classname or resource") URI getDoublet(String name, int n) Returns the n'th doublet of the given classname or resource.- Parameters:
name
- a classname or resourcen
- number of wanted doublet- Returns:
- the n'th doublet URL
-
getDoublets
Looks for each loaded resource if it has a doublet or not.- Returns:
- a sorted array with the found doublets
-
getDoubletResourcepath
Looks for each found doublet resource in which classpath it was found. Resources like META-INF/MANIFEST.MF which you would find each jar file should be not considered as doublet - otherwise you'll find all classpathes in the array.- Returns:
- the classpath where doublets were found
-
getIncompatibleResources
@Description("returns the doublet resources with different content") String[] getIncompatibleResources()Incompatible resources are doublets with different content.- Returns:
- doublet resources with different content
-
getIncompatibleResourcepath
@Description("returns the classpath where incompatible resources were found") String[] getIncompatibleResourcepath()Gets the incompatible classpath.- Returns:
- the classpathes where incompatible classes were found
-