Package net.welen.jmole
Class JMole
- java.lang.Object
-
- javax.management.NotificationBroadcasterSupport
-
- net.welen.jmole.JMole
-
- All Implemented Interfaces:
NotificationBroadcaster,NotificationEmitter,JMoleMBean
public class JMole extends NotificationBroadcasterSupport implements JMoleMBean
The MBean implementation of JMole and more or less the main class
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIG_FILENAME_PROPERTY_PREFIXstatic StringCONFIG_FILENAME_XSLT_PROPERTY_PREFIXstatic StringCONFIG_FILENAMES_PROPERTYstatic StringCONFIG_LEVEL_PROPERTYstatic StringNOTIFICATION_TYPEstatic StringOBJECT_NAME
-
Constructor Summary
Constructors Constructor Description JMole()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectcollectMeasurement(String category, String name, String attribute)Collects all measurements stated in the current configuration that matches the provided parametersStringcollectMeasurementAsJSON(String category, String name, String attribute)Map<String,List<Map<String,Map<String,Object>>>>collectMeasurements()Collects all measurements stated in the current configurationMap<String,Map<String,Object>>collectMeasurements(String category)Collects all measurements stated in the current configuration that matches the provided parametersMap<String,Object>collectMeasurements(String category, String name)Collects all measurements stated in the current configuration that matches the provided parametersMap<String,Map<String,Object>>collectMeasurements(String category, Map<Object,net.welen.jmole.presentation.PresentationInformation> presentationInformation)Map<String,List<Map<String,Map<String,Object>>>>collectMeasurements(Map<Object,net.welen.jmole.presentation.PresentationInformation> presentationInformation)StringcollectMeasurementsAsJSON()StringcollectMeasurementsAsJSON(String category)StringcollectMeasurementsAsJSON(String category, String name)voidconfigure()Read and parses the config files and construct a new internal java representation.Map<String,Map<String,String>>criticalMessages()Get all currently triggered critical thresholdsStringcriticalMessagesAsJSON()String[]getAllJMoleSystemProperties()StringgetConfigFileNames()List<Configuration>getConfiguration()Get the current configurationintgetLevel()intgetNumberOfConfigurations()intgetNumberOfThresholds()intgetNumberOfThresholdThreads()voidregister()Register the JMole MBeanvoidunregister()Unregister the JMole MBeanMap<String,Map<String,String>>warningMessages()Get all currently triggered warning thresholdsStringwarningMessagesAsJSON()-
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
-
-
-
-
Field Detail
-
OBJECT_NAME
public static final String OBJECT_NAME
- See Also:
- Constant Field Values
-
CONFIG_FILENAMES_PROPERTY
public static final String CONFIG_FILENAMES_PROPERTY
- See Also:
- Constant Field Values
-
CONFIG_FILENAME_PROPERTY_PREFIX
public static final String CONFIG_FILENAME_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
CONFIG_FILENAME_XSLT_PROPERTY_PREFIX
public static final String CONFIG_FILENAME_XSLT_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
CONFIG_LEVEL_PROPERTY
public static final String CONFIG_LEVEL_PROPERTY
- See Also:
- Constant Field Values
-
NOTIFICATION_TYPE
public static final String NOTIFICATION_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
register
public void register() throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, MalformedObjectNameException, InstanceNotFoundExceptionRegister the JMole MBean
-
unregister
public void unregister() throws MalformedObjectNameException, InstanceNotFoundException, MBeanRegistrationExceptionUnregister the JMole MBean
-
configure
public void configure() throws MalformedObjectNameException, FileNotFoundException, MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, IntrospectionExceptionDescription copied from interface:JMoleMBeanRead and parses the config files and construct a new internal java representation. Also activates any thresholds present in that config
-
getConfigFileNames
public String getConfigFileNames()
- Specified by:
getConfigFileNamesin interfaceJMoleMBean
-
getConfiguration
public List<Configuration> getConfiguration()
Get the current configuration- Returns:
- The configuration in for av classes
-
collectMeasurements
public Map<String,List<Map<String,Map<String,Object>>>> collectMeasurements() throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
Description copied from interface:JMoleMBeanCollects all measurements stated in the current configuration- Specified by:
collectMeasurementsin interfaceJMoleMBean- Returns:
- A complex Map of data
- Throws:
InstanceNotFoundExceptionReflectionExceptionMBeanExceptionAttributeNotFoundExceptionIntrospectionException
-
collectMeasurements
public Map<String,List<Map<String,Map<String,Object>>>> collectMeasurements(Map<Object,net.welen.jmole.presentation.PresentationInformation> presentationInformation) throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
-
collectMeasurementsAsJSON
public String collectMeasurementsAsJSON() throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
- Specified by:
collectMeasurementsAsJSONin interfaceJMoleMBean- Throws:
InstanceNotFoundExceptionReflectionExceptionMBeanExceptionAttributeNotFoundExceptionIntrospectionException
-
collectMeasurements
public Map<String,Map<String,Object>> collectMeasurements(String category) throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
Description copied from interface:JMoleMBeanCollects all measurements stated in the current configuration that matches the provided parameters- Specified by:
collectMeasurementsin interfaceJMoleMBean- Parameters:
category- The category- Returns:
- A complex Map of data
- Throws:
InstanceNotFoundExceptionReflectionExceptionMBeanExceptionAttributeNotFoundExceptionIntrospectionException
-
collectMeasurements
public Map<String,Map<String,Object>> collectMeasurements(String category, Map<Object,net.welen.jmole.presentation.PresentationInformation> presentationInformation) throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
-
collectMeasurementsAsJSON
public String collectMeasurementsAsJSON(String category) throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
- Specified by:
collectMeasurementsAsJSONin interfaceJMoleMBean- Throws:
InstanceNotFoundExceptionReflectionExceptionMBeanExceptionAttributeNotFoundExceptionIntrospectionException
-
collectMeasurements
public Map<String,Object> collectMeasurements(String category, String name) throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
Description copied from interface:JMoleMBeanCollects all measurements stated in the current configuration that matches the provided parameters- Specified by:
collectMeasurementsin interfaceJMoleMBean- Parameters:
category- The categoryname- The name of the measurement group- Returns:
- A complex Map of data
- Throws:
InstanceNotFoundExceptionReflectionExceptionMBeanExceptionAttributeNotFoundExceptionIntrospectionException
-
collectMeasurementsAsJSON
public String collectMeasurementsAsJSON(String category, String name) throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
- Specified by:
collectMeasurementsAsJSONin interfaceJMoleMBean- Throws:
InstanceNotFoundExceptionReflectionExceptionMBeanExceptionAttributeNotFoundExceptionIntrospectionException
-
collectMeasurement
public Object collectMeasurement(String category, String name, String attribute) throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
Description copied from interface:JMoleMBeanCollects all measurements stated in the current configuration that matches the provided parameters- Specified by:
collectMeasurementin interfaceJMoleMBean- Parameters:
category- The categoryname- The name of the measurement groupattribute- The attribute- Returns:
- A complex Map of data
- Throws:
InstanceNotFoundExceptionReflectionExceptionMBeanExceptionAttributeNotFoundExceptionIntrospectionException
-
collectMeasurementAsJSON
public String collectMeasurementAsJSON(String category, String name, String attribute) throws InstanceNotFoundException, ReflectionException, MBeanException, AttributeNotFoundException, IntrospectionException
- Specified by:
collectMeasurementAsJSONin interfaceJMoleMBean- Throws:
InstanceNotFoundExceptionReflectionExceptionMBeanExceptionAttributeNotFoundExceptionIntrospectionException
-
warningMessages
public Map<String,Map<String,String>> warningMessages() throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException
Description copied from interface:JMoleMBeanGet all currently triggered warning thresholds- Specified by:
warningMessagesin interfaceJMoleMBean- Returns:
- The warnings
- Throws:
AttributeNotFoundExceptionInstanceNotFoundExceptionMBeanExceptionReflectionException
-
warningMessagesAsJSON
public String warningMessagesAsJSON() throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException
- Specified by:
warningMessagesAsJSONin interfaceJMoleMBean- Throws:
AttributeNotFoundExceptionInstanceNotFoundExceptionMBeanExceptionReflectionException
-
criticalMessages
public Map<String,Map<String,String>> criticalMessages() throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException
Description copied from interface:JMoleMBeanGet all currently triggered critical thresholds- Specified by:
criticalMessagesin interfaceJMoleMBean- Returns:
- The critical errors
- Throws:
AttributeNotFoundExceptionInstanceNotFoundExceptionMBeanExceptionReflectionException
-
criticalMessagesAsJSON
public String criticalMessagesAsJSON() throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException
- Specified by:
criticalMessagesAsJSONin interfaceJMoleMBean- Throws:
AttributeNotFoundExceptionInstanceNotFoundExceptionMBeanExceptionReflectionException
-
getLevel
public int getLevel()
- Specified by:
getLevelin interfaceJMoleMBean
-
getNumberOfThresholdThreads
public int getNumberOfThresholdThreads()
- Specified by:
getNumberOfThresholdThreadsin interfaceJMoleMBean
-
getNumberOfConfigurations
public int getNumberOfConfigurations()
- Specified by:
getNumberOfConfigurationsin interfaceJMoleMBean
-
getNumberOfThresholds
public int getNumberOfThresholds()
- Specified by:
getNumberOfThresholdsin interfaceJMoleMBean
-
getAllJMoleSystemProperties
public String[] getAllJMoleSystemProperties()
- Specified by:
getAllJMoleSystemPropertiesin interfaceJMoleMBean
-
-