Public Member Functions | Static Public Attributes

alma.acs.monitoring.RemoteThreadsClient Class Reference

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

static final int RMI_DEFAULT_PORT = 9999

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

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

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

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.

References alma.acs.monitoring.RemoteThreadsClient.RMI_DEFAULT_PORT.

alma.acs.monitoring.RemoteThreadsClient.RemoteThreadsClient ( InetAddress  remoteHost,
int  remotePort 
) throws RemoteThreadsException

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

Closes the connection with the remote MBeanServer.

Exceptions:
RemoteThreadsException If the connection has not been opened.

Referenced by alma.acs.monitoring.RemoteThreadsMonitor.close().

boolean alma.acs.monitoring.RemoteThreadsClient.connect (  ) 

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

Referenced by alma.acs.monitoring.RemoteThreadsMonitor.RemoteThreadsMonitor().

RemoteThreadsMBean alma.acs.monitoring.RemoteThreadsClient.getMBean (  )  throws RemoteThreadsException

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

Referenced by alma.acs.monitoring.RemoteThreadsMonitor.getMBean().


Member Data Documentation

Default port used by the RMI client-side connector

Referenced by alma.acs.monitoring.RemoteThreadsClient.RemoteThreadsClient().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties