public abstract class LocalCable extends CableImp implements IOCable, java.io.Serializable, NodeListener
Scheduler
,
Serialized FormNON_RUNNABLE_CABLE
CONTROL_CABLE_TYPE
Constructor and Description |
---|
LocalCable() |
Modifier and Type | Method and Description |
---|---|
void |
connect(Node sendnode,
Node recnode)
A local cable must be created by giving a reference to a RunnableInstance object so that wehen we use
non-blocking sending of data we can notify the RunnableInstance object when each packet has finished
|
void |
createMonitor()
Create a new monitor to provide the synchronisation between the OldUnit thread's.
|
void |
destroyMonitor() |
void |
disconnect()
Disconnect this cable from its nodes.
|
protected void |
finalize()
When the garbage collector de-allocates space from this object we reset all references to other object we have
used
|
void |
flush()
Flushes the data on the pipe
|
boolean |
isDataReady() |
boolean |
isDataSent() |
void |
nodeChildChanged(NodeEvent event)
Called when one of a group node's child changes
|
void |
nodeConnected(NodeEvent event)
Called when a node is connected to a cable.
|
void |
nodeDisconnected(NodeEvent event)
Called before a node is diconnected from a cable.
|
void |
nodeParentChanged(NodeEvent event)
Called when one of a group node's parents changes
|
void |
parameterNameSet(NodeEvent event)
Called when the name of the parameter the node is inputting/outputting is set.
|
protected java.lang.Object |
preReceive(java.lang.Object data)
A method that can be over-ridden to provide additional receive functionality.
|
protected java.lang.Object |
preSend(java.lang.Object data,
boolean blocking)
A method that can be over-ridden to provide additional send functionality.
|
void |
reconnect(Node node)
Reconnects the sender to this cable
|
java.lang.Object |
recv()
Returns the data from this connection if there is data there.
|
void |
resume()
Unsuspends a pipe
|
void |
send(java.lang.Object data)
Blocking call to send the data from the sending task to the receiving task.
|
void |
sendNonBlocking(java.lang.Object data)
Non-blocking call to send the data from the sending task to the receiving task.
|
void |
suspend()
Suspends the pipe.
|
addCableListener, connects, contains, getReceivingNode, getReceivingTask, getSendingNode, getSendingTask, getType, isConnected, removeCableListener, toString
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addCableListener, connects, contains, getReceivingNode, getReceivingTask, getSendingNode, getSendingTask, getType, isConnected, removeCableListener
public void connect(Node sendnode, Node recnode) throws CableException
connect
in interface Cable
connect
in class CableImp
CableException
public void reconnect(Node node) throws CableException
reconnect
in interface Cable
reconnect
in class CableImp
CableException
public void disconnect() throws CableException
disconnect
in interface Cable
disconnect
in class CableImp
CableException
protected java.lang.Object preSend(java.lang.Object data, boolean blocking)
data
- the data being sentblocking
- true if it is a blocking sendprotected java.lang.Object preReceive(java.lang.Object data)
data
- the data being receivedpublic java.lang.Object recv()
recv
in interface InputCable
public boolean isDataSent()
isDataSent
in interface OutputCable
public void send(java.lang.Object data)
send
in interface OutputCable
data
- the data to be sentpublic void sendNonBlocking(java.lang.Object data)
sendNonBlocking
in interface OutputCable
data
- the data to be sentpublic void createMonitor()
public void destroyMonitor()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public boolean isDataReady()
isDataReady
in interface InputCable
public void suspend()
suspend
in interface InputCable
suspend
in interface OutputCable
public void flush()
flush
in interface InputCable
flush
in interface OutputCable
public void resume()
resume
in interface InputCable
resume
in interface OutputCable
public void nodeParentChanged(NodeEvent event)
nodeParentChanged
in interface NodeListener
public void nodeChildChanged(NodeEvent event)
nodeChildChanged
in interface NodeListener
public void nodeConnected(NodeEvent event)
nodeConnected
in interface NodeListener
public void nodeDisconnected(NodeEvent event)
nodeDisconnected
in interface NodeListener
public void parameterNameSet(NodeEvent event)
parameterNameSet
in interface NodeListener