org.apache.catalina.ant.jmx
public class JMXAccessorTask extends BaseRedirectorHelperTask
<jmxOpen host="127.0.0.1" port="9014" username="monitorRole" password="mysecret" ref="jmx.myserver" />All calls after opening with same refid reuse the connection.
First call to a remote MBeanserver save the JMXConnection a referenz jmx.server
All JMXAccessorXXXTask support the attribute if and unless. With if the task is only execute when property exist and with unless when property not exists.Since: 5.5.10
Version: $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $
Field Summary | |
---|---|
static String | JMX_SERVICE_PREFIX |
static String | JMX_SERVICE_SUFFIX |
Method Summary | |
---|---|
static MBeanServerConnection | accessJMXConnection(Project project, String url, String host, String port, String username, String password, String refId)
Get Current Connection from ref parameter or create a new one!
|
protected Object | convertStringToType(String value, String valueType)
Convert string to datatype FIXME How we can transfer values from ant
project reference store (ref)?
|
static MBeanServerConnection | createJMXConnection(String url, String host, String port, String username, String password)
create a new JMX Connection with auth when username and password is set. |
protected void | createProperty(Object result)
create result as property with name from attribute resultproperty
|
protected void | createProperty(String propertyPrefix, Object result)
create result as property with name from property prefix When result is
an array and isSeparateArrayResults is true, resultproperty used as
prefix ( resultproperty.0-array.length and store the
result array length at resultproperty.length . |
protected void | echoResult(String name, Object result) |
void | execute()
Execute the specified command. |
String | getDelimiter() |
String | getHost()
The Host of the JMX JSR 160 MBeanServer to be used. |
String | getIf() |
String | getInfo()
Return descriptive information about this implementation and the
corresponding version number, in the format
<description>/<version> . |
protected MBeanServerConnection | getJMXConnection()
get JMXConnection
|
String | getName()
The name used at remote MbeanServer |
String | getPassword()
The login password for the Manager application. |
String | getPort()
The Port of the JMX JSR 160 MBeanServer to be used. |
Map | getProperties()
get all properties, when project is there got all project Properties |
String | getProperty(String property)
get all Properties |
String | getRef() |
String | getResultproperty() |
String | getUnless() |
String | getUrl()
The URL of the JMX JSR 160 MBeanServer to be used. |
String | getUsername()
The login username for the JMX MBeanServer. |
boolean | isEcho() |
boolean | isSeparatearrayresults() |
boolean | isUseRef() |
String | jmxExecute(MBeanServerConnection jmxServerConnection)
Execute the specified command, based on the configured properties. |
void | setDelimiter(String separator) |
void | setEcho(boolean echo) |
void | setHost(String host) |
void | setIf(String c)
Only execute if a property of the given name exists in the current
project.
|
void | setName(String objectName) |
void | setPassword(String password) |
void | setPort(String port) |
boolean | setProperty(String property, Object value) |
void | setRef(String refId) |
void | setResultproperty(String propertyName) |
void | setSeparatearrayresults(boolean separateArrayResults) |
void | setUnless(String c)
Only execute if a property of the given name does not exist in the
current project.
|
void | setUrl(String url) |
void | setUsername(String username) |
protected boolean | testIfCondition()
test the if condition
|
protected boolean | testUnlessCondition()
test the unless condition
|
Returns: The server connection
Throws: MalformedURLException IOException
Parameters: value The value valueType The type
Returns: The converted object
Parameters: result The result
See Also: JMXAccessorTask
resultproperty.0-array.length
and store the
result array length at resultproperty.length
. Other
option is that you delemit your result with a delimiter
(java.util.StringTokenizer is used).
Parameters: propertyPrefix result
Parameters: name context of result result
Throws: BuildException if a validation error occurs
Returns: Returns the delimiter.
JMX JSR 160
MBeanServer to be used.Returns: Returns the ifCondition.
<description>/<version>
.Returns: The connection
Throws: MalformedURLException IOException
Manager
application.JMX JSR 160
MBeanServer to be used.Returns: properties
Parameters: property
Returns: The property
Returns: Returns the ref.
Returns: Returns the resultproperty.
Returns: Returns the unlessCondition.
JMX JSR 160
MBeanServer to be used.JMX
MBeanServer.Returns: Returns the echo.
Returns: Returns the separatearrayresults.
Returns: Returns the useRef.
Throws: Exception if an error occurs
Parameters: separator The delimiter to set.
Parameters: echo The echo to set.
Parameters: c property name
Parameters: property The property value The value
Returns: True if successful
Parameters: refId The ref to set.
Parameters: propertyName The resultproperty to set.
Parameters: separateArrayResults The separatearrayresults to set.
Parameters: c property name
Returns: true if there is no if condition, or the named property exists
Returns: true if there is no unless condition, or there is a named property but it doesn't exist