FourMS
Class FourMSControllerMessageDispatcher

java.lang.Object
  extended by FourMS.MessageDispatcher
      extended by FourMS.FourMSControllerMessageDispatcher
All Implemented Interfaces:
iDispatchMessageInterface

public class FourMSControllerMessageDispatcher
extends MessageDispatcher
implements iDispatchMessageInterface

This class will be responsible for dispatching any incoming messages from the 4MS and send them to the mechanisms to be processed. This class will be used by the MessageHandler class when a new message is received from the 4MS and needs the message to be sent to the mechanism.

Version:
$Id: FourMSControllerMessageDispatcher.java,v 1.5 2006/04/07 08:05:39 cb Exp $
Author:
Craige Bevil

Field Summary
private  FourMSController ER412Controller
          We will use this to dispatch the messages to the simulator object for processing
private  java.util.Hashtable<java.lang.String,Mechanism> ER412Mechanisms
          Stores references to mechanism objects so that when a message comes back destined for that mechanism, it can inform it.
 MessageHandler SyslogMessageHandler
          This is a syslog object which will be used to report errors etc
 
Constructor Summary
FourMSControllerMessageDispatcher(MessageHandler SyslogMessageHandler, FourMSController ER412Controller)
          This the constructor of the class
 
Method Summary
 boolean dispatchIncoming4MSMessage(FourMSMessage IncomingMessage)
          This method will be responsible for going through the mechanisms that it knows about and then passing on to the appropriate ER412 software mechanism, the details of the message so that it can be processed.
 void setMechanismListeners(java.util.Hashtable<java.lang.String,Mechanism> ER412Mechanisms)
          Used to set the ER412Mechanisms which will be informed when there is an incoming message which is bound for one of them
 
Methods inherited from class FourMS.MessageDispatcher
ExtractNext4MSInstruction, ExtractNext4MSInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ER412Mechanisms

private java.util.Hashtable<java.lang.String,Mechanism> ER412Mechanisms
Stores references to mechanism objects so that when a message comes back destined for that mechanism, it can inform it. Each of the mechanism should implement the i4MSMessageListenerInterface interface which we rely on in order to inform the mechanism that a message has been received which is destined for it.


ER412Controller

private FourMSController ER412Controller
We will use this to dispatch the messages to the simulator object for processing


SyslogMessageHandler

public MessageHandler SyslogMessageHandler
This is a syslog object which will be used to report errors etc

Constructor Detail

FourMSControllerMessageDispatcher

public FourMSControllerMessageDispatcher(MessageHandler SyslogMessageHandler,
                                         FourMSController ER412Controller)
This the constructor of the class

Parameters:
SyslogMessageHandler - Used in order to send errors and debug to the syslog
ER412Controller - This is an instance of the 4MS controller object
Method Detail

dispatchIncoming4MSMessage

public boolean dispatchIncoming4MSMessage(FourMSMessage IncomingMessage)
This method will be responsible for going through the mechanisms that it knows about and then passing on to the appropriate ER412 software mechanism, the details of the message so that it can be processed.

Specified by:
dispatchIncoming4MSMessage in interface iDispatchMessageInterface
Parameters:
IncomingMessage - This is the incoming message after it has been processed, validated and broken down into it's constituent parts
Returns:
boolean

setMechanismListeners

public void setMechanismListeners(java.util.Hashtable<java.lang.String,Mechanism> ER412Mechanisms)
Used to set the ER412Mechanisms which will be informed when there is an incoming message which is bound for one of them

Parameters:
ER412Mechanisms - This is a hash of mechanisms which must implement the i4MSMessageListenerInterface interface