Interface aglet.MessageManager
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface aglet.MessageManager

public interface MessageManager
extends Object
The MessageManager controls concurrency of incomming message. Each kind of message can have a priority and will be queued in the message queue in accordance with its priority.
See Also:
FutureReply, ReplySet

Variable Index

 o ACTIVATE_AGLET
Used as a logical OR in the priority.
 o MAX_PRIORITY
The maximum priority that the message can have.
 o MIN_PRIORITY
The minimal priority that the message can have.
 o NORM_PRIORITY
The default priority that is assigned to a message.
 o NOT_QUEUED
Used as a argugment to the setPriority.

Method Index

 o destroy()
Destorys the manager.
 o exitMonitor()
Exits the current monitor.
 o notifyAllMessages()
Notifies all of waiting threads.
 o notifyMessage()
Notifies a single waiting thread.
 o setPriority(String, int)
Sets the message's priority.
 o waitMessage()
Waits until it is notified.
 o waitMessage(long)
Waits until it is notified or the timeout expires

Variables

 o NOT_QUEUED
  public final static int NOT_QUEUED
Used as a argugment to the setPriority. It indicates that messages which have the same kind will not be queued in the message queue and processed immediately.
See Also:
setPriority
 o ACTIVATE_AGLET
  public final static int ACTIVATE_AGLET
Used as a logical OR in the priority. It indicates that receiving this kind of messages will automatically activate the aglet if it had been deactivated.
   getMessageManager().setPriority("wakeMeUp",
                                   NORM_PRIORITY | ACTIVATE_AGLET);
  
See Also:
setPriority
 o MIN_PRIORITY
  public final static int MIN_PRIORITY
The minimal priority that the message can have.
See Also:
setPriority
 o NORM_PRIORITY
  public final static int NORM_PRIORITY
The default priority that is assigned to a message.
See Also:
setPriority
 o MAX_PRIORITY
  public final static int MAX_PRIORITY
The maximum priority that the message can have.
See Also:
setPriority

Methods

 o waitMessage
  public abstract void waitMessage()
Waits until it is notified.
Throws: IllegalMonitorStateException
If the current thread is not the owner of the monitor.
See Also:
notifyMessage, notifyAllMessage
 o waitMessage
  public abstract void waitMessage(long timeout)
Waits until it is notified or the timeout expires
Throws: IllegalMonitorStateException
If the current thread is not the owner of the monitor.
See Also:
waitMessage, notifyMessage, notifyAllMessage
 o notifyMessage
  public abstract void notifyMessage()
Notifies a single waiting thread.
Throws: IllegalMonitorStateException
If the current thread is not the owner of the monitor.
See Also:
notifyMessage, waitMessage, notifyAllMessage
 o notifyAllMessages
  public abstract void notifyAllMessages()
Notifies all of waiting threads.
Throws: IllegalMonitorStateException
If the current thread is not the owner of the monitor.
See Also:
notifyAllMessage, waitMessage, notifyMessage
 o exitMonitor
  public abstract void exitMonitor()
Exits the current monitor.
See Also:
exitMonitor, waitMessage, notifyMessage, notifyAllMessages
 o setPriority
  public abstract void setPriority(String kind,
                                   int priority)
Sets the message's priority.
Parameters:
kind - the kind to set a priority
priority - the priority
 o destroy
  public abstract void destroy()
Destorys the manager. After this calling, the message manager is no longer valid and all queued and incoming message will be denied.

All Packages  Class Hierarchy  This Package  Previous  Next  Index