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

java.lang.Object
  extended by ch.elca.el4j.services.monitoring.jmx.ApplicationContextMB
All Implemented Interfaces:
ApplicationContextMBMBean

public class ApplicationContextMB
extends Object
implements ApplicationContextMBMBean

The proxy class for an ApplicationContext.

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

Field Summary
static String APPLICATION_CONTEXT_DOMAIN
          The domain of the Application Context proxy as it will be registered at the MBean Server.
protected  ApplicationContext m_applicationContext
          The reference to the real Application Context.
protected  BeanFactory m_beanFactory
          The Bean Factory belonging to this Application Context.
protected  MBeanServer m_mBeanServer
          The MBean Server to which this Application Context is registered.
static String NOT_MODULE_APPLICATION_CONTEXT
          The message to be printed in case the used Application Context is not the ModuleApplicationContext.
 
Constructor Summary
ApplicationContextMB(ApplicationContext applicationContext, BeanFactory beanFactory, MBeanServer mBeanServer, JvmMB jvmmb)
          Constructor.
 
Method Summary
 String[] getExclusiveConfigLocations()
          Returns the exclusive config locations of this ApplicationContext.
 String[] getInclusiveConfigLocations()
          Returns the inclusive config locations of this ApplicationContext.
 int getInstanceCounter()
          The getter method for the instanceCounter member.
 ObjectName getJvmMB()
          Returns the JvmMB of this ApplicationContext.
 String getName()
          Returns the display name of the ApplicationContext.
 ObjectName getObjectName()
          Returns the object name of the ApplicationContext.
 String[] getResolvedConfigLocations()
          Returns the resolved config locations of this ApplicationContext, i.e.
 SpringBeanMB[] getSpringBeanMB()
          Getter for the springBeanMB member.
 ObjectName[] getSpringBeansMB()
          Returns the SpringBeans created by this ApplicationContext.
 String[] getURLClassPath()
          If loaded via maven, the application's classpath will only contain classworlds, but the modules loaded will be abailable as URLs from maven's URLClassLoader that loads the application.
 void init()
          Init method.
protected  void registerApplicationContext()
          Register this ApplicationContext at the MBean Server.
protected  void registerAtJvmMB()
          Register this ApplicationContext at the JVM MBean.
 void setInstanceCounter()
          Save the class variable s_counter to an instance member and increment the class variable by 1.
protected  void setObjectName()
          Set the objectName of this ApplicationContext.
protected  void setSpringBeanMB(SpringBeanMB[] springBeanMB)
          Setter for the springBeanMB member.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_CONTEXT_DOMAIN

public static final String APPLICATION_CONTEXT_DOMAIN
The domain of the Application Context proxy as it will be registered at the MBean Server.

See Also:
Constant Field Values

NOT_MODULE_APPLICATION_CONTEXT

public static final String NOT_MODULE_APPLICATION_CONTEXT
The message to be printed in case the used Application Context is not the ModuleApplicationContext.

See Also:
Constant Field Values

m_applicationContext

protected ApplicationContext m_applicationContext
The reference to the real Application Context.


m_mBeanServer

protected MBeanServer m_mBeanServer
The MBean Server to which this Application Context is registered.


m_beanFactory

protected BeanFactory m_beanFactory
The Bean Factory belonging to this Application Context.

Constructor Detail

ApplicationContextMB

public ApplicationContextMB(ApplicationContext applicationContext,
                            BeanFactory beanFactory,
                            MBeanServer mBeanServer,
                            JvmMB jvmmb)
Constructor.

Parameters:
applicationContext - The Application Context to which this class is a proxy.
beanFactory - The Bean Factory belonging to this Application Context.
mBeanServer - The MBean Server to which this Application Context is registered.
jvmmb - The proxy JVM in which this Application Context is running.
Method Detail

init

public void init()
          throws BaseException
Init method. Sets up this ApplicationContextMB.

Throws:
BaseException - in case the initialization failed

registerApplicationContext

protected void registerApplicationContext()
                                   throws BaseException
Register this ApplicationContext at the MBean Server.

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

registerAtJvmMB

protected void registerAtJvmMB()
Register this ApplicationContext at the JVM MBean.


setObjectName

protected void setObjectName()
Set the objectName of this ApplicationContext.


getObjectName

public ObjectName getObjectName()
Returns the object name of the ApplicationContext.

Returns:
objectName The object name of this Application Context proxy.

setInstanceCounter

public void setInstanceCounter()
Save the class variable s_counter to an instance member and increment the class variable by 1.


getInstanceCounter

public int getInstanceCounter()
The getter method for the instanceCounter member.

Returns:
The instanceCounter member

getName

public String getName()
Returns the display name of the ApplicationContext.

Specified by:
getName in interface ApplicationContextMBMBean
Returns:
display name

getSpringBeansMB

public ObjectName[] getSpringBeansMB()
Returns the SpringBeans created by this ApplicationContext.

Specified by:
getSpringBeansMB in interface ApplicationContextMBMBean
Returns:
links to all SpringBeans created by this ApplicationContext

getJvmMB

public ObjectName getJvmMB()
Returns the JvmMB of this ApplicationContext.

Specified by:
getJvmMB in interface ApplicationContextMBMBean
Returns:
JvmMB

getResolvedConfigLocations

public String[] getResolvedConfigLocations()
Returns the resolved config locations of this ApplicationContext, i.e. the inclusive config locations minus the ones defined as exclusive config locations. These resolved config locations are the ones that were loaded by the ApplicationContext.

Specified by:
getResolvedConfigLocations in interface ApplicationContextMBMBean
Returns:
Resolved config locations

getInclusiveConfigLocations

public String[] getInclusiveConfigLocations()
Returns the inclusive config locations of this ApplicationContext. The inclusive config locations are the xml configuration files which are loaded into the ApplicationContext.

Specified by:
getInclusiveConfigLocations in interface ApplicationContextMBMBean
Returns:
Inclusive config locations

getExclusiveConfigLocations

public String[] getExclusiveConfigLocations()
Returns the exclusive config locations of this ApplicationContext. The exclusive config locations are the xml configuration files which are explicitly excluded from loading, even if they appear in inclusive config locations.

Specified by:
getExclusiveConfigLocations in interface ApplicationContextMBMBean
Returns:
Exclusive config locations

getURLClassPath

public String[] getURLClassPath()
If loaded via maven, the application's classpath will only contain classworlds, but the modules loaded will be abailable as URLs from maven's URLClassLoader that loads the application.

Specified by:
getURLClassPath in interface ApplicationContextMBMBean
Returns:
If loaded via an URLClassLoader (maven), the URLs in the current "classpath".

setSpringBeanMB

protected void setSpringBeanMB(SpringBeanMB[] springBeanMB)
Setter for the springBeanMB member.

Parameters:
springBeanMB - The value to set

getSpringBeanMB

public SpringBeanMB[] getSpringBeanMB()
Getter for the springBeanMB member.

Returns:
The value of the springBeanMB member


Copyright © 2005-2011 ELCA. All Rights Reserved.