de.upb.swtpra05.group03.shuttle
Class DeadManSwitchControl

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.DeadManSwitchControl
All Implemented Interfaces:
Module, ShuttleModule

public class DeadManSwitchControl
extends java.lang.Object
implements ShuttleModule

Reacts on the PleaseActivateDeadManSwitch message from the kernel by sending the ActivateDeadManSwitch message back.

Version:
$Revision: 1.3 $

Field Summary
private  ShuttleControlInterface agent
          The shuttle control
private static java.util.logging.Logger log
          Logger for debugging
 
Constructor Summary
DeadManSwitchControl()
          Constructor
 
Method Summary
private  void activateDeadManSwitch(de.upb.swtpra.kernel.message.PleaseActivateDeadManSwitch msg)
          This method will answer the call to an ActivateDeadManSwitch from the kernel with the corresponding message.
 void init(ModuleContainerInterface container)
          Initializes this module.
 void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
          React on the received message of the shuttle or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final java.util.logging.Logger log
Logger for debugging


agent

private ShuttleControlInterface agent
The shuttle control

Constructor Detail

DeadManSwitchControl

public DeadManSwitchControl()
Constructor

Method Detail

init

public void init(ModuleContainerInterface container)
Description copied from interface: Module
Initializes this module. References to other modules should be set here to avoid circle dependencies.

Specified by:
init in interface Module
Parameters:
container - The module manager which contain all modules

newMessageReceived

public void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
Description copied from interface: ShuttleModule
React on the received message of the shuttle or not.

Specified by:
newMessageReceived in interface ShuttleModule
Parameters:
msg - The received message of the shuttle

activateDeadManSwitch

private void activateDeadManSwitch(de.upb.swtpra.kernel.message.PleaseActivateDeadManSwitch msg)
This method will answer the call to an ActivateDeadManSwitch from the kernel with the corresponding message. The kernel will send the PleaseActivateDeadManSwitch whenever the shuttle was inactive for a longer time period. This is done to avoid dead shuttles in a running simulation. If the shuttle don't answer it is regarded as dead and gets disqualified after a time period long enough to send the answer.

Parameters:
msg - The received PleaseActivateDeadManSwitch