|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectapi.Task
public abstract class Task
Interface for a Task object.
Constructor Summary | |
---|---|
Task()
|
Method Summary | |
---|---|
void |
broadcastMessage(java.lang.String message)
Broadcast a message to other Tasks. |
java.lang.Long |
getComputerId()
|
java.lang.Long |
getId()
Get Task Id |
java.lang.Integer |
getListenPort()
|
NetworkMessage |
getMessage()
Attempt to read a NetworkMessage from the router. |
java.nio.channels.SocketChannel |
getRouterSocketChannel()
Return the SocketChannel to the Router |
abstract java.lang.Object |
run()
Method to run the task. |
void |
setComputer(Computer computer)
Set the computer that is running this task. |
void |
setId(java.lang.Long id)
Set task id. |
void |
setListenPort(java.lang.Integer listenPort)
|
void |
unicastMessage(java.lang.Long destinationAddress,
java.lang.String message)
Send a unicast message to a specific Task. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Task()
Method Detail |
---|
public abstract java.lang.Object run()
public java.lang.Long getId()
public void setId(java.lang.Long id)
id
- public void setComputer(Computer computer)
computer
- public java.lang.Long getComputerId()
public NetworkMessage getMessage() throws java.io.IOException
java.io.IOException
public void broadcastMessage(java.lang.String message) throws java.io.IOException
message
-
java.io.IOException
public void unicastMessage(java.lang.Long destinationAddress, java.lang.String message) throws java.io.IOException
destinationAddress
- message
-
java.io.IOException
public java.nio.channels.SocketChannel getRouterSocketChannel()
public java.lang.Integer getListenPort()
public void setListenPort(java.lang.Integer listenPort)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |