Package org.jppf.server.peer
Class PeerDiscoveryThread
java.lang.Object
org.jppf.utils.concurrent.ThreadSynchronization
org.jppf.server.peer.PeerDiscoveryThread
- All Implemented Interfaces:
Runnable
public class PeerDiscoveryThread
extends org.jppf.utils.concurrent.ThreadSynchronization
implements Runnable
Instances of this class discover peer drivers over the network.
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefines a callback for objects wishing to be notified of discovery events. -
Field Summary
Fields inherited from class org.jppf.utils.concurrent.ThreadSynchronization
stopped -
Constructor Summary
ConstructorsConstructorDescriptionPeerDiscoveryThread(org.jppf.utils.TypedProperties config, org.jppf.comm.discovery.IPFilter ipFilter, org.jppf.comm.discovery.JPPFConnectionInformation localInfo, PeerDiscoveryThread.ConnectionHandler connectionHandler) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation info) Add the specified connection information to discovered map.Set<org.jppf.comm.discovery.JPPFConnectionInformation>Contains the set of retrieved connection information objects.protected booleanhasConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation info) Determine whether a connection information object is already discovered.protected voidonNewConnection(String name, org.jppf.comm.discovery.JPPFConnectionInformation info) Add a newly found connection.booleanremoveConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation info) Remove a disconnected connection.voidrun()Lookup server configurations from UDP multicasts.Methods inherited from class org.jppf.utils.concurrent.ThreadSynchronization
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp
-
Constructor Details
-
PeerDiscoveryThread
public PeerDiscoveryThread(org.jppf.utils.TypedProperties config, org.jppf.comm.discovery.IPFilter ipFilter, org.jppf.comm.discovery.JPPFConnectionInformation localInfo, PeerDiscoveryThread.ConnectionHandler connectionHandler) Default constructor.- Parameters:
config- the driver configuration.connectionHandler- handler for adding new connectionipFilter- for accepted IP addresseslocalInfo- Connection information for this JPPF driver.
-
-
Method Details
-
run
public void run()Lookup server configurations from UDP multicasts. -
onNewConnection
Add a newly found connection.- Parameters:
name- for the connectioninfo- the peer's connection information.
-
hasConnectionInformation
protected boolean hasConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation info) Determine whether a connection information object is already discovered.- Parameters:
info- the connection information to lookup.- Returns:
- true if the connection information is in the map, false otherwise.
-
addConnectionInformation
public void addConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation info) Add the specified connection information to discovered map.- Parameters:
info- aJPPFConnectionInformationinstance.
-
removeConnectionInformation
public boolean removeConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation info) Remove a disconnected connection.- Parameters:
info- connection info of the peer to remove- Returns:
- whether connection was successfully removed
-
getInfoSet
Contains the set of retrieved connection information objects.- Returns:
- the list of discovered connection information.
-