class MigratableAltingChannelInputImpl extends MigratableAltingChannelInput
Alternative
.Modifier and Type | Field and Description |
---|---|
private NetAltingChannelInput |
actualIn
The actual channel input.
|
(package private) static FilteredChannelEndFactory |
FACTORY
Factory for creating filtered channel ends.
|
private FilteredChannelInput |
filteredIn
A filtered channel input wrapper that wraps the
actualIn
channel. |
private java.util.Vector |
filters
A Vector of
Filter objects that is used during
serialization. |
private InputReconnectionManager |
mgr
The reconnection manager for the channel.
|
Constructor and Description |
---|
MigratableAltingChannelInputImpl(InputReconnectionManager mgr)
Constructs a new
MigratableAltingChannelInputImpl with a specified reconnection
manager object. |
MigratableAltingChannelInputImpl(NetAltingChannelInput in)
Constructor for MigratableAltingChannelInputImpl.
|
Modifier and Type | Method and Description |
---|---|
void |
addReadFilter(Filter filter)
Installs a read filter defining a transformation to be applied by the
read method of the
channel end. |
void |
addReadFilter(Filter filter,
int index)
Installs a read filter defining a transformation to be applied by the
read method of the
channel end at a specific index. |
void |
destroyReader()
Destroys the channel end and frees any resources within
the JCSP.NET infrastructure.
|
NetChannelLocation |
getChannelLocation()
Returns the location of the
Networked
ChannelInput . |
java.lang.Class |
getFactoryClass()
Returns
null . |
Filter |
getReadFilter(int index)
Returns the read filter installed at the given index.
|
int |
getReadFilterCount()
Returns the number of read filters currently installed.
|
void |
prepareToMove()
Prepares the channel end for movement to another node.
|
java.lang.Object |
read()
Reads an object from the underlying channel.
|
private void |
readObject(java.io.ObjectInputStream in)
Reads the serialized object from an input stream.
|
void |
removeReadFilter(Filter filter)
Removes the first read filter (lowest index) matching the filter given as a parameter.
|
void |
removeReadFilter(int index)
Removes the read filter installed at the given index.
|
private void |
writeObject(java.io.ObjectOutputStream out)
When serializing object to the output stream, the filters from the underlying channel are
extracted so that they too get serialized.
|
endRead, getChannel, pending, poison, setChannel, startRead
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endRead, startRead
poison
static FilteredChannelEndFactory FACTORY
private transient NetAltingChannelInput actualIn
filteredIn
channel.private transient FilteredChannelInput filteredIn
actualIn
channel.private InputReconnectionManager mgr
private java.util.Vector filters
Filter
objects that is used during
serialization.public MigratableAltingChannelInputImpl(NetAltingChannelInput in)
NetAltingChannelInput
and constructs
a default InputReconnectionManager
object and then uses
the constructor taking a single InputReconnectionManager
object.
MigratableAltingChannelInputImpl
objects constructed with
this constructor make use of the default channel name service.in
- the actual NetAltingChannelInput
object to
use.public MigratableAltingChannelInputImpl(InputReconnectionManager mgr)
MigratableAltingChannelInputImpl
with a specified reconnection
manager object. This should have been given the channel when it was constructed.mgr
- the reconnection manager.public NetChannelLocation getChannelLocation()
Networked
Networked
ChannelInput
.NetChannelLocation
object.Networked.getChannelLocation()
public java.lang.Object read()
read
in interface ChannelInput
read
in class AltingChannelInputWrapper
public void addReadFilter(Filter filter)
ReadFiltered
read
method of the
channel end. The filter will be appended to the end of the current list, making it the last to
be applied.filter
- the filter to be installed; may not be null.ReadFiltered.addReadFilter(Filter)
public void addReadFilter(Filter filter, int index)
ReadFiltered
read
method of the
channel end at a specific index. If there is already a filter at that index position the existing
filters are shifted to make room. If the index is greater than the number of filters already
installed the filter is placed at the end.filter
- the filter to be installed; may not be null.index
- the zero based index; may not be negative.ReadFiltered.addReadFilter(Filter, int)
public void removeReadFilter(Filter filter)
ReadFiltered
r
, will satisfy the condition r.equals (filter)
. The remaining
filters are shifted to close the gap in the index allocation.filter
- the filter to be removed; may not be null.ReadFiltered.removeReadFilter(Filter)
public void removeReadFilter(int index)
ReadFiltered
index
- zero-based index of the filter to be removed.ReadFiltered.removeReadFilter(int)
public Filter getReadFilter(int index)
ReadFiltered
index
- zero-based index of the filter to return.ReadFiltered.getReadFilter(int)
public int getReadFilterCount()
ReadFiltered
ReadFiltered.getReadFilterCount()
public void destroyReader()
NetChannelInput
Destroys the channel end and frees any resources within the JCSP.NET infrastructure.
org.jcsp.net.NetChannelInputManager#destroyReader()
public java.lang.Class getFactoryClass()
null
.Class
of the factory class.public void prepareToMove()
MigratableChannelInput
org.jcsp.dynamic.MigratableChannelInput#prepareToMove()
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
out
- the stream to write the object to.java.io.IOException
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- object source stream.java.io.IOException
java.lang.ClassNotFoundException