eneter.messaging.messagingsystems.threadpoolmessagingsystem
Class ThreadPoolMessagingSystemFactory

java.lang.Object
  extended by eneter.messaging.messagingsystems.threadpoolmessagingsystem.ThreadPoolMessagingSystemFactory
All Implemented Interfaces:
IMessagingSystemFactory

public class ThreadPoolMessagingSystemFactory
extends java.lang.Object
implements IMessagingSystemFactory

Messaging system delivering messages asynchronously (when a message is received a separate thread is invoked to process it). Each incoming message is routed into its own thread from the pool. It means when a message is received the thread from the pool is taken and the message is notified.


Constructor Summary
ThreadPoolMessagingSystemFactory()
          Constructs the factory.
ThreadPoolMessagingSystemFactory(IProtocolFormatter protocolFormatter)
          Constructs the factory.
 
Method Summary
 IDuplexInputChannel createDuplexInputChannel(java.lang.String channelId)
          Creates the input channel which can receive and send messages to the output channel.
 IDuplexOutputChannel createDuplexOutputChannel(java.lang.String channelId)
          Creates the output channel which can sends and receive messages from the input channel.
 IDuplexOutputChannel createDuplexOutputChannel(java.lang.String channelId, java.lang.String responseReceiverId)
          Creates the output channel which can sends and receive messages from the input channel.
 IThreadDispatcherProvider getInputChannelThreading()
          Gets threading mode used for input channels.
 IThreadDispatcherProvider getOutputChannelThreading()
          Gets threading mode used for output channels.
 ThreadPoolMessagingSystemFactory setInputChannelThreading(IThreadDispatcherProvider inputChannelThreading)
          Sets threading mode for input channels.
 ThreadPoolMessagingSystemFactory setOutputChannelThreading(IThreadDispatcherProvider outputChannelThreading)
          Sets threading mode for output channels.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPoolMessagingSystemFactory

public ThreadPoolMessagingSystemFactory()
Constructs the factory.


ThreadPoolMessagingSystemFactory

public ThreadPoolMessagingSystemFactory(IProtocolFormatter protocolFormatter)
Constructs the factory.

Parameters:
protocolFormatter - formatting of low-level messages between output and input channels.
Method Detail

createDuplexOutputChannel

public IDuplexOutputChannel createDuplexOutputChannel(java.lang.String channelId)
                                               throws java.lang.Exception
Description copied from interface: IMessagingSystemFactory
Creates the output channel which can sends and receive messages from the input channel.

Specified by:
createDuplexOutputChannel in interface IMessagingSystemFactory
Parameters:
channelId - address of the input channel.
Returns:
output channel
Throws:
java.lang.Exception

createDuplexOutputChannel

public IDuplexOutputChannel createDuplexOutputChannel(java.lang.String channelId,
                                                      java.lang.String responseReceiverId)
                                               throws java.lang.Exception
Description copied from interface: IMessagingSystemFactory
Creates the output channel which can sends and receive messages from the input channel.

Specified by:
createDuplexOutputChannel in interface IMessagingSystemFactory
Parameters:
channelId - address of the input channel.
responseReceiverId - unique identifier of the output channel. If the value is null then the identifier is genearated automatically
Returns:
duplex output channel
Throws:
java.lang.Exception

createDuplexInputChannel

public IDuplexInputChannel createDuplexInputChannel(java.lang.String channelId)
                                             throws java.lang.Exception
Description copied from interface: IMessagingSystemFactory
Creates the input channel which can receive and send messages to the output channel.

Specified by:
createDuplexInputChannel in interface IMessagingSystemFactory
Parameters:
channelId - address of the input channel.
Returns:
input channel
Throws:
java.lang.Exception

setInputChannelThreading

public ThreadPoolMessagingSystemFactory setInputChannelThreading(IThreadDispatcherProvider inputChannelThreading)
Sets threading mode for input channels.

Parameters:
inputChannelThreading - threading model
Returns:
this ThreadPoolMessagingSystemFactory

getInputChannelThreading

public IThreadDispatcherProvider getInputChannelThreading()
Gets threading mode used for input channels.

Returns:
thread dispatcher

setOutputChannelThreading

public ThreadPoolMessagingSystemFactory setOutputChannelThreading(IThreadDispatcherProvider outputChannelThreading)
Sets threading mode for output channels.

Parameters:
outputChannelThreading -
Returns:
ThreadPoolMessagingSystemFactory

getOutputChannelThreading

public IThreadDispatcherProvider getOutputChannelThreading()
Gets threading mode used for output channels.

Returns:
thread dispatcher