public class FilteredSharedChannelOutputWrapper extends ChannelOutputWrapper implements FilteredSharedChannelOutput
SharedChannelOutput that adds
write filtering. Instances of this class can be safely used by
multiple concurrent processes.| Constructor and Description |
|---|
FilteredSharedChannelOutputWrapper(SharedChannelOutput out)
Constructs a new wrapper for the given channel output end.
|
| 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. |
Filter |
getWriteFilter(int index)
Returns the write filter installed at the given index.
|
int |
getWriteFilterCount()
Returns the number of write filters currently installed.
|
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 data)
Writes a value to the channel.
|
poisonclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpoisonpublic FilteredSharedChannelOutputWrapper(SharedChannelOutput out)
out - the existing channel end.public void write(java.lang.Object data)
ChannelOutputWrapperwrite in interface ChannelOutputdata - the value to write.ChannelOutputpublic 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.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.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.public void removeWriteFilter(int index)
WriteFilteredremoveWriteFilter in interface WriteFilteredindex - zero-based index of the filter to be removed.public Filter getWriteFilter(int index)
WriteFilteredgetWriteFilter in interface WriteFilteredindex - zero-based index of the filter to return.public int getWriteFilterCount()
WriteFilteredgetWriteFilterCount in interface WriteFilteredCopyright © 1996–2022. All rights reserved.