Channel components are use to exchange messages between different
address spaces.
We distinguish two Channel components : ChannelIn and ChannelOut.
- ChannelIn are used to received messages from other address
space.
- ChannelOut are used to send mesage to other address space.
This package contains various Channel implementationx. They are
based on an abstraction of a socket. A socket provides an input,
an output and a method to close it (see {@link
org.objectweb.dream.channel.SocketState} interface).
Channel components use {@link
org.objectweb.dream.message.codec.MessageCodec} interface to encode and
decode message using input or output provided by a
socket.
Channel components are composite components build as following :
TODO insert pictures
PushChannelOut are composed by :
- GenericPushChannelOut component (implemented by {@link
org.objectweb.dream.channel.GenericPushChannelOutImpl}). When this
component receive a message on its {@link org.objectweb.dream.Push}
interface, it use a {@link org.objectweb.dream.channel.SocketManager}
to retrieve a socket to send the message. Then it use a {@link
org.objectweb.dream.message.codec.MessageCodec} to encode the message.
Finally, if the component is bound to a component providing a {@link
org.objectweb.dream.channel.WaitByte} interface, it wait for an
acknowledgement.
- SocketManager components. These components are responsible
to give {@link org.objectweb.dream.channel.SocketState} to GenericPushChannelOut
component. Their role is to choose a ChannelIn for each
message, then to find a socket to send this message to the chosen ChannelIn.
These two steps are acheived by differents components. Fisrts ones
identify a ChannelIn, seconds ones find the socket.
The identification of a ChannelIn depends on the socket
implementation. For example, TCP Channels use an inet adresse and a
port to identify a ChannelIn. So components responsible to find
a socket provide the {@link
org.objectweb.dream.channel.IPSocketManager} interface (see {@link
org.objectweb.dream.channel.IPSocketManagerTCPImpl} component).
Provided SocketManager components are the following :
- {@link org.objectweb.dream.channel.SocketManagerIPStaticImpl}
identify staticaly a ChannelIn using its attribute controller
interface ({@link
org.objectweb.dream.channel.SocketManagerIPStaticAttributeController}).
- {@link
org.objectweb.dream.channel.SocketManagerIPChunkBasedImpl} identify a ChannelIn
by retrieving a {@link
org.objectweb.dream.channel.IPChannelDestinationChunk} chunk in each
message. The name of the chunk can be configured using the attribute
controller interface ({@link
org.objectweb.dream.channel.SocketManagerIPChunkBasedAttributeController}).
- {@link org.objectweb.dream.channel.IPSocketManagerTCPImpl}
create socket using given inet address and port. The release method
simply close the socket state.
- {@link
org.objectweb.dream.channel.IPSocketManagerCachingImpl} manage a cache
of socket. If the asked socket can't be found in the cache or is
closed, this component delegate to a client IPSocketManager.
The cache size can be configured using the attribute controller.
If a socket is asked two time before being released, an exception is
thrown.
- An optional WaitAck component used to wait an
acknowledgment on the input of the socket used to send the message. If
the byte received is not null, an exception is thrown.
PushChannelIn are composed by :
- GenericPushChannelIn component (implemented by {@link
org.objectweb.dream.channel.GeneriquePushChannelIn}). When this
component receive a socket on its {@link
org.objectweb.dream.channel.OpenedSocket} interface, it use a {@link
org.objectweb.dream.message.codec.MessageCodec} to decode an incomming
message. Then, if the component is bound to a component providing a
{@link
org.objectweb.dream.channel.SendByte} interface, it send an
acknowledgement.
- OpenedSocketManager components. These components are
responsible to
give {@link org.objectweb.dream.channel.SocketState} to GenericPushChannelIn
component to read message from.