org.ow2.jasmine.jadort.service.action
Class AbstractJMXAction

java.lang.Object
  extended by org.ow2.jasmine.jadort.service.action.AbstractAction
      extended by org.ow2.jasmine.jadort.service.action.AbstractJMXAction
Direct Known Subclasses:
ServerAction, VMMAction

public abstract class AbstractJMXAction
extends AbstractAction

Action for any JMX-based action.

Author:
Malek Chahine, S. Ali Tokmen

Field Summary
protected  javax.management.remote.JMXConnector connector
           
static long JMX_CHECK_TIMEOUT
          Timeout for checking JMX connections, in seconds.
static long JMX_CONNECT_TIMEOUT
          Timeout for establishing JMX connections, in seconds.
protected  javax.management.MBeanServerConnection mbscnx
           
 
Constructor Summary
AbstractJMXAction()
           
 
Method Summary
 void checkJMXConnection()
          Checks if the JMX connection is still alive and reconnects if necessary.
protected abstract  void connectViaJMX()
          Connects via JMX.
 void disconnectJMX()
          Disconnects all JMX-related resources.
protected  void establishJMXConnection(javax.management.remote.JMXServiceURL url, java.util.Map<java.lang.String,java.lang.Object> env)
          Establish a JMX connection, either with a timeout or not.
 
Methods inherited from class org.ow2.jasmine.jadort.service.action.AbstractAction
appendToLog, flushLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JMX_CONNECT_TIMEOUT

public static final long JMX_CONNECT_TIMEOUT
Timeout for establishing JMX connections, in seconds.

If 0 or negative, no timeout is ever used.

See Also:
Constant Field Values

JMX_CHECK_TIMEOUT

public static final long JMX_CHECK_TIMEOUT
Timeout for checking JMX connections, in seconds.

If 0 or negative, no timeout is ever used.

See Also:
Constant Field Values

mbscnx

protected javax.management.MBeanServerConnection mbscnx

connector

protected javax.management.remote.JMXConnector connector
Constructor Detail

AbstractJMXAction

public AbstractJMXAction()
Method Detail

establishJMXConnection

protected void establishJMXConnection(javax.management.remote.JMXServiceURL url,
                                      java.util.Map<java.lang.String,java.lang.Object> env)
                               throws java.lang.Exception
Establish a JMX connection, either with a timeout or not.

Parameters:
url - URL to connect to.
env - JMX environment.
Throws:
java.lang.Exception - If any exception occurs.

checkJMXConnection

public void checkJMXConnection()
                        throws java.lang.Exception
Checks if the JMX connection is still alive and reconnects if necessary.

Throws:
java.lang.Exception - If any error occurs when reconnecting.

connectViaJMX

protected abstract void connectViaJMX()
                               throws java.lang.Exception
Connects via JMX. This is expected to call establishJMXConnection(JMXServiceURL, Map) at some point.

Throws:
java.lang.Exception - If any exception occurs.

disconnectJMX

public void disconnectJMX()
Disconnects all JMX-related resources.



Copyright © 2010 OW2 Consortium. All Rights Reserved.