|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hypergraphdb.peer.workflow.AbstractActivity<StateType>
org.hypergraphdb.peer.workflow.TaskActivity<org.hypergraphdb.peer.replication.CatchUpTaskServer.State>
org.hypergraphdb.peer.replication.CatchUpTaskServer
public class CatchUpTaskServer
| Nested Class Summary | |
|---|---|
static class |
CatchUpTaskServer.CatchUpTaskServerFactory
|
| Constructor Summary | |
|---|---|
CatchUpTaskServer(HyperGraphPeer thisPeer,
java.util.UUID taskId)
|
|
| Method Summary | |
|---|---|
void |
handleMessage(Message msg)
Called by the peer interface when a message arrives for this task. |
| Methods inherited from class org.hypergraphdb.peer.workflow.TaskActivity |
|---|
getPeerInterface, getTaskId, getThisPeer, setTaskId, stateChanged |
| Methods inherited from class org.hypergraphdb.peer.workflow.AbstractActivity |
|---|
getEndState, getStartState, run, setStateListener |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CatchUpTaskServer(HyperGraphPeer thisPeer,
java.util.UUID taskId)
| Method Detail |
|---|
public void handleMessage(Message msg)
TaskActivity
Called by the peer interface when a message arrives for this task. Can be
overridden by derived TaskActivity implementations. The
default implementation delegates to the conversation identified by the
CONVERSATION_ID attribute of the message (if any). If there's
no conversation associated with this message, an attempt to create a new one
is made by calling createNewConversation which can be overridden
also. If createNewConversation returns a non-null
Conversation instance, the conversation is assigned an ID and
registered with this task.
So a task implementation can chose to implement handleMessage and
respond to messages directly on it own or it can just implement createNewConversation
to delegate the work to conversation implementations. Or it can have a combination
of both like the following pattern:
public void handleMessage(Object msg)
{
if msg should trigger a new conversation between this peer and
the sending peer then
super.handleMessage(msg);
else
respond to msg directly here...
}
public void createNewConversation(Object msg)
{
// handleMessage determined that a new conversation must be started
// so based on the content of the message, create and return
// an appropriate conversation here.
}
handleMessage in class TaskActivity<org.hypergraphdb.peer.replication.CatchUpTaskServer.State>msg - The message just received.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||