# Class JMXAccessorConditionBase

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.catalina.ant.jmx.JMXAccessorConditionBase

All Implemented Interfaces:
  `Cloneable, org.apache.tools.ant.taskdefs.condition.Condition`

Direct Known Subclasses:
  `JMXAccessorCondition, JMXAccessorEqualsCondition`

public abstract class JMXAccessorConditionBase extends org.apache.tools.ant.ProjectComponent implements org.apache.tools.ant.taskdefs.condition.Condition
Base class for JMX accessor conditions.

## Field Summary

### Fields inherited from class org.apache.tools.ant.ProjectComponent

`description, location, project`

## Constructor Summary

Constructors
Constructor
Description
`JMXAccessorConditionBase()`
Constructs a new JMXAccessorConditionBase.

## Method Summary

Modifier and Type
Method
Description
`protected String`
`accessJMXValue()`
Get value from MBeans attribute.
`String`
`getAttribute()`
Get the attribute name.
`String`
`getHost()`
Get the JMX host.
`protected MBeanServerConnection`
`getJMXConnection()`
Get JMXConnection (default look at jmx.server project reference from jmxOpen Task).
`String`
`getName()`
Get the MBean object name.
`String`
`getPassword()`
Get the JMX password.
`String`
`getPort()`
Get the JMX port.
`String`
`getRef()`
Get the project reference for the JMX connection.
`String`
`getUrl()`
Get the JMX URL.
`String`
`getUsername()`
Get the JMX username.
`String`
`getValue()`
Get the expected attribute value.
`void`
`setAttribute(String attribute)`
Set the attribute name.
`void`
`setHost(String host)`
Set the JMX host.
`void`
`setName(String objectName)`
Set the MBean object name.
`void`
`setPassword(String password)`
Set the JMX password.
`void`
`setPort(String port)`
Set the JMX port.
`void`
`setRef(String refId)`
Set the project reference for the JMX connection.
`void`
`setUrl(String url)`
Set the JMX URL.
`void`
`setUsername(String username)`
Set the JMX username.
`void`
`setValue(String value)`
Set the expected attribute value.

### Methods inherited from class org.apache.tools.ant.ProjectComponent

`clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`

### Methods inherited from class Object

`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.tools.ant.taskdefs.condition.Condition

`eval`

## Constructor Details

### JMXAccessorConditionBase

public JMXAccessorConditionBase()
Constructs a new JMXAccessorConditionBase.

## Method Details

### getAttribute

public String getAttribute()
Get the attribute name.

Returns:
  the attribute name

### setAttribute

public void setAttribute(String attribute)
Set the attribute name.

Parameters:
  `attribute` - the attribute name to set

### getHost

public String getHost()
Get the JMX host.

Returns:
  the JMX host

### setHost

public void setHost(String host)
Set the JMX host.

Parameters:
  `host` - the host to set

### getName

public String getName()
Get the MBean object name.

Returns:
  the MBean object name

### setName

public void setName(String objectName)
Set the MBean object name.

Parameters:
  `objectName` - the name to set

### getPassword

public String getPassword()
Get the JMX password.

Returns:
  the JMX password

### setPassword

public void setPassword(String password)
Set the JMX password.

Parameters:
  `password` - the password to set

### getPort

public String getPort()
Get the JMX port.

Returns:
  the JMX port

### setPort

public void setPort(String port)
Set the JMX port.

Parameters:
  `port` - the port to set

### getUrl

public String getUrl()
Get the JMX URL.

Returns:
  the JMX URL

### setUrl

public void setUrl(String url)
Set the JMX URL.

Parameters:
  `url` - the URL to set

### getUsername

public String getUsername()
Get the JMX username.

Returns:
  the JMX username

### setUsername

public void setUsername(String username)
Set the JMX username.

Parameters:
  `username` - the username to set

### getValue

public String getValue()
Get the expected attribute value.

Returns:
  the expected attribute value

### setValue

public void setValue(String value)
Set the expected attribute value.

Parameters:
  `value` - the value to set

### getRef

public String getRef()
Get the project reference for the JMX connection.

Returns:
  the project reference

### setRef

public void setRef(String refId)
Set the project reference for the JMX connection.

Parameters:
  `refId` - the reference to set

### getJMXConnection

protected MBeanServerConnection getJMXConnection() throws MalformedURLException, IOException
Get JMXConnection (default look at jmx.server project reference from jmxOpen Task).

Returns:
  active JMXConnection
Throws:
  `MalformedURLException` - Invalid URL for JMX server
  `IOException` - Connection error

### accessJMXValue

protected String accessJMXValue()
Get value from MBeans attribute.

Returns:
  The value