Package org.jppf.comm.discovery
Class JPPFMulticastReceiver
java.lang.Object
org.jppf.utils.concurrent.ThreadSynchronization
org.jppf.comm.discovery.JPPFMulticastReceiver
An instance of this class listens to messages broadcast by the driver
to get the driver connection host and ports.
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassInstances of this class attempt to receive broadcast connection information from a multicast socket bound to a specified address. -
Field Summary
Fields inherited from class org.jppf.utils.concurrent.ThreadSynchronization
stopped -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.JPPFMulticastReceiver(String group, int port, int timeout) Initialize this discovery thread with the specified UDP group, UDP port and timeout.JPPFMulticastReceiver(IPFilter ipFilter) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionreceive()Retrieve the driver connection information broadcast by the driver.voidsetStopped(boolean stopped) Specify whether the thread'srun()should terminate.
-
Constructor Details
-
JPPFMulticastReceiver
public JPPFMulticastReceiver()Default constructor. -
JPPFMulticastReceiver
Default constructor.- Parameters:
ipFilter- handles include and exclude IP filters.
-
JPPFMulticastReceiver
Initialize this discovery thread with the specified UDP group, UDP port and timeout.- Parameters:
group- the multicast group to join.port- the multicast port to listen to.timeout- the timeout for UDP socket read operations.
-
-
Method Details
-
receive
Retrieve the driver connection information broadcast by the driver.- Returns:
- a
DriverConnectionInformationinstance, or null if no broadcast information could be retrieved.
-
setStopped
public void setStopped(boolean stopped) Description copied from class:ThreadSynchronizationSpecify whether the thread'srun()should terminate.- Overrides:
setStoppedin classThreadSynchronization- Parameters:
stopped- true if the thread is to be stopped, false otherwise.
-