Class StandardChannelFactory
- All Implemented Interfaces:
BufferedChannelArrayFactory
,BufferedChannelFactory
,ChannelArrayFactory
,ChannelFactory
This class acts as a Factory for creating channels. It can create non-buffered and buffered channels and also arrays of non-buffered and buffered channels.
The Channel objects created by this Factory are formed of
separate objects for the read and write ends. Therefore the
ChannelInput
object cannot be cast into the
ChannelOutput
object and vice-versa.
The current implementation uses an instance of the
RiskyChannelFactory
to construct the underlying
raw channels.
- Author:
- Quickstone Technologies Limited
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConstructs and returns anAny2AnyChannel
object.createAny2Any
(int n) Constructs and returns an array ofAny2AnyChannel
objects.createAny2Any
(ChannelDataStore buffer) Constructs and returns aAny2AnyChannel
object which uses the specifiedChannelDataStore
object as a buffer.createAny2Any
(ChannelDataStore buffer, int n) Constructs and returns an array ofAny2AnyChannel
objects which use the specifiedChannelDataStore
object as a buffer.Constructs and returns anAny2OneChannel
object.createAny2One
(int n) Constructs and returns an array ofAny2OneChannel
objects.createAny2One
(ChannelDataStore buffer) Constructs and returns aAny2OneChannel
object which uses the specifiedChannelDataStore
object as a buffer.createAny2One
(ChannelDataStore buffer, int n) Constructs and returns an array ofAny2OneChannel
objects which use the specifiedChannelDataStore
object as a buffer.Constructs and returns aOne2AnyChannel
object.createOne2Any
(int n) Constructs and returns an array ofOne2AnyChannel
objects.createOne2Any
(ChannelDataStore buffer) Constructs and returns aOne2AnyChannel
object which uses the specifiedChannelDataStore
object as a buffer.createOne2Any
(ChannelDataStore buffer, int n) Constructs and returns an array ofOne2AnyChannel
objects which use the specifiedChannelDataStore
object as a buffer.Constructs and returns aOne2OneChannel
object.createOne2One
(int n) Constructs and returns an array ofOne2OneChannel
objects.createOne2One
(ChannelDataStore buffer) Constructs and returns aOne2OneChannel
object which uses the specifiedChannelDataStore
object as a buffer.createOne2One
(ChannelDataStore buffer, int n) Constructs and returns an array ofOne2OneChannel
objects which use the specifiedChannelDataStore
object as a buffer.static StandardChannelFactory
Returns a default instance of a channel factory.
-
Constructor Details
-
StandardChannelFactory
public StandardChannelFactory()Constructs a new factory.
-
-
Method Details
-
getDefaultInstance
Returns a default instance of a channel factory. -
createOne2One
Constructs and returns aOne2OneChannel
object.- Specified by:
createOne2One
in interfaceChannelFactory
- Returns:
- the channel object.
- See Also:
-
createAny2One
Constructs and returns anAny2OneChannel
object.- Specified by:
createAny2One
in interfaceChannelFactory
- Returns:
- the channel object.
- See Also:
-
createOne2Any
Constructs and returns aOne2AnyChannel
object.- Specified by:
createOne2Any
in interfaceChannelFactory
- Returns:
- the channel object.
- See Also:
-
createAny2Any
Constructs and returns anAny2AnyChannel
object.- Specified by:
createAny2Any
in interfaceChannelFactory
- Returns:
- the channel object.
- See Also:
-
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
Constructs and returns a
One2OneChannel
object which uses the specifiedChannelDataStore
object as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel.
- Specified by:
createOne2One
in interfaceBufferedChannelFactory
- Parameters:
buffer
- theChannelDataStore
to use.- Returns:
- the buffered channel.
- See Also:
-
createAny2One
Constructs and returns a
Any2OneChannel
object which uses the specifiedChannelDataStore
object as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel.
- Specified by:
createAny2One
in interfaceBufferedChannelFactory
- Parameters:
buffer
- theChannelDataStore
to use.- Returns:
- the buffered channel.
- See Also:
-
createOne2Any
Constructs and returns a
One2AnyChannel
object which uses the specifiedChannelDataStore
object as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel.
- Specified by:
createOne2Any
in interfaceBufferedChannelFactory
- Parameters:
buffer
- theChannelDataStore
to use.- Returns:
- the buffered channel.
- See Also:
-
createAny2Any
Constructs and returns a
Any2AnyChannel
object which uses the specifiedChannelDataStore
object as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel.
- Specified by:
createAny2Any
in interfaceBufferedChannelFactory
- Parameters:
buffer
- theChannelDataStore
to use.- Returns:
- the buffered channel.
- See Also:
-
createOne2One
Constructs and returns an array of
One2OneChannel
objects which use the specifiedChannelDataStore
object as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel. This is why an array of buffers is not required.
- Specified by:
createOne2One
in interfaceBufferedChannelArrayFactory
- Parameters:
buffer
- theChannelDataStore
to use.n
- the size of the array of channels.- Returns:
- the array of buffered channels.
- See Also:
-
createAny2One
Constructs and returns an array of
Any2OneChannel
objects which use the specifiedChannelDataStore
object as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel. This is why an array of buffers is not required.
- Specified by:
createAny2One
in interfaceBufferedChannelArrayFactory
- Parameters:
buffer
- theChannelDataStore
to use.n
- the size of the array of channels.- Returns:
- the array of buffered channels.
- See Also:
-
createOne2Any
Constructs and returns an array of
One2AnyChannel
objects which use the specifiedChannelDataStore
object as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel. This is why an array of buffers is not required.
- Specified by:
createOne2Any
in interfaceBufferedChannelArrayFactory
- Parameters:
buffer
- theChannelDataStore
to use.n
- the size of the array of channels.- Returns:
- the array of buffered channels.
- See Also:
-
createAny2Any
Constructs and returns an array of
Any2AnyChannel
objects which use the specifiedChannelDataStore
object as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel. This is why an array of buffers is not required.
- Specified by:
createAny2Any
in interfaceBufferedChannelArrayFactory
- Parameters:
buffer
- theChannelDataStore
to use.n
- the size of the array of channels.- Returns:
- the array of buffered channels.
- See Also:
-