|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroupmgmt.impl.BeaconServer
The BeaconServer class; Beaconing service used for host discovery. Controls the BeaconSender and BeaconReceiver.
Based on the beacon package by Ali Hazemi.
BeaconingDetector
,
SafeDistanceDetector
,
BeaconSender
,
BeaconReceiver
Field Summary | |
private BeaconReceiver |
beaconReceiver
|
private BeaconSender |
beaconSender
|
Constructor Summary | |
BeaconServer(java.net.InetAddress mcastAddress,
int mcastPort,
boolean receiveOwn)
Create a BeaconServer. |
Method Summary | |
void |
addBeaconListener(BeaconListener beaconListener)
Add a BeaconListener to be notified of new BeaconEvents. |
MemberBeacon |
getBeacon()
Accessor to the beacon. |
void |
removeBeaconListener(BeaconListener beaconListener)
Stop sending BeaconEvents to a BeaconListener. |
void |
sendBeaconNow()
Send a Beacon immediately. |
void |
setBeacon(MemberBeacon beacon)
Set the beacon to be broadcasted. |
void |
setPeriod(int period)
Set the period at which the beacon is broadcasted. |
void |
start()
Start the BeaconServer. |
void |
startReceiver()
Start only the BeaconReceiver. |
void |
startSender()
Start only the BeaconSender. |
void |
stop()
Stop the BeaconServer. |
void |
stopReceiver()
Stop only the BeaconReceiver. |
void |
stopSender()
Stop only the BeaconSender. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private BeaconSender beaconSender
private BeaconReceiver beaconReceiver
Constructor Detail |
public BeaconServer(java.net.InetAddress mcastAddress, int mcastPort, boolean receiveOwn)
mcastAddress
- The multicast address to beacon to.mcastPort
- The port to beacon to.receiveOwn
- Whether or not the BeaconReceiver should report
receiving beacons sent from this host.Method Detail |
public void setBeacon(MemberBeacon beacon)
beacon
- The MemberBeacon to broadcast.public MemberBeacon getBeacon()
public void setPeriod(int period)
period
- How often to send the beacon (ms).public void startReceiver()
public void stopReceiver()
public void startSender()
public void stopSender()
public void start()
public void stop()
public void sendBeaconNow()
public void addBeaconListener(BeaconListener beaconListener)
beaconListener
- The listener to be notified.public void removeBeaconListener(BeaconListener beaconListener)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |