
Public Member Functions | |
| RemoteThreadsClient (String className) throws RemoteThreadsException | |
| RemoteThreadsClient (int pid) throws RemoteThreadsException | |
| RemoteThreadsClient (InetAddress remoteHost) throws RemoteThreadsException | |
| RemoteThreadsClient (InetAddress remoteHost, int remotePort) throws RemoteThreadsException | |
| boolean | connect () |
| void | close () throws RemoteThreadsException |
| RemoteThreadsMBean | getMBean () throws RemoteThreadsException |
Static Public Attributes | |
| static final int | RMI_DEFAULT_PORT = 9999 |
Private Member Functions | |
| int | getRemotePID (String className) throws IOException |
| void | getServiceURL (int pid) throws IOException, AgentLoadException, RemoteThreadsException, AttachNotSupportedException, AgentInitializationException |
| void | getServiceURL (InetAddress host, int port) throws MalformedURLException |
Private Attributes | |
| JMXServiceURL | remoteURL = null |
| MBeanServerConnection | remote = null |
| RemoteThreadsMBean | rtmb = null |
| JMXConnector | connector = null |
Static Private Attributes | |
| static final String | LOCAL_CONNECTOR_ADDRESS |
Class used for connecting with a RemoteThreads MBean implementation. The connection can be done with a local process, as well as with a process running in a remote machine, with the RMI connector enabled on it.
For further details on the activation of the RMI connector, you can see http://java.sun.com/docs/books/tutorial/jmx/remote/jconsole.html
| alma::acs::monitoring::RemoteThreadsClient::RemoteThreadsClient | ( | String | className | ) | throws RemoteThreadsException [inline] |
Gets a new RemoteThreadsClient ready to be connected to the remote JVM indicated by the name of the launcher class (the one containing the public static void main(String[]) method).
| className | The name of the launcher class of the remote process |
| RemoteThreadsException | Is thrown in the following cases:
|
References getRemotePID(), and getServiceURL().
| alma::acs::monitoring::RemoteThreadsClient::RemoteThreadsClient | ( | int | pid | ) | throws RemoteThreadsException [inline] |
Gets a new RemoteThreadsClient ready to be connected to the remote JVM indicated by the given PID
| pid | The PID of the remote java process |
| RemoteThreadsException | If:
|
References getServiceURL().
| alma::acs::monitoring::RemoteThreadsClient::RemoteThreadsClient | ( | InetAddress | remoteHost | ) | throws RemoteThreadsException [inline] |
Gets a new RemoteThreadsClient ready to be connected to the remote JVM present in the given host address. It uses the RMI_DEFAULT_PORT for connecting to the remote host.
| remoteHost | The remote host where the remote JVM is placed |
| RemoteThreadsException | If a malformed URL is produced with the given host address. |
References getServiceURL(), and RMI_DEFAULT_PORT.
| alma::acs::monitoring::RemoteThreadsClient::RemoteThreadsClient | ( | InetAddress | remoteHost, | |
| int | remotePort | |||
| ) | throws RemoteThreadsException [inline] |
Gets a new RemoteThreadsClient ready to be connected to the remote JVM present in the given host address and port.
| remoteHost | The remote host where the remote JVM is placed | |
| remotePort | The port to be used for the RMI connection |
| RemoteThreadsException | If a malformed URL is produced with the given host address and port. |
References getServiceURL().
| void alma::acs::monitoring::RemoteThreadsClient::close | ( | ) | throws RemoteThreadsException [inline] |
Closes the connection with the remote MBeanServer.
| RemoteThreadsException | If the connection has not been opened. |
References connector.
Referenced by alma::acs::monitoring::RemoteThreadsMonitor::close(), alma::acs::monitoring::RemoteThreadsMBeanTest::tearDown(), alma::acs::monitoring::RemoteThreadsClientTest::testClose(), and alma::acs::monitoring::RemoteThreadsClientTest::testGetMBean().
| boolean alma::acs::monitoring::RemoteThreadsClient::connect | ( | ) | [inline] |
Connects the object instance to the remote JVM agent and gets a direct connection with the MBeanServer in order to be able to get the remote MBean.
References connector, remote, and remoteURL.
Referenced by alma::acs::monitoring::RemoteThreadsMonitor::RemoteThreadsMonitor(), alma::acs::monitoring::RemoteThreadsMBeanTest::setUp(), alma::acs::container::corba::ContainerMonitorTest::setUp(), alma::acs::monitoring::RemoteThreadsClientTest::testClose(), alma::acs::monitoring::RemoteThreadsClientTest::testConnect(), and alma::acs::monitoring::RemoteThreadsClientTest::testGetMBean().
| RemoteThreadsMBean alma::acs::monitoring::RemoteThreadsClient::getMBean | ( | ) | throws RemoteThreadsException [inline] |
Returns an object representing the MBean registered on the remote JVM agent. If the MBean has not been registered, then it is registered and then retreived.
| RemoteThreadsException | If:
|
Referenced by alma::acs::monitoring::RemoteThreadsMonitor::getMBean(), alma::acs::monitoring::RemoteThreadsMBeanTest::setUp(), alma::acs::container::corba::ContainerMonitorTest::setUp(), and alma::acs::monitoring::RemoteThreadsClientTest::testGetMBean().
| int alma::acs::monitoring::RemoteThreadsClient::getRemotePID | ( | String | className | ) | throws IOException [inline, private] |
Referenced by RemoteThreadsClient().
| void alma::acs::monitoring::RemoteThreadsClient::getServiceURL | ( | InetAddress | host, | |
| int | port | |||
| ) | throws MalformedURLException [inline, private] |
References remoteURL.
| void alma::acs::monitoring::RemoteThreadsClient::getServiceURL | ( | int | pid | ) | throws IOException, AgentLoadException, RemoteThreadsException, AttachNotSupportedException, AgentInitializationException [inline, private] |
References LOCAL_CONNECTOR_ADDRESS, and remoteURL.
Referenced by RemoteThreadsClient().
JMXConnector alma::acs::monitoring::RemoteThreadsClient::connector = null [private] |
final String alma::acs::monitoring::RemoteThreadsClient::LOCAL_CONNECTOR_ADDRESS [static, private] |
"com.sun.management.jmxremote.localConnectorAddress"
Property name for getting a local JMX connector
Referenced by getServiceURL().
MBeanServerConnection alma::acs::monitoring::RemoteThreadsClient::remote = null [private] |
Referenced by connect(), and getMBean().
JMXServiceURL alma::acs::monitoring::RemoteThreadsClient::remoteURL = null [private] |
Referenced by connect(), and getServiceURL().
final int alma::acs::monitoring::RemoteThreadsClient::RMI_DEFAULT_PORT = 9999 [static] |
Default port used by the RMI client-side connector
Referenced by RemoteThreadsClient().
RemoteThreadsMBean alma::acs::monitoring::RemoteThreadsClient::rtmb = null [private] |
Referenced by getMBean().
1.6.2