public abstract class Link extends java.lang.Object implements CSProcess
NetworkProtocol
Modifier and Type | Field and Description |
---|---|
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 java.io.DataInputStream |
rxStream
The incoming stream for the connection.
|
protected java.io.DataOutputStream |
txStream
The outgoing stream for the connection.
|
Constructor and Description |
---|
Link() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected boolean connected
protected java.io.DataInputStream rxStream
protected java.io.DataOutputStream txStream
protected NodeID remoteID
public static int LINK_PRIORITY
protected int priority
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()
Copyright © 1996–2021. All rights reserved.