Package org.apache.uima.aae.jmx
Class RemoteJMXServer
- java.lang.Object
-
- org.apache.uima.aae.jmx.RemoteJMXServer
-
public class RemoteJMXServer extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RemoteJMXServer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attachToTempQueue(java.lang.String tempQueueName)
void
disconnect()
Disconnects from MBeanServervoid
initialize(java.lang.String jmxDomain, java.lang.String remoteJMXServerHostname, java.lang.String remoteJMXServerPort)
Creates a connection to an MBean Server identified byremoteJMXServerHostName and remoteJMXServerPort
boolean
isClientReplyQueueAvailable(java.lang.String queueName)
Checks if a given queue name exists in remote MBeanServer's registry.boolean
isInitialized()
boolean
isServerAvailable()
Tries to fetch total number of MBeans in the MBeanServer.static void
main(java.lang.String[] args)
java.lang.String
normalize(java.lang.String destinationName)
Replaces ':' with '_'.
-
-
-
Method Detail
-
isInitialized
public boolean isInitialized()
-
initialize
public void initialize(java.lang.String jmxDomain, java.lang.String remoteJMXServerHostname, java.lang.String remoteJMXServerPort) throws java.lang.Exception
Creates a connection to an MBean Server identified byremoteJMXServerHostName and remoteJMXServerPort
- Parameters:
remoteJMXServerHostName
- - MBeanServer host nameremoteJMXServerPort
- - MBeanServer port- Throws:
java.lang.Exception
-
disconnect
public void disconnect()
Disconnects from MBeanServer
-
isServerAvailable
public boolean isServerAvailable()
Tries to fetch total number of MBeans in the MBeanServer. The real goal here is to check if the server responds. Failure here indicates failed server connection.- Returns:
-
attachToTempQueue
public void attachToTempQueue(java.lang.String tempQueueName) throws java.lang.Exception
- Throws:
java.lang.Exception
-
isClientReplyQueueAvailable
public boolean isClientReplyQueueAvailable(java.lang.String queueName)
Checks if a given queue name exists in remote MBeanServer's registry. NOTE: The code returns true in case the MBeanServer is not available.- Parameters:
queueName
- - queue to lookup in the MBeanServer- Returns:
- - true if queue exists, false otherwise
-
normalize
public java.lang.String normalize(java.lang.String destinationName)
Replaces ':' with '_'. JMX queries containing ':' are illegal.- Parameters:
destinationName
-- Returns:
-
main
public static void main(java.lang.String[] args)
-
-