org.opensolaris.opengrok.management.client
Class AgentConnection

java.lang.Object
  extended by org.opensolaris.opengrok.management.client.AgentConnection
All Implemented Interfaces:
java.util.EventListener, javax.management.NotificationListener

public class AgentConnection
extends java.lang.Object
implements javax.management.NotificationListener

Class to handle the connection and methods to the OpenGrok Agent


Field Summary
static java.lang.String JAVA_LANG_OBJECT
           
static java.lang.String JAVA_LANG_STRING
           
 
Constructor Summary
AgentConnection(java.lang.String url)
          Constructor for AgentConnection to OpenGrok JMX Agent
 
Method Summary
 void clearFilesInfo()
           
protected  void connect()
           
 java.lang.String getAgentURL()
           
 long getEndTime()
           
 java.lang.String getFilesInfo()
           
 javax.management.MBeanServerConnection getMBeanServerConnection()
           
 long getStartTime()
           
 void handleNotification(javax.management.Notification notification, java.lang.Object handback)
           
 boolean isConnected()
           
 void reconnect(int retrytimes)
           
 void registerListener()
           
 void setActionListener(java.awt.event.ActionListener listener)
           
 void unregister()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_LANG_STRING

public static final java.lang.String JAVA_LANG_STRING
See Also:
Constant Field Values

JAVA_LANG_OBJECT

public static final java.lang.String JAVA_LANG_OBJECT
See Also:
Constant Field Values
Constructor Detail

AgentConnection

public AgentConnection(java.lang.String url)
                throws java.net.MalformedURLException,
                       java.io.IOException,
                       javax.management.MalformedObjectNameException
Constructor for AgentConnection to OpenGrok JMX Agent

Parameters:
url - The url for the agent to connect to (format host:port)
Throws:
java.net.MalformedURLException - if url is not in correct format
java.io.IOException - if a connection error occurs
javax.management.MalformedObjectNameException - if the JMX object name is not correct
Method Detail

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection()

getAgentURL

public java.lang.String getAgentURL()

setActionListener

public void setActionListener(java.awt.event.ActionListener listener)

getFilesInfo

public java.lang.String getFilesInfo()

clearFilesInfo

public void clearFilesInfo()

getStartTime

public long getStartTime()

getEndTime

public long getEndTime()

handleNotification

public void handleNotification(javax.management.Notification notification,
                               java.lang.Object handback)
Specified by:
handleNotification in interface javax.management.NotificationListener

registerListener

public void registerListener()
                      throws java.io.IOException,
                             javax.management.InstanceNotFoundException
Throws:
java.io.IOException
javax.management.InstanceNotFoundException

reconnect

public void reconnect(int retrytimes)
               throws java.net.MalformedURLException,
                      java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

connect

protected void connect()
                throws java.net.MalformedURLException,
                       java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

isConnected

public boolean isConnected()

unregister

public void unregister()