All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.ibm.aglet.MessageManager

public interface MessageManager
The MessageManager controls concurrency of incomming message. Each kind of message can have a priority and will be placed 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 static final 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 static final 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 static final int MIN_PRIORITY
The minimal priority that the message can have.

See Also:
setPriority
 o NORM_PRIORITY
 public static final int NORM_PRIORITY
The default priority that is assigned to a message.

See Also:
setPriority
 o MAX_PRIORITY
 public static final 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, notifyAllMessages
 o waitMessage
 public abstract void waitMessage(long timeout)
Waits until it is notified or the timeout expires.

Parameters:
timeout - the maximum time to wait in milliseconds.
Throws: IllegalMonitorStateException
If the current thread is not the owner of the monitor.
See Also:
waitMessage, notifyMessage, notifyAllMessages
 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, notifyAllMessages
 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:
notifyAllMessages, 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