Class StandardChannelFactory<T>
- All Implemented Interfaces:
BufferedChannelArrayFactory<T>, BufferedChannelFactory<T>, ChannelArrayFactory<T>, ChannelFactory<T>
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConstructs and returns anAny2AnyChannelobject.createAny2Any(int n) Constructs and returns an array ofAny2AnyChannelobjects.createAny2Any(ChannelDataStore<T> buffer) Constructs and returns aAny2AnyChannelobject which uses the specifiedChannelDataStoreobject as a buffer.Any2AnyChannel<T>[]createAny2Any(ChannelDataStore<T> buffer, int n) Constructs and returns an array ofAny2AnyChannelobjects which use the specifiedChannelDataStoreobject as a buffer.Constructs and returns anAny2OneChannelobject.Any2OneChannel<T>[]createAny2One(int n) Constructs and returns an array ofAny2OneChannelobjects.createAny2One(ChannelDataStore<T> buffer) Constructs and returns aAny2OneChannelobject which uses the specifiedChannelDataStoreobject as a buffer.Any2OneChannel<T>[]createAny2One(ChannelDataStore<T> buffer, int n) Constructs and returns an array ofAny2OneChannelobjects which use the specifiedChannelDataStoreobject as a buffer.Constructs and returns aOne2AnyChannelobject.One2AnyChannel<T>[]createOne2Any(int n) Constructs and returns an array ofOne2AnyChannelobjects.createOne2Any(ChannelDataStore<T> buffer) Constructs and returns aOne2AnyChannelobject which uses the specifiedChannelDataStoreobject as a buffer.One2AnyChannel<T>[]createOne2Any(ChannelDataStore<T> buffer, int n) Constructs and returns an array ofOne2AnyChannelobjects which use the specifiedChannelDataStoreobject as a buffer.Constructs and returns aOne2OneChannelobject.One2OneChannel<T>[]createOne2One(int n) Constructs and returns an array ofOne2OneChannelobjects.createOne2One(ChannelDataStore<T> buffer) Constructs and returns aOne2OneChannelobject which uses the specifiedChannelDataStoreobject as a buffer.One2OneChannel<T>[]createOne2One(ChannelDataStore<T> buffer, int n) Constructs and returns an array ofOne2OneChannelobjects which use the specifiedChannelDataStoreobject as a buffer.static StandardChannelFactoryReturns a default instance of a channel factory.
-
Field Details
-
defaultInstance
-
-
Constructor Details
-
StandardChannelFactory
public StandardChannelFactory()Constructs a new factory.
-
-
Method Details
-
getDefaultInstance
Returns a default instance of a channel factory. -
createOne2One
Constructs and returns aOne2OneChannelobject.- Specified by:
createOne2Onein interfaceChannelFactory<T>- Returns:
- the channel object.
- See Also:
-
createAny2One
Constructs and returns anAny2OneChannelobject.- Specified by:
createAny2Onein interfaceChannelFactory<T>- Returns:
- the channel object.
- See Also:
-
createOne2Any
Constructs and returns aOne2AnyChannelobject.- Specified by:
createOne2Anyin interfaceChannelFactory<T>- Returns:
- the channel object.
- See Also:
-
createAny2Any
Constructs and returns anAny2AnyChannelobject.- Specified by:
createAny2Anyin interfaceChannelFactory<T>- Returns:
- the channel object.
- See Also:
-
createOne2One
Constructs and returns an array ofOne2OneChannelobjects.- Specified by:
createOne2Onein interfaceChannelArrayFactory<T>- Parameters:
n- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createAny2One
Constructs and returns an array ofAny2OneChannelobjects.- Specified by:
createAny2Onein interfaceChannelArrayFactory<T>- Parameters:
n- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createOne2Any
Constructs and returns an array ofOne2AnyChannelobjects.- Specified by:
createOne2Anyin interfaceChannelArrayFactory<T>- Parameters:
n- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createAny2Any
Constructs and returns an array ofAny2AnyChannelobjects.- Specified by:
createAny2Anyin interfaceChannelArrayFactory<T>- Parameters:
n- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
-
createOne2One
Constructs and returns a
One2OneChannelobject which uses the specifiedChannelDataStoreobject as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel.
- Specified by:
createOne2Onein interfaceBufferedChannelFactory<T>- Parameters:
buffer- theChannelDataStoreto use.- Returns:
- the buffered channel.
- See Also:
-
createAny2One
Constructs and returns a
Any2OneChannelobject which uses the specifiedChannelDataStoreobject as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel.
- Specified by:
createAny2Onein interfaceBufferedChannelFactory<T>- Parameters:
buffer- theChannelDataStoreto use.- Returns:
- the buffered channel.
- See Also:
-
createOne2Any
Constructs and returns a
One2AnyChannelobject which uses the specifiedChannelDataStoreobject as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel.
- Specified by:
createOne2Anyin interfaceBufferedChannelFactory<T>- Parameters:
buffer- theChannelDataStoreto use.- Returns:
- the buffered channel.
- See Also:
-
createAny2Any
Constructs and returns a
Any2AnyChannelobject which uses the specifiedChannelDataStoreobject as a buffer.The buffer supplied to this method is cloned before it is inserted into the channel.
- Specified by:
createAny2Anyin interfaceBufferedChannelFactory<T>- Parameters:
buffer- theChannelDataStoreto use.- Returns:
- the buffered channel.
- See Also:
-
createOne2One
Constructs and returns an array of
One2OneChannelobjects which use the specifiedChannelDataStoreobject 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:
createOne2Onein interfaceBufferedChannelArrayFactory<T>- Parameters:
buffer- theChannelDataStoreto use.n- the size of the array of channels.- Returns:
- the array of buffered channels.
- See Also:
-
createAny2One
Constructs and returns an array of
Any2OneChannelobjects which use the specifiedChannelDataStoreobject 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:
createAny2Onein interfaceBufferedChannelArrayFactory<T>- Parameters:
buffer- theChannelDataStoreto use.n- the size of the array of channels.- Returns:
- the array of buffered channels.
- See Also:
-
createOne2Any
Constructs and returns an array of
One2AnyChannelobjects which use the specifiedChannelDataStoreobject 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:
createOne2Anyin interfaceBufferedChannelArrayFactory<T>- Parameters:
buffer- theChannelDataStoreto use.n- the size of the array of channels.- Returns:
- the array of buffered channels.
- See Also:
-
createAny2Any
Constructs and returns an array of
Any2AnyChannelobjects which use the specifiedChannelDataStoreobject 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:
createAny2Anyin interfaceBufferedChannelArrayFactory<T>- Parameters:
buffer- theChannelDataStoreto use.n- the size of the array of channels.- Returns:
- the array of buffered channels.
- See Also:
-