aa.core
Class DelayedMessageManager

java.lang.Object
  extended byjava.lang.Thread
      extended byaa.core.DelayedMessageManager
All Implemented Interfaces:
java.lang.Runnable

public class DelayedMessageManager
extends java.lang.Thread

This class manages communication messages for mobile actors that are in transit.
When an actor is moving from one host to another, the messages to the actor should be delayed. This deleay is managed by a Delayed Message Manager.

History:

Version:
$Date: 2008/01/01 00:23:47 $ $Revision: 1.1 $
Author:
Myeong-Wuk Jang

Field Summary
private  ActorManager m_amActorManager
          The reference to an Actor Manager
private  boolean m_bContinue
          The flag to indicate whether the main loop should continue.
private  MessageManager m_mmMessageManager
          The reference to a Message Manager.
private  Queue m_qMsgQueue
          The in-coming message queue of this module.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DelayedMessageManager(ActorManager p_amActorManager, MessageManager p_mmMessageManager, MigrationManager p_mmMigrationManager)
          Creates a Delayed Message Manager.
 
Method Summary
protected  void deliverMessage(ActorMessage p_amMsg)
          Delivers a message between two actors.
protected  void init()
          Processes some necessay routines before entering the while loop in the run method.
private  boolean processMessage(ActorMessage p_amMsg)
          Processes a communication message.
protected  void resend()
          Wakes up the curren sleeping thread.
 void run()
          Invoked when this thread is executed.
protected  void uninit()
          Uninitializes this program.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_bContinue

private boolean m_bContinue
The flag to indicate whether the main loop should continue.


m_qMsgQueue

private Queue m_qMsgQueue
The in-coming message queue of this module.


m_amActorManager

private ActorManager m_amActorManager
The reference to an Actor Manager


m_mmMessageManager

private MessageManager m_mmMessageManager
The reference to a Message Manager.

Constructor Detail

DelayedMessageManager

public DelayedMessageManager(ActorManager p_amActorManager,
                             MessageManager p_mmMessageManager,
                             MigrationManager p_mmMigrationManager)
Creates a Delayed Message Manager.

Parameters:
p_amActorManager - the reference to an Actor Manager.
p_mmMessageManager - the reference to a Message Manager.
p_mmMigrationManager - the reference to a Migration Manager.
Method Detail

init

protected void init()
Processes some necessay routines before entering the while loop in the run method.


uninit

protected void uninit()
Uninitializes this program.
This method is called by the Plaform.


run

public void run()
Invoked when this thread is executed.


processMessage

private boolean processMessage(ActorMessage p_amMsg)
Processes a communication message.

Parameters:
p_amMsg - an actor communication message.

deliverMessage

protected void deliverMessage(ActorMessage p_amMsg)
Delivers a message between two actors.
This method is controled by another thread.

Parameters:
p_amMsg - an actor communication message.

resend

protected void resend()
Wakes up the curren sleeping thread.
This method is called by the 'Migration Manager' actor.