ch.nix.ert.base
Class Dispatcher

java.lang.Object
  extended bych.nix.ert.base.Dispatcher
All Implemented Interfaces:
java.lang.Runnable

public class Dispatcher
extends java.lang.Object
implements java.lang.Runnable

TODO Edit this text for a better description This is a local dispatcher, he is responsible for all local requests. He does not decide if the request is executed locally or remotely, he will ALWAYS execute it remotly. It's the responsibility of each single service to relay it to another node...
If you don't know, if the request is for local or remote execution, you can place it in Dispatcher, but he will forward it to KeyPartitionManager who will then decide if executed locally or remotely (according their KeyGroupID)

Author:
michi

Method Summary
 void addWork(DataItem data)
          Only data which contain the "command" key are accepted, all other will be silently ignored! TODO: perhpas we could also throw an exception?
static Dispatcher getInstance()
           
 void registerQueue(Queue queue)
           
 void registerService(java.lang.String operation, Queue queue)
          There is only ONE service allowed for each type...
 void run()
          Start the dispatcher and ONLY ONE thread meight be inside it!
 void unregisterService(java.lang.String operation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Dispatcher getInstance()

addWork

public void addWork(DataItem data)
Only data which contain the "command" key are accepted, all other will be silently ignored! TODO: perhpas we could also throw an exception?

Parameters:
data -

registerService

public void registerService(java.lang.String operation,
                            Queue queue)
There is only ONE service allowed for each type... if an service is already registered and a new one with the same keyword, subtype is added, an exception is thrown TODO: implment this EXCEPTION

Parameters:
queue - The queue where incomming request are stored for this command.

registerQueue

public void registerQueue(Queue queue)

unregisterService

public void unregisterService(java.lang.String operation)

run

public void run()
Start the dispatcher and ONLY ONE thread meight be inside it!

Specified by:
run in interface java.lang.Runnable


Copyright © 2004 Michael Kussmaul - Revision: 183 - Date: 2004-11-16T15:42:13.763853Z