|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAMETAS.util.context.AMETASStandardContext
Provides a standard implementation for contexts. This class should be used whenever you need not pay attention for application class hierarchies.
| Field Summary | |
protected java.lang.Object[] |
m_aParam
Initialization parameters. |
| Fields inherited from interface AMETAS.util.context.AMETASContext |
CURRENT_CONTEXT, FINAL, INITIAL, NEW_CONTEXT, NO_CONTEXT, SEMISTABLE, STABLE, UNSTABLE |
| Constructor Summary | |
AMETASStandardContext()
Constructor. |
|
| Method Summary | |
int |
getContextID()
Returns the ID of this context. |
int |
getContextIDOf(AMETASPlaceUserID puidPartner)
Returns the ID of the context for the recipient. |
short |
getMode()
Delivers the mode of the state of this context (stable, unstable, semistable). |
protected java.lang.Object[] |
getParameters()
Gets the parameters of the context. |
AMETASPlaceUser |
getPlaceUser()
Returns the reference to the Place User. |
AMETASPlaceUserID |
getPrimaryPeer()
Returns the primary peer. |
AMETASMessage |
getRecentMessage()
Returns the recent message processed by this context. |
AMETASServiceObject |
getServiceObject()
Returns the reference to the service object. |
int |
getStateID()
Returns the current state by its ID. |
boolean |
inFinalState()
Determines whether this context is in a final state. |
void |
nextState(int nState)
Puts the context in the given state. |
void |
nextState(int nState,
short nMode)
Puts the context in the given state. |
abstract void |
processMessage(AMETASMessage msg)
Processes this message. |
void |
saveSenderContext(AMETASMessage msg)
Stored the context of the sender. |
void |
setContextID(int nID)
Definess the context ID. |
void |
setDefaultContexts(AMETASMessage msg)
Sets the default contexts. |
void |
setParameters(java.lang.Object[] aParam)
Set the parameters of the context. |
void |
setPlaceUser(AMETASPlaceUser pu)
Defines the reference to the Place User. |
void |
setPrimaryPeer(AMETASPlaceUserID puid)
Sets the primary peer. |
void |
setServiceObject(AMETASServiceObject so)
Defines the reference to the service object. |
void |
submitMessage(AMETASMessage msg)
Submits a message. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.Object[] m_aParam
| Constructor Detail |
public AMETASStandardContext()
| Method Detail |
public void setContextID(int nID)
setContextID in interface AMETASContextnID - Context ID.public int getContextID()
getContextID in interface AMETASContextpublic final void setPlaceUser(AMETASPlaceUser pu)
setPlaceUser in interface AMETASContextpu - Reference to the Place User.public final void setServiceObject(AMETASServiceObject so)
setServiceObject in interface AMETASContextpublic final AMETASPlaceUser getPlaceUser()
getPlaceUser in interface AMETASContextpublic final AMETASServiceObject getServiceObject()
getServiceObject in interface AMETASContextpublic final AMETASMessage getRecentMessage()
public void saveSenderContext(AMETASMessage msg)
msg - New message to be processed. If null, the method returns without
any action.public final boolean inFinalState()
public short getMode()
getMode in interface AMETASContextpublic final int getStateID()
getStateID in interface AMETASContextpublic final void nextState(int nState)
nState - State ID.
public final void nextState(int nState,
short nMode)
nextState in interface AMETASContextnState - State ID. If final, the mode is assumed to be STABLE.nMode - STABLE, UNSTABLE, SEMISTABLE. Other values are ignored, and STABLE is assumed.public void setParameters(java.lang.Object[] aParam)
setParameters in interface AMETASContextaParam - Parameters.protected java.lang.Object[] getParameters()
public int getContextIDOf(AMETASPlaceUserID puidPartner)
puidPartner - PlaceUserID of the communication peer.
public void setPrimaryPeer(AMETASPlaceUserID puid)
puid - PlaceUserID of the primary peer.public AMETASPlaceUserID getPrimaryPeer()
public void setDefaultContexts(AMETASMessage msg)
msg - Message to be specified for sender and receiver contexts.public void submitMessage(AMETASMessage msg)
msg - Message to be submitted.
public abstract void processMessage(AMETASMessage msg)
throws MessagePushbackException,
MessageRejectedException,
ContextTerminatedException
processMessage in interface AMETASContextmsg - Current message for this context.
MessagePushbackException - if the message shall not be processed but neither rejected.
MessageRejectedException - if the message cannot be processed in this state.
ContextTerminatedException - if this context must be aborted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||