public class RememberTaskClient extends TaskActivity<RememberTaskClient.State>
Modifier and Type | Class and Description |
---|---|
static class |
RememberTaskClient.RememberEntity |
protected static class |
RememberTaskClient.State |
endState, startState, stateChangedLatch
Constructor and Description |
---|
RememberTaskClient(HyperGraphPeer thisPeer,
LogEntry entry,
java.lang.Object targetPeer,
Log log) |
RememberTaskClient(HyperGraphPeer thisPeer,
Log log,
java.lang.Object targetPeer,
java.util.List<java.lang.Object> batch) |
RememberTaskClient(HyperGraphPeer thisPeer,
java.lang.Object value,
Log log,
HGPersistentHandle handle,
java.lang.Object targetPeer,
StorageService.Operation operation) |
RememberTaskClient(HyperGraphPeer thisPeer,
java.lang.Object value,
Log log,
HyperGraph hg,
HGPersistentHandle handle,
StorageService.Operation operation) |
Modifier and Type | Method and Description |
---|---|
protected Conversation<?> |
createNewConversation(Json msg)
Create a new conversation based on the message content.
|
HGHandle |
getResult() |
java.util.List<HGHandle> |
getResults() |
RememberTaskClient.State |
handleConfirm(AbstractActivity<?> fromActivity)
Called when one of the conversations enters the
Confirmed state while the task is in the
Accepted state. |
RememberTaskClient.State |
handleDisconfirm(AbstractActivity<?> fromActivity) |
RememberTaskClient.State |
handleProposal(AbstractActivity<?> fromActivity)
Called when one of the conversations enters the
Proposed state while the task is in the
Started state. |
protected void |
initiate()
This method is called the first time the task is scheduled to run.
|
doRun, getPeerInterface, getTaskId, getThisPeer, handleActivity, handleMessage, registerConversation, registerConversationHandler, sendReply, setTaskId, stateChanged
afterStateChanged, compareAndSetState, getEndState, getStartState, getState, isStopped, run, setState, setStateListener
public RememberTaskClient(HyperGraphPeer thisPeer, Log log, java.lang.Object targetPeer, java.util.List<java.lang.Object> batch)
public RememberTaskClient(HyperGraphPeer thisPeer, java.lang.Object value, Log log, HyperGraph hg, HGPersistentHandle handle, StorageService.Operation operation)
public RememberTaskClient(HyperGraphPeer thisPeer, java.lang.Object value, Log log, HGPersistentHandle handle, java.lang.Object targetPeer, StorageService.Operation operation)
public RememberTaskClient(HyperGraphPeer thisPeer, LogEntry entry, java.lang.Object targetPeer, Log log)
protected void initiate()
TaskActivity
This method is called the first time the task is scheduled to run. It is
an initialization method called after the task was constructed.
The default implementation of startTask
does nothing.
initiate
in class TaskActivity<RememberTaskClient.State>
protected Conversation<?> createNewConversation(Json msg)
TaskActivity
Create a new conversation based on the message content. This method should be overridden by all tasks that need to create conversations between two peers. The default implementation does not create any conversations.
createNewConversation
in class TaskActivity<RememberTaskClient.State>
msg
- The message just received from some peer in the context of this
task.Conversation
. The default implementation
returns null
.public RememberTaskClient.State handleProposal(AbstractActivity<?> fromActivity)
Proposed
state while the task is in the
Started
state.fromActivity
- public RememberTaskClient.State handleConfirm(AbstractActivity<?> fromActivity)
Confirmed
state while the task is in the
Accepted
state.fromActivity
- public RememberTaskClient.State handleDisconfirm(AbstractActivity<?> fromActivity)
public HGHandle getResult()
public java.util.List<HGHandle> getResults()