|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcsp.net2.Link
public abstract class Link
Abstract class representing a Link. This class defines the two processes (Link TX, Link RX) where the network protocol is of key importance. Specific technology protocols (e.g. TCP/IP) must extend this class, providing the necessary streams for operation, and also overriding the methods connect, createResources and destroyResources, which will have specific implementations dependent on the underlying technology. Everything else should operate as defined in this class.
NetworkProtocol
Field Summary | |
---|---|
protected boolean |
connected
A flag used to indicate whether the Link is connected or not. |
static int |
LINK_PRIORITY
Link priority in the system. |
protected int |
priority
Link priority for this Link. |
protected NodeID |
remoteID
The NodeID of the opposite end of the connection. |
protected DataInputStream |
rxStream
The incoming stream for the connection. |
protected DataOutputStream |
txStream
The outgoing stream for the connection. |
Constructor Summary | |
---|---|
Link()
|
Method Summary | |
---|---|
abstract boolean |
connect()
Connects to the remote Node. |
protected abstract boolean |
createResources()
Creates the resources (if any) required for the Node. |
protected abstract void |
destroyResources()
Destroys any used resources. |
NodeID |
getRemoteNodeID()
Returns the NodeID of the connected Link. |
protected ChannelOutput |
getTxChannel()
Gets the channel that is connected to the Link Tx process. |
protected void |
lostLink()
Marks the Link as lost within the LinkManager. |
boolean |
registerLink()
Registers the Link with the LinkManager |
void |
run()
The run method for the process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean connected
protected DataInputStream rxStream
protected DataOutputStream txStream
protected NodeID remoteID
public static int LINK_PRIORITY
protected int priority
Constructor Detail |
---|
public Link()
Method Detail |
---|
public final NodeID getRemoteNodeID()
protected final ChannelOutput getTxChannel()
public abstract boolean connect() throws JCSPNetworkException
JCSPNetworkException
- Thrown if the connection fails.protected abstract boolean createResources() throws JCSPNetworkException
JCSPNetworkException
- Thrown if a problem occurs creating the resources.protected abstract void destroyResources()
public final boolean registerLink()
protected final void lostLink()
public final void run()
run
in interface CSProcess
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |