net.sf.appstatus.jmx
Class StatusJmx

java.lang.Object
  extended by net.sf.appstatus.jmx.StatusJmx
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

@ManagedResource(objectName="AppStatus:bean=ServicesStatusChecker")
public class StatusJmx
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

JMX exposure of StatusChecker beans.

Author:
LABEMONT

Constructor Summary
StatusJmx()
           
 
Method Summary
protected  java.lang.String formatCodeDisplay(int code)
          Human readable code format.
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getFullStatus()
           
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getServicesProperties()
           
 java.util.Map<java.lang.String,java.lang.String> getStatus()
           
 void init()
          Load configuration from /status-jmx-conf.properties file.
 void setApplicationContext(org.springframework.context.ApplicationContext springApplicationContext)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusJmx

public StatusJmx()
Method Detail

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware

getStatus

@ManagedAttribute(description="Status list",
                  currencyTimeLimit=15)
public java.util.Map<java.lang.String,java.lang.String> getStatus()

getFullStatus

@ManagedAttribute(description="Full status list : display return code, description and resolution steps.",
                  currencyTimeLimit=15)
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getFullStatus()

getServicesProperties

@ManagedAttribute(description="The services properties")
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getServicesProperties()

formatCodeDisplay

protected java.lang.String formatCodeDisplay(int code)
Human readable code format.

Parameters:
code -
Returns:
the code from ICheckResult or the int code if not found

init

public void init()
Load configuration from /status-jmx-conf.properties file.
If not found look for Spring beans.


setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext springApplicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException


Copyright © 2010-2011. All Rights Reserved.