|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.services.discovery.DiscoveryClient
public class DiscoveryClient
The DiscoveryClient class is the client class to discover AdventNet JMX agents. JMX agent can only discovered if it has a DiscoveryService mbean registered with it. DiscoveryClient will broadcast a discovery request on a multicast socket . The JMX agents(discovery service) listening on the multicast group will receive the request. Each JMX agent will send a discovery response to the DiscoveryClient. The discovery client also joins the same default muticast group 225.225.225.225 and the default port is 8222 as of DiscoveryService
| Field Summary | |
|---|---|
(package private) java.util.Hashtable |
finderTable
|
(package private) java.net.InetAddress |
group
|
(package private) static int |
handbackID
|
(package private) boolean |
initialDiscovery
|
(package private) java.util.Vector |
initialVector
|
(package private) java.util.Hashtable |
listenerTable
|
(package private) java.lang.Thread |
recvThread
|
(package private) boolean |
state
|
(package private) boolean |
toBeStopped
|
| Constructor Summary | |
|---|---|
DiscoveryClient()
The default constructor |
|
DiscoveryClient(int mcPort)
The constructor with multicast port number as parameter |
|
| Method Summary | |
|---|---|
void |
addDiscoveryObjectListener(DiscoveryObjectListener listener)
the method to add DiscoveryObjectListener which are interested to listen for DiscoveryEvent |
(package private) DiscoveryObject |
convertToDiscoveryObject(DiscoveryPacket pack)
|
(package private) DiscoveryPacket |
createDiscoveryPacket()
|
DiscoveryEvent |
discoverJMXAgents()
Discovers all JMX agents(MBeanServers) and its associated adaptors/connectors in the network. |
DiscoveryEvent |
discoverJMXAgents(java.lang.String host)
Discovers all JMX agents(MBeanServers) and its associated adaptors/connectors in the specified host.The discovery time is specified by the timeout in DiscoveryClient. |
(package private) void |
doInitialDiscovery()
|
java.lang.String |
getMulticastGroup()
Gets the multicast group. |
int |
getMulticastPort()
Gets the multicast port. |
boolean |
getState()
Gets the state of this client. |
int |
getTimeout()
Gets the timeout for receiving the response for the broadcasted discovery request. |
int |
getTimeToLive()
Gets the time to live (hop count). |
(package private) void |
handleInitialDiscovery(DiscoveryPacket pack)
|
(package private) void |
processPacket(DiscoveryPacket pack)
|
(package private) DiscoveryPacket |
receivePacket()
|
void |
removeDiscoveryObjectListener(DiscoveryObjectListener listener)
method to remove DiscoveryObjectListener object |
void |
run()
The receiver thread runnable |
(package private) void |
sendPacket(DiscoveryPacket packet,
java.net.InetAddress group,
int port)
|
void |
setDiscoveryToSingleHost(java.lang.String host)
Method used for sending discovery packets for single host,instead of broadcasting it to a group |
void |
setMulticastGroup(java.lang.String mcGroup)
Sets the multicast group. |
void |
setMulticastPort(int mcPort)
Sets the multicast port. |
void |
setTimeout(int timeout)
Sets the timeout |
void |
setTimeToLive(int ttl)
Sets the time to live for the client request packet. |
void |
start()
Method to start the discovery client |
void |
stop()
Method to stop the discovery client |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
java.net.InetAddress group
java.lang.Thread recvThread
boolean toBeStopped
java.util.Vector initialVector
boolean state
boolean initialDiscovery
java.util.Hashtable listenerTable
static int handbackID
java.util.Hashtable finderTable
| Constructor Detail |
|---|
public DiscoveryClient(int mcPort)
throws java.lang.Exception
java.lang.Exception
public DiscoveryClient()
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public java.lang.String getMulticastGroup()
public void setMulticastGroup(java.lang.String mcGroup)
public int getMulticastPort()
public void setMulticastPort(int mcPort)
public int getTimeToLive()
public void setTimeToLive(int ttl)
public int getTimeout()
public void setTimeout(int timeout)
public boolean getState()
public void start()
throws java.lang.Exception
java.lang.Exception
void doInitialDiscovery()
throws java.lang.Exception
java.lang.ExceptionDiscoveryPacket createDiscoveryPacket()
void sendPacket(DiscoveryPacket packet,
java.net.InetAddress group,
int port)
throws java.lang.Exception
java.lang.Exception
public void stop()
throws java.lang.Exception
java.lang.Exceptionvoid handleInitialDiscovery(DiscoveryPacket pack)
DiscoveryObject convertToDiscoveryObject(DiscoveryPacket pack)
public void run()
run in interface java.lang.Runnable
public DiscoveryEvent discoverJMXAgents()
throws java.lang.Exception
java.lang.Exception
public DiscoveryEvent discoverJMXAgents(java.lang.String host)
throws java.lang.Exception
host - the host name tobe discovered
java.lang.Exception
DiscoveryPacket receivePacket()
throws java.lang.Exception
java.lang.Exception
void processPacket(DiscoveryPacket pack)
throws java.lang.Exception
java.lang.Exceptionpublic void addDiscoveryObjectListener(DiscoveryObjectListener listener)
public void removeDiscoveryObjectListener(DiscoveryObjectListener listener)
public void setDiscoveryToSingleHost(java.lang.String host)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||