com.maxiq.tools.jboss
Class JMXRMIAdaptor

java.lang.Object
  |
  +--com.maxiq.tools.jboss.JMXRMIAdaptor

public class JMXRMIAdaptor
extends java.lang.Object

Worker class for JMX requests. Uses reflection to avoid compile-time dependencies on JBoss-specific classes (i.e. RMIAdaptor). Creation of this class must be made only in the context of a properly set-up JBossLibClassLoader.

Author:
Florin Vancea

Constructor Summary
JMXRMIAdaptor(java.lang.String serverName)
          Constructor from a server name.
JMXRMIAdaptor(java.lang.String jndiURL, java.lang.String rmiJndiName)
          Constructor from JNDI URL of target server and JNDI name of RMI adapter.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String objectName, java.lang.String attrName)
          Obtains the value of an attribute on a remote MBean.
 java.lang.Object invoke(java.lang.String objectName, java.lang.String methodName, java.lang.Object[] args, java.lang.String[] typeName)
          Invokes a method on a remote MBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMXRMIAdaptor

public JMXRMIAdaptor(java.lang.String serverName)
              throws JBossNotAvailable
Constructor from a server name. The name is used to build the JNDI name that holds the JBoss RMIAdaptor object wrapped in this JMXRMIAdaptor. That JNDI name will be "jmx:serverName:rmi". Note that JBoss 3.2 has changed this naming convention, but still supports it.
Parameters:
serverName - The name of the server machine.
Throws:
JBossNotAvailable - when there is a naming exception, usually indicating that the JBoss instance is not running.

JMXRMIAdaptor

public JMXRMIAdaptor(java.lang.String jndiURL,
                     java.lang.String rmiJndiName)
              throws JBossNotAvailable
Constructor from JNDI URL of target server and JNDI name of RMI adapter.
Parameters:
jndiURL - Seed URL of target server JNDI system
rmiJndiName - JNDI name of RMI adaptor.
Throws:
JBossNotAvailable - when there is a naming exception, usually indicating that the JBoss instance is not running.
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String objectName,
                                     java.lang.String attrName)
Obtains the value of an attribute on a remote MBean. It's similar to getAttribute(...) method of the RMIAdaptor from the JBoss kit.
Parameters:
objectName - Name of the MBean. (Note: in RMIAdaptor this is a ObjectName)
attrName - The name of the attribute.
Returns:
The attribute value

invoke

public java.lang.Object invoke(java.lang.String objectName,
                               java.lang.String methodName,
                               java.lang.Object[] args,
                               java.lang.String[] typeName)
Invokes a method on a remote MBean. It's similar to the invoke(...) method of the RMIAdaptor from the JBoss kit.
Parameters:
objectName - Name of the MBean. (Note: in RMIAdaptor this is a ObjectName)
methodName - Method name.
args - Array of arguments passed as plain Object(s)
typeName - Array of type names passed as String(s).
Returns:
The result of the call, if any.


Copyright © 2003 MaxIQ. All Rights Reserved.