|
Bully Task (12.12.2005) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.jku.fim.datalinksimulation.layer7.Application
at.jku.fim.datalinksimulation.layer7.Bully.BullyApplication
public class BullyApplication
The Bully Application running on the individual stations
Copyright: (c) 2004,2005
Company: FIM@JKU, www.fim.uni-linz.ac.at
Field Summary | |
---|---|
static int |
BULLY_STATE_ELECTION
Election messages have been sent; waiting for the first OK message |
static int |
BULLY_STATE_INIT
Initialization: When the algorithm starts; before sending the election messages |
static int |
BULLY_STATE_MASTER
We are the master |
static int |
BULLY_STATE_SLAVE
We are a slave |
static int |
BULLY_STATE_UNKNOWN
Current state of Bully algorithm is unknown |
static int |
BULLY_STATE_WAIT
At least one OK message received; we are waiting for a coordinator message |
Fields inherited from class at.jku.fim.datalinksimulation.layer7.Application |
---|
networkStackReference |
Constructor Summary | |
---|---|
BullyApplication(int stationId,
int stationCount)
Constructor |
Method Summary | |
---|---|
Logger |
getLogger()
We don't have a logger |
int |
getMasterID()
Retrieve the ID of our current master. |
int |
getStationId()
Retrieve the station ID |
void |
informAboutNewData(NetworkStackParameters params,
RawData data)
Receive data from the network |
void |
run()
Run this application. |
void |
setGui(BullyPanel gui)
Set GUI panel so we can notify it about state changes. |
void |
terminate()
Stop this thread. |
Methods inherited from class at.jku.fim.datalinksimulation.layer7.Application |
---|
getNetworkStack, setNetworkStack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BULLY_STATE_UNKNOWN
public static final int BULLY_STATE_INIT
public static final int BULLY_STATE_ELECTION
public static final int BULLY_STATE_WAIT
public static final int BULLY_STATE_SLAVE
public static final int BULLY_STATE_MASTER
Constructor Detail |
---|
public BullyApplication(int stationId, int stationCount)
stationId
- Station ID of hoststationCount
- total number of stationsMethod Detail |
---|
public int getStationId()
public int getMasterID()
public void setGui(BullyPanel gui)
gui
- the GUI panelpublic void run()
run
in interface java.lang.Runnable
public void terminate()
public void informAboutNewData(NetworkStackParameters params, RawData data)
informAboutNewData
in interface IncomingNetworkStackObserver
params
- network parametersdata
- raw datapublic Logger getLogger()
getLogger
in class Application
null
|
Bully Task (12.12.2005) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |