|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAMETAS.util.context.AMETASContextManager
Context manager. This class cares for looking up the required context for any incoming message. Note that it does not automatically retrieve messages.
| Constructor Summary | |
AMETASContextManager(java.lang.Class clsContext,
AMETASContextControl cct,
AMETASPlaceUser pu)
Constructor. |
|
AMETASContextManager(java.lang.Class clsContext,
AMETASPlaceUser pu)
Constructor. |
|
| Method Summary | |
boolean |
allDone()
Determines whether there is any active context. |
boolean |
checkNonstableContext(AMETASContext ctx)
Processes one nonstable context. |
void |
checkNonstableContexts()
Processes nonstable contexts. |
int[] |
getAllContextIDs()
Returns the set of all context IDs. |
AMETASContext[] |
getAllContexts()
Returns the set of all contexts. |
AMETASContext |
getContext(AMETASMessage msg,
boolean bCreate)
Returns the context for this message. |
AMETASContext |
getContext(AMETASMessage msg,
boolean bCreate,
java.lang.Object[] aParam)
Invokes the context which this message belongs to. |
AMETASContext |
getContext(int nID)
Returns a context. |
AMETASContext[] |
getNonstableContexts()
Returns the set of currently unstable and semistable (=nonstable) contexts. |
boolean |
newContextRequested()
Determines whether a new context shall be created. |
void |
prepareMigration(AMETASContext ctx)
Prepares for migration. |
void |
processInContext(AMETASMessage msg)
Invokes the context which this message belongs to. |
void |
processInContext(AMETASMessage msg,
java.lang.Object[] aParam)
Invokes the contexts which the new messages belong to. |
void |
setServiceObject(AMETASServiceObject so)
Sets the reference to the service object. |
void |
startNewContext()
Creates a new context. |
void |
startNewContext(java.lang.Object[] aParam)
Creates a new context. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AMETASContextManager(java.lang.Class clsContext,
AMETASPlaceUser pu)
throws java.lang.NullPointerException
clsContext - Class to be used for instantiating new contexts.pu - Reference to the Place User.
java.lang.NullPointerException - if the given class is null.
public AMETASContextManager(java.lang.Class clsContext,
AMETASContextControl cct,
AMETASPlaceUser pu)
throws java.lang.NullPointerException
clsContext - Class to be used for instantiating new contexts.cct - Control object which decides whether a new context is required.pu - Reference to the Place User.
java.lang.NullPointerException - if the context class is null.| Method Detail |
public void setServiceObject(AMETASServiceObject so)
so - Service object.
public void startNewContext()
throws java.lang.InstantiationException
java.lang.InstantiationException - if the context instance could not be instantiated.
public void startNewContext(java.lang.Object[] aParam)
throws java.lang.InstantiationException
aParam - Initialization parameters. Can be references to other objects which
the context should consult to retrieve the data.
java.lang.InstantiationException - if the context instance could not be instantiated.
public AMETASContext getContext(AMETASMessage msg,
boolean bCreate)
throws UnknownContextException,
FinalizedContextException,
java.lang.InstantiationException
msg - Message the context of which shall be determined.bCreate - if true, a new context will be created if there is no such context
for this message.
java.lang.InstantiationException - if the context could not be instantiated.
UnknownContextException - if the context of a message is unknown.
FinalizedContextException - if the context is already finalized.
public AMETASContext getContext(AMETASMessage msg,
boolean bCreate,
java.lang.Object[] aParam)
throws UnknownContextException,
FinalizedContextException,
java.lang.InstantiationException
msg - Message the context of which shall be determined.bCreate - if true, a new context will be created if there is no such context
for this message.aParam - Initialization parameters.
java.lang.InstantiationException - if the context could not be instantiated.
UnknownContextException - if the context of a message is unknown.
FinalizedContextException - if the context is already finalized.
public void processInContext(AMETASMessage msg)
throws UnknownContextException,
FinalizedContextException,
java.lang.InstantiationException,
MessagePushbackException,
MessageRejectedException
msg - Message to be processed.
java.lang.InstantiationException - if the context could not be instantiated.
UnknownContextException - if the context of a message is unknown.
FinalizedContextException - if the context is already finalized.
MessagePushbackException - if the message was pushed back by the context.
MessageRejectedException - if the message was rejected by the context.
public void processInContext(AMETASMessage msg,
java.lang.Object[] aParam)
throws UnknownContextException,
FinalizedContextException,
java.lang.InstantiationException,
MessagePushbackException,
MessageRejectedException
java.lang.InstantiationException - if the context could not be instantiated.
UnknownContextException - if the context of a message is unknown.
FinalizedContextException - if the context is already finalized.
MessagePushbackException - if the message was pushed back by the context.
MessageRejectedException - if the message was rejected by the context.public void prepareMigration(AMETASContext ctx)
public AMETASContext[] getAllContexts()
public int[] getAllContextIDs()
public AMETASContext getContext(int nID)
throws UnknownContextException,
FinalizedContextException
nID - Context ID
UnknownContextException - if the context is unknown.
FinalizedContextException - if the context was already finalized.public AMETASContext[] getNonstableContexts()
public boolean checkNonstableContext(AMETASContext ctx)
ctx - Context instance.public void checkNonstableContexts()
public boolean allDone()
public boolean newContextRequested()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||