ch.elca.el4j.services.monitoring.jmx
Class Loader

java.lang.Object
  extended by ch.elca.el4j.services.monitoring.jmx.Loader
All Implemented Interfaces:
EventListener, InitializingBean, ApplicationContextAware, ApplicationListener

public class Loader
extends Object
implements ApplicationContextAware, InitializingBean, ApplicationListener

Entry point for the JMX package. If this bean is defined in an Application Context, then it will set up the whole JMX world by creating the proxies and setting the corresponding references.

Author:
Raphael Boog (RBO), Rashid Waraich (RWA)
File-location:
Loader
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Field Summary
protected  ApplicationContextMB m_acMB
          The Application Context proxy for the Application Context containing this loader.
protected  JvmMB m_jvmmb
          The JVM proxy containing this Application Context.
protected static Map<MBeanServer,JvmMBMBean> s_jvmMBs
          A map containing the MBean Server as key and the JvmMB as value.
 
Constructor Summary
Loader()
           
 
Method Summary
 void afterPropertiesSet()
          
 ConfigurableApplicationContext getApplicationContext()
          Getter method for the Application Context.
 ObjectName[] getObjectNames(MBeanServer server, String domain, String keyProperty, String value)
          Returns all object names of the beans in the domain "domain" and where "keyProperty"="name" which are registered on the MBeanServer server.
 MBeanServer getServer()
          Returns the MBean Server of this ApplicationContext.
protected  void init()
          Creates the "Real World" image of the given Application Context by setting up the corresponding JMX objects.
 boolean isInitAfterPropertiesSet()
           
 void onApplicationEvent(ApplicationEvent event)
          
protected static void registerJdk15Mbean(MBeanServer ms)
          Registers JDK 1.5 MBeans.
 void setApplicationContext(ApplicationContext applicationContext)
          The ApplicationContext is set via ApplicationContextAware.
 void setInitAfterPropertiesSet(boolean initAfterPropertiesSet)
           
protected  void setJvmMB()
          Takes the JvmMB Bean from the MBean Server or creates a new JvmMB if no such bean is registered at the MBean Server.
 void setServer(MBeanServer server)
          Sets the MBean Server of this ApplicationContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_jvmMBs

protected static final Map<MBeanServer,JvmMBMBean> s_jvmMBs
A map containing the MBean Server as key and the JvmMB as value.


m_acMB

protected ApplicationContextMB m_acMB
The Application Context proxy for the Application Context containing this loader.


m_jvmmb

protected JvmMB m_jvmmb
The JVM proxy containing this Application Context.

Constructor Detail

Loader

public Loader()
Method Detail

getServer

public MBeanServer getServer()
Returns the MBean Server of this ApplicationContext.

Returns:
Returns the MBean Server.

setServer

public void setServer(MBeanServer server)
Sets the MBean Server of this ApplicationContext.

Parameters:
server - The MBean Server to set.

setJvmMB

protected void setJvmMB()
                 throws BaseException
Takes the JvmMB Bean from the MBean Server or creates a new JvmMB if no such bean is registered at the MBean Server. The JvmMBs have to be stored in a static map for later Application Contexts referring to the same MBeanServer.

Throws:
BaseException - in case the registration at the MBean Server failed

getObjectNames

public ObjectName[] getObjectNames(MBeanServer server,
                                   String domain,
                                   String keyProperty,
                                   String value)
Returns all object names of the beans in the domain "domain" and where "keyProperty"="name" which are registered on the MBeanServer server.

Parameters:
server - the MBean Server
domain - the domain of the wanted beans
keyProperty - the key property (e.g. name) as registered on the MBean Server
value - the value of the key property
Returns:
an array of object names satisfying the constraints

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
The ApplicationContext is set via ApplicationContextAware.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - The Application Context delivered by the ApplicationContextAware

getApplicationContext

public ConfigurableApplicationContext getApplicationContext()
Getter method for the Application Context.

Returns:
The Application Context containing this loader object

isInitAfterPropertiesSet

public final boolean isInitAfterPropertiesSet()
Returns:
Returns the initAfterPropertiesSet.

setInitAfterPropertiesSet

public final void setInitAfterPropertiesSet(boolean initAfterPropertiesSet)
Parameters:
initAfterPropertiesSet - Is the initAfterPropertiesSet to set.

afterPropertiesSet

public void afterPropertiesSet()
                        throws BaseException

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
BaseException
See Also:
init()

onApplicationEvent

public void onApplicationEvent(ApplicationEvent event)

Specified by:
onApplicationEvent in interface ApplicationListener
See Also:
init()

init

protected void init()
             throws BaseException
Creates the "Real World" image of the given Application Context by setting up the corresponding JMX objects.

Throws:
BaseException - On failure.

registerJdk15Mbean

protected static void registerJdk15Mbean(MBeanServer ms)
Registers JDK 1.5 MBeans.

Parameters:
ms - The MBeanServer.


Copyright © 2005-2011 ELCA. All Rights Reserved.