class MigratableChannelOutputImpl extends java.lang.Object implements MigratableChannelOutput
Modifier and Type | Field and Description |
---|---|
private NetChannelOutput |
actualOut
The actual networked output channel end.
|
private FilteredChannelOutput |
filteredOut
The filtered channel end.
|
private java.util.Vector |
filters
The filters applied to the channel.
|
private OutputReconnectionManager |
mgr
The output reconnection manager for the channel.
|
Constructor and Description |
---|
MigratableChannelOutputImpl(NetChannelOutput out)
MigratableChannelOutputImpl objects constructed with
this constructor make use of the default channel name service. |
MigratableChannelOutputImpl(OutputReconnectionManager mgr)
Constructs a new
MigratableChannelOutputImpl with the given reconnection manager. |
Modifier and Type | Method and Description |
---|---|
void |
addWriteFilter(Filter filter)
Installs a write filter defining a transformation to be applied by the
write method of
the channel end. |
void |
addWriteFilter(Filter filter,
int index)
Installs a write filter defining a transformation to be applied by the
write method of the
channel end at a specific index. |
void |
destroyWriter()
Destroys the channel writer end and frees all the
underlying JCSP.NET resources.
|
NetChannelLocation |
getChannelLocation()
Returns the location of the
Networked
ChannelInput . |
java.lang.Class |
getFactoryClass()
Returns the factory class used for constructing this channel
end object.
|
Filter |
getWriteFilter(int index)
Returns the write filter installed at the given index.
|
int |
getWriteFilterCount()
Returns the number of write filters currently installed.
|
void |
poison(int strength)
Currently, network channels are unpoisonable so this method has no effect.
|
void |
prepareToMove()
Prepares the channel end for movement to another node.
|
void |
recreate()
Requests that the instance of the implementing class should
reinitialize itself.
|
void |
recreate(NetChannelLocation newLoc)
Requests that the instance of the implementing class should
reinitialize itself with a new location.
|
void |
removeWriteFilter(Filter filter)
Removes the first write filter (lowest index) matching the filter given as a parameter.
|
void |
removeWriteFilter(int index)
Removes the write filter installed at the given index.
|
void |
write(java.lang.Object object)
Write an Object to the channel.
|
private void |
writeObject(java.io.ObjectOutputStream out) |
private OutputReconnectionManager mgr
private transient NetChannelOutput actualOut
private transient FilteredChannelOutput filteredOut
private java.util.Vector filters
public MigratableChannelOutputImpl(NetChannelOutput out)
MigratableChannelOutputImpl
objects constructed with
this constructor make use of the default channel name service.out
- the underlying networked channel output.public MigratableChannelOutputImpl(OutputReconnectionManager mgr)
MigratableChannelOutputImpl
with the given reconnection manager.mgr
- the reconnection manager to use for the channel.public void prepareToMove()
MigratableChannelOutput
prepareToMove
in interface MigratableChannelOutput
MigratableChannelOutput.prepareToMove()
public void recreate()
NetChannelOutput
Requests that the instance of the implementing class should reinitialize itself.
recreate
in interface NetChannelOutput
NetChannelOutput.recreate()
public void recreate(NetChannelLocation newLoc)
NetChannelOutput
Requests that the instance of the implementing class should reinitialize itself with a new location.
recreate
in interface NetChannelOutput
newLoc
- the new location.NetChannelOutput.recreate(NetChannelLocation)
public void destroyWriter()
NetChannelOutput
Destroys the channel writer end and frees all the underlying JCSP.NET resources.
destroyWriter
in interface NetChannelOutput
NetChannelOutput.destroyWriter()
public void write(java.lang.Object object)
ChannelOutput
write
in interface ChannelOutput
object
- the object to write to the channelChannelOutput.write(Object)
public NetChannelLocation getChannelLocation()
Networked
Networked
ChannelInput
.getChannelLocation
in interface Networked
NetChannelLocation
object.Networked.getChannelLocation()
public java.lang.Class getFactoryClass()
NetChannelOutput
Returns the factory class used for constructing this channel end object.
getFactoryClass
in interface NetChannelOutput
Class
of thepublic void addWriteFilter(Filter filter)
WriteFiltered
write
method of
the channel end. The filter will be appended to the end of the current list, making it the last to
be applied.addWriteFilter
in interface WriteFiltered
filter
- the filter to be installed; may not be null.WriteFiltered.addWriteFilter(Filter)
public void addWriteFilter(Filter filter, int index)
WriteFiltered
write
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.addWriteFilter
in interface WriteFiltered
filter
- the filter to be installed; may not be null.index
- the zero based index; may not be negative.WriteFiltered.addWriteFilter(Filter, int)
public void removeWriteFilter(Filter filter)
WriteFiltered
r
, will satisfy the condition r.equals (filter)
. The remaining
filters are shifted to close the gap in the index allocation.removeWriteFilter
in interface WriteFiltered
filter
- the filter to be removed; may not be null.WriteFiltered.removeWriteFilter(Filter)
public void removeWriteFilter(int index)
WriteFiltered
removeWriteFilter
in interface WriteFiltered
index
- zero-based index of the filter to be removed.WriteFiltered.removeWriteFilter(int)
public Filter getWriteFilter(int index)
WriteFiltered
getWriteFilter
in interface WriteFiltered
index
- zero-based index of the filter to return.WriteFiltered.getWriteFilter(int)
public int getWriteFilterCount()
WriteFiltered
getWriteFilterCount
in interface WriteFiltered
WriteFiltered.getWriteFilterCount()
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void poison(int strength)
poison
in interface Poisonable
strength
- the strength of the poison (must be >= 0).