com.adeptia.indigo.utils
Class MBeanUtils

java.lang.Object
  extended by com.adeptia.indigo.utils.MBeanUtils

public class MBeanUtils
extends java.lang.Object

MBean utilities

Version:
CVS $Revision: 1.5 $

Field Summary
static java.lang.String HEART_BEAT_PERIOD
           
static java.lang.String HEART_BEAT_TRIES
           
 
Constructor Summary
MBeanUtils()
           
 
Method Summary
static javax.management.remote.JMXConnector getConnnector(javax.management.remote.JMXServiceURL url, java.util.Properties p, javax.management.NotificationListener nf)
          Creates a connection to the connector server at the given address.
static java.lang.Object getMBeanProxy(com.adeptia.indigo.system.ObjectAddress objectAddress, java.lang.Class interfaceClass)
          Provides a MBean proxy object
static java.lang.Object getMBeanProxy(com.adeptia.indigo.system.ObjectAddress objectAddress, java.lang.Class[] interfaceClasses)
          Provides a MBean proxy object for multiple interface classes
static javax.management.MBeanServerConnection getMBeanServerConnection(java.lang.String jmxJndiName)
          Returns an MBeanServerConnection object representing a remote MBean server.
static javax.management.MBeanServerConnection getMBeanServerConnection(java.lang.String jmxJndiName, int port, java.util.Properties p)
          Returns an MBeanServerConnection object representing a remote MBean server.
static javax.management.MBeanServerConnection getMBeanServerConnection(java.lang.String jmxJndiName, java.util.Properties p)
          Returns an MBeanServerConnection object representing a remote MBean server.
static boolean isConnectorAlive(java.lang.String urlPath)
          Returns true if connection to the connector server at the given address is still alive
static void registerMBean(com.adeptia.indigo.io.IndigoInputHandler inputHandler, java.lang.String streamName)
          Registers a pre-existing object as an MBean with the MBean server
static void setConnectorAlive(javax.management.NotificationListener nl, java.lang.String urlPath, boolean connectorAlive)
          Set status for connection to the connector server at the given address
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEART_BEAT_PERIOD

public static final java.lang.String HEART_BEAT_PERIOD
See Also:
Constant Field Values

HEART_BEAT_TRIES

public static final java.lang.String HEART_BEAT_TRIES
See Also:
Constant Field Values
Constructor Detail

MBeanUtils

public MBeanUtils()
Method Detail

getMBeanServerConnection

public static javax.management.MBeanServerConnection getMBeanServerConnection(java.lang.String jmxJndiName)
                                                                       throws javax.naming.NamingException,
                                                                              java.lang.Exception
Returns an MBeanServerConnection object representing a remote MBean server. For a given JMXConnector, two successful calls to this method will usually return the same MBeanServerConnection object

Parameters:
jmxJndiName -
Returns:
Throws:
javax.naming.NamingException
java.lang.Exception

getMBeanProxy

public static java.lang.Object getMBeanProxy(com.adeptia.indigo.system.ObjectAddress objectAddress,
                                             java.lang.Class interfaceClass)
                                      throws javax.naming.NamingException,
                                             java.lang.Exception
Provides a MBean proxy object

Parameters:
objectAddress -
interfaceClass -
Returns:
Throws:
javax.naming.NamingException
java.lang.Exception

getMBeanProxy

public static java.lang.Object getMBeanProxy(com.adeptia.indigo.system.ObjectAddress objectAddress,
                                             java.lang.Class[] interfaceClasses)
                                      throws javax.naming.NamingException,
                                             java.lang.Exception
Provides a MBean proxy object for multiple interface classes

Parameters:
objectAddress -
interfaceClasses -
Returns:
Throws:
javax.naming.NamingException
java.lang.Exception

registerMBean

public static void registerMBean(com.adeptia.indigo.io.IndigoInputHandler inputHandler,
                                 java.lang.String streamName)
                          throws java.lang.Exception
Registers a pre-existing object as an MBean with the MBean server

Parameters:
inputHandler - The MBean to be registered as an MBean.
streamName - The object name of the MBean.
Throws:
java.lang.Exception

getMBeanServerConnection

public static javax.management.MBeanServerConnection getMBeanServerConnection(java.lang.String jmxJndiName,
                                                                              java.util.Properties p)
                                                                       throws javax.naming.NamingException,
                                                                              java.io.IOException
Returns an MBeanServerConnection object representing a remote MBean server. For a given JMXConnector, two successful calls to this method will usually return the same MBeanServerConnection object

Parameters:
jmxJndiName -
p -
Returns:
Throws:
javax.naming.NamingException
java.io.IOException

getMBeanServerConnection

public static javax.management.MBeanServerConnection getMBeanServerConnection(java.lang.String jmxJndiName,
                                                                              int port,
                                                                              java.util.Properties p)
                                                                       throws javax.naming.NamingException,
                                                                              java.io.IOException
Returns an MBeanServerConnection object representing a remote MBean server. For a given JMXConnector, two successful calls to this method will usually return the same MBeanServerConnection object

Parameters:
jmxJndiName -
port -
p -
Returns:
Throws:
javax.naming.NamingException
java.io.IOException

getConnnector

public static javax.management.remote.JMXConnector getConnnector(javax.management.remote.JMXServiceURL url,
                                                                 java.util.Properties p,
                                                                 javax.management.NotificationListener nf)
                                                          throws java.io.IOException
Creates a connection to the connector server at the given address.

Parameters:
url - the address of the connector server to connect to
p -
nf -
Returns:
Throws:
java.io.IOException

isConnectorAlive

public static boolean isConnectorAlive(java.lang.String urlPath)
Returns true if connection to the connector server at the given address is still alive

Parameters:
urlPath - the address of the connector server to be tested
Returns:

setConnectorAlive

public static void setConnectorAlive(javax.management.NotificationListener nl,
                                     java.lang.String urlPath,
                                     boolean connectorAlive)
Set status for connection to the connector server at the given address

Parameters:
nl -
urlPath -
connectorAlive -