eneter.messaging.nodes.channelwrapper
Class ChannelWrapperFactory

java.lang.Object
  extended by eneter.messaging.nodes.channelwrapper.ChannelWrapperFactory
All Implemented Interfaces:
IChannelWrapperFactory

public class ChannelWrapperFactory
extends java.lang.Object
implements IChannelWrapperFactory

Factory for creating channel wrapper and unwrapper.


Constructor Summary
ChannelWrapperFactory()
          Constructs the factory.
ChannelWrapperFactory(ISerializer serializer)
          Constructs the factory.
 
Method Summary
 IDuplexChannelUnwrapper createDuplexChannelUnwrapper(IMessagingSystemFactory outputMessagingSystem)
          Creates the duplex channel unwrapper.
 IDuplexChannelWrapper createDuplexChannelWrapper()
          Creates the duplex channel wrapper.
 ISerializer getSerializer()
          Gets serializer which is used to serialize/deserialize DataWrapper.
 GetSerializerCallback getSerializerProvider()
          Gets callback for retrieving serializer based on response receiver id.
 ChannelWrapperFactory setSerializer(ISerializer serializer)
          Sets serializer which shall be used to serialize/deserialize DataWrapper.
 ChannelWrapperFactory setSerializerProvider(GetSerializerCallback serializerProvider)
          Sets callback for retrieving serializer based on response receiver id.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelWrapperFactory

public ChannelWrapperFactory()
Constructs the factory.


ChannelWrapperFactory

public ChannelWrapperFactory(ISerializer serializer)
Constructs the factory.

Parameters:
serializer - serializer used for wrapping channels with data messages.
Method Detail

createDuplexChannelWrapper

public IDuplexChannelWrapper createDuplexChannelWrapper()
Description copied from interface: IChannelWrapperFactory
Creates the duplex channel wrapper.

Specified by:
createDuplexChannelWrapper in interface IChannelWrapperFactory
Returns:

createDuplexChannelUnwrapper

public IDuplexChannelUnwrapper createDuplexChannelUnwrapper(IMessagingSystemFactory outputMessagingSystem)
Description copied from interface: IChannelWrapperFactory
Creates the duplex channel unwrapper.

Specified by:
createDuplexChannelUnwrapper in interface IChannelWrapperFactory
Parameters:
outputMessagingSystem - Messaging used to create output channels where unwrapped messages will be sent.
Returns:

setSerializer

public ChannelWrapperFactory setSerializer(ISerializer serializer)
Sets serializer which shall be used to serialize/deserialize DataWrapper.

Parameters:
serializer - serializer
Returns:
this ChannelWrapperFactory

getSerializer

public ISerializer getSerializer()
Gets serializer which is used to serialize/deserialize DataWrapper.

Returns:
serializer

getSerializerProvider

public GetSerializerCallback getSerializerProvider()
Gets callback for retrieving serializer based on response receiver id. This callback is used by DuplexChannelUnwrapper when it needs to serialize/deserialize the communication with DuplexChannelWrapper. Providing this callback allows to use a different serializer for each connected client. This can be used e.g. if the communication with each client needs to be encrypted using a different password.

The default value is null and it means SerializerProvider callback is not used and one serializer which specified in the Serializer property is used for all serialization/deserialization.
If SerializerProvider is not null then the setting in the Serializer property is ignored.

Returns:
GetSerializerCallback

setSerializerProvider

public ChannelWrapperFactory setSerializerProvider(GetSerializerCallback serializerProvider)
Sets callback for retrieving serializer based on response receiver id. This callback is used by DuplexChannelUnwrapper when it needs to serialize/deserialize the communication with DuplexChannelWrapper. Providing this callback allows to use a different serializer for each connected client. This can be used e.g. if the communication with each client needs to be encrypted using a different password.

The default value is null and it means SerializerProvider callback is not used and one serializer which specified in the Serializer property is used for all serialization/deserialization.
If SerializerProvider is not null then the setting in the Serializer property is ignored.

Parameters:
serializerProvider -
Returns: