Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::monitoring::RemoteThreadsClient Class Reference

Collaboration diagram for alma::acs::monitoring::RemoteThreadsClient:

Collaboration graph
[legend]
List of all members.

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

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

final String LOCAL_CONNECTOR_ADDRESS

Detailed Description

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

Author:
rtobar
Since:
ACS 7.0


Constructor & Destructor Documentation

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).

Parameters:
className The name of the launcher class of the remote process
Exceptions:
RemoteThreadsException Is thrown in the following cases:
  • The given PID isn't present in the list of java processes, or it can't be retreived by the jps program.
  • Cannot connect to the remote JVM or can't attach to it.
  • Can't load the JMX agent on the remote JVM or can't initialize it (if it isn't already loaded).

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

Parameters:
pid The PID of the remote java process
Exceptions:
RemoteThreadsException If:
  • PID is less or equal to 0.
  • Cannot connect to the remote JVM or can't attach to it.
  • Can't load the JMX agent on the remote JVM or can't initialize it (if it isn't already loaded).

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.

Parameters:
remoteHost The remote host where the remote JVM is placed
Exceptions:
RemoteThreadsException If a malformed URL is produced with the given host address.

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.

Parameters:
remoteHost The remote host where the remote JVM is placed
remotePort The port to be used for the RMI connection
Exceptions:
RemoteThreadsException If a malformed URL is produced with the given host address and port.


Member Function Documentation

void alma::acs::monitoring::RemoteThreadsClient::close  )  throws RemoteThreadsException [inline]
 

Closes the connection with the remote MBeanServer.

Exceptions:
RemoteThreadsException If the connection has not been opened.

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.

Returns:
If the connection has been sucessful or not

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.

Returns:
A RemoteThreadsMBean object representing the MBean registered on the remote JVM agent.
Exceptions:
RemoteThreadsException If:
  • The MBean can't be registered on the remote JVM agent
  • A local reference for this MBean can't be get

int alma::acs::monitoring::RemoteThreadsClient::getRemotePID String  className  )  throws IOException [inline, private]
 

void alma::acs::monitoring::RemoteThreadsClient::getServiceURL InetAddress  host,
int  port
throws MalformedURLException [inline, private]
 

void alma::acs::monitoring::RemoteThreadsClient::getServiceURL int  pid  )  throws IOException, AgentLoadException, RemoteThreadsException, AttachNotSupportedException, AgentInitializationException [inline, private]
 


Member Data Documentation

JMXConnector alma::acs::monitoring::RemoteThreadsClient::connector = null [private]
 

final String alma::acs::monitoring::RemoteThreadsClient::LOCAL_CONNECTOR_ADDRESS [static, private]
 

Initial value:

"com.sun.management.jmxremote.localConnectorAddress"
Property name for getting a local JMX connector

MBeanServerConnection alma::acs::monitoring::RemoteThreadsClient::remote = null [private]
 

JMXServiceURL alma::acs::monitoring::RemoteThreadsClient::remoteURL = null [private]
 

final int alma::acs::monitoring::RemoteThreadsClient::RMI_DEFAULT_PORT = 9999 [static]
 

Default port used by the RMI client-side connector

RemoteThreadsMBean alma::acs::monitoring::RemoteThreadsClient::rtmb = null [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:54:23 2009 for ACS Java API by doxygen 1.3.8