de.upb.swtpra05.group03.shuttle
Class PeriodicalWakeUpControl

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

public class PeriodicalWakeUpControl
extends java.lang.Object
implements ShuttleModule, PeriodicalWakeUpControlInterface

Version:
$Revision: 1.3 $

Field Summary
private  ShuttleControlInterface agent
          The shuttle control
protected static java.lang.Integer INITIAL_WAKE_UP_TIME
          Identifies initial wake up times
private static java.util.logging.Logger log
          Logger for debugging
private  java.util.Map wakeUpTimes
          The wake up times of added frequencies
 
Constructor Summary
PeriodicalWakeUpControl()
          Constructor
 
Method Summary
 void addFrequency(java.lang.Integer frequency)
          Adds the given wake up frequency.
 void init(ModuleContainerInterface container)
          Initializes this module.
 boolean isPeriodicalWakeUp(java.lang.Integer wakeUpTime, java.lang.Integer frequency)
          Returns if given wake up time is a periodical wake up time of given frequency.
 void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
          React on the received message of the shuttle or not.
protected  void wakeUpCall(de.upb.swtpra.kernel.message.WakeUpCallMessage msg)
          Handles wake up calls.
 
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


INITIAL_WAKE_UP_TIME

protected static final java.lang.Integer INITIAL_WAKE_UP_TIME
Identifies initial wake up times


agent

private ShuttleControlInterface agent
The shuttle control


wakeUpTimes

private java.util.Map wakeUpTimes
The wake up times of added frequencies

Constructor Detail

PeriodicalWakeUpControl

public PeriodicalWakeUpControl()
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

wakeUpCall

protected void wakeUpCall(de.upb.swtpra.kernel.message.WakeUpCallMessage msg)
Handles wake up calls.

Parameters:
msg - The WakeUpCallMessage

addFrequency

public void addFrequency(java.lang.Integer frequency)
Description copied from interface: PeriodicalWakeUpControlInterface
Adds the given wake up frequency.

Specified by:
addFrequency in interface PeriodicalWakeUpControlInterface
Parameters:
frequency -

isPeriodicalWakeUp

public boolean isPeriodicalWakeUp(java.lang.Integer wakeUpTime,
                                  java.lang.Integer frequency)
Description copied from interface: PeriodicalWakeUpControlInterface
Returns if given wake up time is a periodical wake up time of given frequency.

Specified by:
isPeriodicalWakeUp in interface PeriodicalWakeUpControlInterface
Parameters:
wakeUpTime - wake up time to test
frequency - frequency to test
Returns:
if given wake up time is a periodical wake up time of given frequency