eneter.messaging.threading.dispatching
Class SyncDispatching

java.lang.Object
  extended by eneter.messaging.threading.dispatching.SyncDispatching
All Implemented Interfaces:
IThreadDispatcherProvider

public class SyncDispatching
extends java.lang.Object
implements IThreadDispatcherProvider

Invokes one by one from the queue.


Constructor Summary
SyncDispatching()
          Constructs dispatching where each getDispatcher() will return new instance of the dispatcher.
SyncDispatching(boolean isDispatcherShared)
          Constructs the dispatcher provider.
 
Method Summary
 IThreadDispatcher getDispatcher()
          Returns dispatcher that queues callback methods and processes them one by one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncDispatching

public SyncDispatching()
Constructs dispatching where each getDispatcher() will return new instance of the dispatcher.


SyncDispatching

public SyncDispatching(boolean isDispatcherShared)
Constructs the dispatcher provider.

Parameters:
isDispatcherShared - true - getDispatcher() will return always the same instance of the dispatcher. It means all dispatchers returned from getDispatcher() will sync incoming methods using the same queue.
false - getDispatcher() will return always the new instance of the dispatcher. It means each dispatcher returned from getDispatcher() will use its own synchronization queue.
Method Detail

getDispatcher

public IThreadDispatcher getDispatcher()
Returns dispatcher that queues callback methods and processes them one by one. If SyncDispatching was created with isDispatcherShared true then it always returns the same instance of the thread dispatcher. Otherwise it always creates the new one.

Specified by:
getDispatcher in interface IThreadDispatcherProvider