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()
MigratableChannelOutputprepareToMove in interface MigratableChannelOutputMigratableChannelOutput.prepareToMove()public void recreate()
NetChannelOutputRequests that the instance of the implementing class should reinitialize itself.
recreate in interface NetChannelOutputNetChannelOutput.recreate()public void recreate(NetChannelLocation newLoc)
NetChannelOutputRequests that the instance of the implementing class should reinitialize itself with a new location.
recreate in interface NetChannelOutputnewLoc - the new location.NetChannelOutput.recreate(NetChannelLocation)public void destroyWriter()
NetChannelOutputDestroys the channel writer end and frees all the underlying JCSP.NET resources.
destroyWriter in interface NetChannelOutputNetChannelOutput.destroyWriter()public void write(java.lang.Object object)
ChannelOutputwrite in interface ChannelOutputobject - the object to write to the channelChannelOutput.write(Object)public NetChannelLocation getChannelLocation()
NetworkedNetworked
ChannelInput.getChannelLocation in interface NetworkedNetChannelLocation object.Networked.getChannelLocation()public java.lang.Class getFactoryClass()
NetChannelOutputReturns the factory class used for constructing this channel end object.
getFactoryClass in interface NetChannelOutputClass of thepublic void addWriteFilter(Filter filter)
WriteFilteredwrite 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 WriteFilteredfilter - the filter to be installed; may not be null.WriteFiltered.addWriteFilter(Filter)public void addWriteFilter(Filter filter, int index)
WriteFilteredwrite 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 WriteFilteredfilter - 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)
WriteFilteredr, will satisfy the condition r.equals (filter). The remaining
filters are shifted to close the gap in the index allocation.removeWriteFilter in interface WriteFilteredfilter - the filter to be removed; may not be null.WriteFiltered.removeWriteFilter(Filter)public void removeWriteFilter(int index)
WriteFilteredremoveWriteFilter in interface WriteFilteredindex - zero-based index of the filter to be removed.WriteFiltered.removeWriteFilter(int)public Filter getWriteFilter(int index)
WriteFilteredgetWriteFilter in interface WriteFilteredindex - zero-based index of the filter to return.WriteFiltered.getWriteFilter(int)public int getWriteFilterCount()
WriteFilteredgetWriteFilterCount in interface WriteFilteredWriteFiltered.getWriteFilterCount()private void writeObject(java.io.ObjectOutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic void poison(int strength)
poison in interface Poisonablestrength - the strength of the poison (must be >= 0).