|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
FutureReply
,
ReplySet
Field Summary | |
static int |
ACTIVATE_AGLET
Used as a logical OR in the priority. |
static int |
MAX_PRIORITY
The maximum priority that the message can have. |
static int |
MIN_PRIORITY
The minimal priority that the message can have. |
static int |
NORM_PRIORITY
The default priority that is assigned to a message. |
static int |
NOT_QUEUED
Used as a argugment to the setPriority. |
Method Summary | |
void |
destroy()
Destorys the manager. |
void |
exitMonitor()
Exits the current monitor. |
void |
notifyAllMessages()
Notifies all of waiting threads. |
void |
notifyMessage()
Notifies a single waiting thread. |
void |
setPriority(java.lang.String kind,
int priority)
Sets the message's priority. |
void |
waitMessage()
Waits until it is notified. |
void |
waitMessage(long timeout)
Waits until it is notified or the timeout expires. |
Field Detail |
public static final int NOT_QUEUED
setPriority(java.lang.String, int)
public static final int ACTIVATE_AGLET
getMessageManager().setPriority("wakeMeUp", NORM_PRIORITY | ACTIVATE_AGLET);
setPriority(java.lang.String, int)
public static final int MIN_PRIORITY
setPriority(java.lang.String, int)
public static final int NORM_PRIORITY
setPriority(java.lang.String, int)
public static final int MAX_PRIORITY
setPriority(java.lang.String, int)
Method Detail |
public void destroy()
public void exitMonitor()
Aglet.exitMonitor()
,
waitMessage
,
notifyMessage
,
notifyAllMessages
public void notifyAllMessages()
IllegalMonitorStateException
- If the current thread
is not the owner of the monitor.Aglet.notifyAllMessages()
,
waitMessage
,
notifyMessage
public void notifyMessage()
IllegalMonitorStateException
- If the current thread
is not the owner of the monitor.Aglet.notifyMessage()
,
waitMessage
,
notifyAllMessages
public void setPriority(java.lang.String kind, int priority)
kind
- the kind to set a prioritypriority
- the prioritypublic void waitMessage()
IllegalMonitorStateException
- If the current thread
is not the owner of the monitor.notifyMessage
,
notifyAllMessages
public void waitMessage(long timeout)
timeout
- the maximum time to wait in milliseconds.IllegalMonitorStateException
- If the current thread
is not the owner of the monitor.Aglet.waitMessage()
,
notifyMessage
,
notifyAllMessages
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |