Class FilteredChannelFactory
- All Implemented Interfaces:
BufferedChannelArrayFactory
,BufferedChannelFactory
,ChannelArrayFactory
,ChannelFactory
This class is used for constructing Filtered Channels.
The objects returned by instances of this class will implement
the appropriate Filtered Channel interfaces even though the return
types are not declared as being Filtered Channels. This is so
that this class can implement the ChannelFactory
and
ChannelArrayFactory
interfaces. Instances of this class
can therefore be used in place of the standard channel factory classes.
A set of read and/or write filters can be specified so that all of the channels created by this factory will have the same buffering properties.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StandardChannelFactory
Underlying factory for creating the base channels.private Filter[]
Read filters to install in channels created by this factory.private Filter[]
Write filters to install in channels created by this factory. -
Constructor Summary
ConstructorsConstructorDescriptionAll channels constructed with a Factory constructed with this constructor will default to having no pre-installed filters.FilteredChannelFactory
(Filter[] readFilters, Filter[] writeFilters) All channels constructed with this Factory instance will have the specifiedFilter
objects inserted into them. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new Any2Any channel with the filtering options set for this factory.createAny2Any
(int n) Constructs and returns an array ofAny2AnyChannel
objects.createAny2Any
(ChannelDataStore buffer) Creates a new Any2Any channel with the filtering options set for this factory and the specified data buffer.createAny2Any
(ChannelDataStore buffer, int n) Constructs and returns an array ofAny2AnyChannel
objects with a given buffering behaviour.Creates a new Any2One channel with the filtering options set for this factory.createAny2One
(int n) Constructs and returns an array ofAny2OneChannel
objects.createAny2One
(ChannelDataStore buffer) Creates a new Any2One channel with the filtering options set for this factory and the specified data buffer.createAny2One
(ChannelDataStore buffer, int n) Constructs and returns an array ofAny2OneChannel
objects with a given buffering behaviour.Creates a new One2Any channel with the filtering options set for this factory.createOne2Any
(int n) Constructs and returns an array ofOne2AnyChannel
objects.createOne2Any
(ChannelDataStore buffer) Creates a new One2Any channel with the filtering options set for this factory and the specified data buffer.createOne2Any
(ChannelDataStore buffer, int n) Constructs and returns an array ofOne2AnyChannel
objects with a given buffering behaviour.Creates a new One2One channel with the filtering options set for this factory.createOne2One
(int n) Constructs and returns an array ofOne2OneChannel
objects.createOne2One
(ChannelDataStore buffer) Creates a new One2One channel with the filtering options set for this factory and the specified data buffer.createOne2One
(ChannelDataStore buffer, int n) Constructs and returns an array ofOne2OneChannel
objects with a given buffering behaviour.private void
installFilters
(ReadFiltered readFiltered, WriteFiltered writeFiltered) Installs the filters currently set for this factory into the read/write channel ends supplied.
-
Field Details
-
factory
Underlying factory for creating the base channels. -
readFilters
Read filters to install in channels created by this factory. -
writeFilters
Write filters to install in channels created by this factory.
-
-
Constructor Details
-
FilteredChannelFactory
public FilteredChannelFactory()All channels constructed with a Factory constructed with this constructor will default to having no pre-installed filters. -
FilteredChannelFactory
All channels constructed with this Factory instance will have the specified
Filter
objects inserted into them. The same instances of the filters will be inserted into each channel.Either of the parameters may be
null
if read/write filters are not required.- Parameters:
readFilters
- optional read filters to install in new channels.writeFilters
- optional write filters to install in new channels.
-
-
Method Details
-
installFilters
Installs the filters currently set for this factory into the read/write channel ends supplied.- Parameters:
readFiltered
- optional control interface for the read end of a filtered channel.writeFiltered
- optional control interface for the write end of a filtered channel.
-
createOne2One
Creates a new One2One channel with the filtering options set for this factory.- Specified by:
createOne2One
in interfaceChannelFactory
- Returns:
- the created channel with the filters installed.
-
createAny2One
Creates a new Any2One channel with the filtering options set for this factory.- Specified by:
createAny2One
in interfaceChannelFactory
- Returns:
- the created channel with the filters installed.
-
createOne2Any
Creates a new One2Any channel with the filtering options set for this factory.- Specified by:
createOne2Any
in interfaceChannelFactory
- Returns:
- the created channel with the filters installed.
-
createAny2Any
Creates a new Any2Any channel with the filtering options set for this factory.- Specified by:
createAny2Any
in interfaceChannelFactory
- Returns:
- the created channel with the filters installed.
-
createOne2One
Constructs and returns an array ofOne2OneChannel
objects.- Specified by:
createOne2One
in interfaceChannelArrayFactory
- Parameters:
n
- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createAny2One
Constructs and returns an array ofAny2OneChannel
objects.- Specified by:
createAny2One
in interfaceChannelArrayFactory
- Parameters:
n
- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createOne2Any
Constructs and returns an array ofOne2AnyChannel
objects.- Specified by:
createOne2Any
in interfaceChannelArrayFactory
- Parameters:
n
- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createAny2Any
Constructs and returns an array ofAny2AnyChannel
objects.- Specified by:
createAny2Any
in interfaceChannelArrayFactory
- Parameters:
n
- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createOne2One
Creates a new One2One channel with the filtering options set for this factory and the specified data buffer.- Specified by:
createOne2One
in interfaceBufferedChannelFactory
- Parameters:
buffer
- the buffer implementation to use.- Returns:
- the created filtered channel.
-
createAny2One
Creates a new Any2One channel with the filtering options set for this factory and the specified data buffer.- Specified by:
createAny2One
in interfaceBufferedChannelFactory
- Parameters:
buffer
- the buffer implementation to use.- Returns:
- the created filtered channel.
-
createOne2Any
Creates a new One2Any channel with the filtering options set for this factory and the specified data buffer.- Specified by:
createOne2Any
in interfaceBufferedChannelFactory
- Parameters:
buffer
- the buffer implementation to use.- Returns:
- the created filtered channel.
-
createAny2Any
Creates a new Any2Any channel with the filtering options set for this factory and the specified data buffer.- Specified by:
createAny2Any
in interfaceBufferedChannelFactory
- Parameters:
buffer
- the buffer implementation to use.- Returns:
- the created filtered channel.
-
createOne2One
Constructs and returns an array ofOne2OneChannel
objects with a given buffering behaviour.- Specified by:
createOne2One
in interfaceBufferedChannelArrayFactory
- Parameters:
buffer
- the buffer implementation to use.n
- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createAny2One
Constructs and returns an array ofAny2OneChannel
objects with a given buffering behaviour.- Specified by:
createAny2One
in interfaceBufferedChannelArrayFactory
- Parameters:
buffer
- the buffer implementation to use.n
- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createOne2Any
Constructs and returns an array ofOne2AnyChannel
objects with a given buffering behaviour.- Specified by:
createOne2Any
in interfaceBufferedChannelArrayFactory
- Parameters:
buffer
- the buffer implementation to use.n
- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createAny2Any
Constructs and returns an array ofAny2AnyChannel
objects with a given buffering behaviour.- Specified by:
createAny2Any
in interfaceBufferedChannelArrayFactory
- Parameters:
buffer
- the buffer implementation to use.n
- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-