|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
NIC
The class creates token then Passes token to neighbour NIC and holds token while the resource in use bu user
| Field Summary | |
protected static boolean |
loop
Thread looping flag |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Fields inherited from interface Actions |
EXIT, NOPASSING, PASS, PASSTOKEN, READ |
| Constructor Summary | |
NIC()
Constructor set the intital status to NOPASSING |
|
| Method Summary | |
protected void |
checkStatus()
Check status and pass token |
protected void |
createToken()
create the token intially and set status to pass The method should call before starting thread |
protected Token |
exchangeToken(Token r)
exchanges token value from neighbour NIC |
protected void |
Exit()
This methods terminates the run method by setting flag |
protected Token |
getToken()
Return token reference |
void |
run()
|
protected void |
setNeighbour(NIC n)
set neighbout NIC to communicate and pass token The method should call before starting thread |
protected void |
setStatus()
change status to pass token |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static boolean loop
| Constructor Detail |
public NIC()
| Method Detail |
protected void checkStatus()
throws Exception
Exceptionprotected void createToken()
protected Token exchangeToken(Token r)
r - token to exchangeprotected void Exit()
protected Token getToken()
public void run()
run in interface Runnableprotected void setNeighbour(NIC n)
n - Neighbour NICprotected void setStatus()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||