public class CommitCommandNew extends BaseCommand<Long>
Command for MongoMicroKernel#commit(String, String, String, String)nodeStore| Constructor and Description |
|---|
CommitCommandNew(MongoNodeStore nodeStore,
Commit commit)
Constructs a new
CommitCommandMongo. |
| Modifier and Type | Method and Description |
|---|---|
Long |
execute()
Executes the
Command and returns its result. |
int |
getNumOfRetries()
Returns the number of retries this
Command should be retried in
case of an error or false result. |
boolean |
needsRetry(Exception e)
Will be called in case of an
Exception during the execution and
a given number of retries which has not exceeded. |
protected boolean |
saveAndSetHeadRevision()
Protected for testing purposed only.
|
needsRetrypublic CommitCommandNew(MongoNodeStore nodeStore, Commit commit)
CommitCommandMongo.nodeStore - Node store.commit - Commitpublic Long execute() throws Exception
CommandCommand and returns its result.Exception - If an error occurred while executing.public int getNumOfRetries()
CommandCommand should be retried in
case of an error or false result.
The number of reties is evaluated in the following way:
In order to determine whether the Command should be retired on
Command.needsRetry(Exception) or Command.needsRetry(Object) will be called.
getNumOfRetries in interface Command<Long>getNumOfRetries in class BaseCommand<Long>Command.needsRetry(Exception),
Command.needsRetry(Object)public boolean needsRetry(Exception e)
CommandException during the execution and
a given number of retries which has not exceeded.needsRetry in interface Command<Long>needsRetry in class BaseCommand<Long>e - The Exception which was thrown.true if a retry should be performed, else false.Copyright © 2012-2013 The Apache Software Foundation. All Rights Reserved.