com.maxiq.tools.jboss
Class JMXBean

java.lang.Object
  |
  +--com.maxiq.tools.jboss.JMXBean
Direct Known Subclasses:
JMXDeploymentMonitor

public class JMXBean
extends java.lang.Object

Main generic bean for JMX access.
Note that the system property com.maxiq.tools.jboss.home" should be properly set to the home of a running JBoss installation.

Author:
Florin Vancea

Constructor Summary
JMXBean()
          Plain bean constructor.
 
Method Summary
 void addArgument(java.lang.Object arg)
          Adds a new argument.
 void addArgument(java.lang.Object arg, java.lang.String typename)
          Adds a new typed argument.
 void clearArguments()
          Reset/clears the argument list.
protected  void doExecute()
          Internal method to perform the actual call
 void execute()
          "execute" method allows using this as Ant task via Ant's proxy.
 java.lang.String getJbhome()
          Gets the JBoss home as set in system property "com.maxiq.tools.jboss.home".
 java.lang.String getJndiurl()
          Gets the JNDI URL of target server.
 java.lang.Object getLastReturnValue()
          Get the returned value (if any) from the last successful call to execute().
 java.lang.String getMbean()
          Gets the target MBean name.
 java.lang.String getMethod()
          Gets the target method name.
 java.lang.String getRmijndiname()
          Gets the JNDI name of RMI adapter.
 java.lang.String getServerName()
          Gets the server name.
 boolean isServerAlive()
          Finds out if the server is responding.
 void setetRmijndiname(java.lang.String aRmiJndiName)
          Sets the JNDI URL of target server.
 void setJbhome(java.lang.String newJBHome)
          Gets the JBoss home directly into system property "com.maxiq.tools.jboss.home".
 void setJndiurl(java.lang.String aJndiUrl)
          Sets the JNDI URL of target server.
 void setMbean(java.lang.String newMbean)
          Sets the target MBean name.
 void setMethod(java.lang.String newMethod)
          Sets the target method name.
 void setServerName(java.lang.String newServerName)
          Sets the server name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMXBean

public JMXBean()
Plain bean constructor.
Method Detail

getServerName

public java.lang.String getServerName()
Gets the server name.
Returns:
The current server name.

setServerName

public void setServerName(java.lang.String newServerName)
Sets the server name. If set to null, it tries to fall back to local host name (may not succeed). No additional checks are made.
Parameters:
newServerName - New server name.

getJndiurl

public java.lang.String getJndiurl()
Gets the JNDI URL of target server.
Returns:
JNDI URL of target server.

setJndiurl

public void setJndiurl(java.lang.String aJndiUrl)
Sets the JNDI URL of target server.

getRmijndiname

public java.lang.String getRmijndiname()
Gets the JNDI name of RMI adapter.
Returns:
JNDI name of RMI adapter.

setetRmijndiname

public void setetRmijndiname(java.lang.String aRmiJndiName)
Sets the JNDI URL of target server.

getMbean

public java.lang.String getMbean()
Gets the target MBean name.
Returns:
The target MBean name.

setMbean

public void setMbean(java.lang.String newMbean)
Sets the target MBean name.
Parameters:
newMbean - New target MBean name.

getMethod

public java.lang.String getMethod()
Gets the target method name.
Returns:
The target method name.

setMethod

public void setMethod(java.lang.String newMethod)
Sets the target method name.
Parameters:
newMethod - New target method name.

getJbhome

public java.lang.String getJbhome()
Gets the JBoss home as set in system property "com.maxiq.tools.jboss.home".
Returns:
The JBoss home.

setJbhome

public void setJbhome(java.lang.String newJBHome)
Gets the JBoss home directly into system property "com.maxiq.tools.jboss.home".
Parameters:
newMbean - New JBoss home.

clearArguments

public void clearArguments()
Reset/clears the argument list.

addArgument

public void addArgument(java.lang.Object arg)
Adds a new argument. Argument type is auto-determined. If adding null, the type is supposed to be "java.lang.String"
Parameters:
arg - The argument to add.

addArgument

public void addArgument(java.lang.Object arg,
                        java.lang.String typename)
Adds a new typed argument.
Parameters:
arg - The argument value
typename - The argument type (class name) as a String

getLastReturnValue

public java.lang.Object getLastReturnValue()
Get the returned value (if any) from the last successful call to execute().
Returns:
The value as Object

execute

public void execute()
             throws JBossNotAvailable
"execute" method allows using this as Ant task via Ant's proxy. For this plain class, execute allows only calls with no return value (or discarded return value) and no params, because there is no simple mechanism to add arguments from proxied Ant task-beans.
Throws:
JBossNotAvailable - when it seems there's no JBoss to talk with

isServerAlive

public boolean isServerAlive()
Finds out if the server is responding. Used in bean mode.
Returns:
true if the server seems to be available.

doExecute

protected void doExecute()
                  throws JBossNotAvailable
Internal method to perform the actual call
Throws:
JBossNotAvailable - when it seems there's no JBoss to talk with


Copyright © 2003 MaxIQ. All Rights Reserved.