|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.spi.InvocationBuilder
public abstract class InvocationBuilder
The InvocationBuilder is responsible for building an invocation of an operation and invoking it.
The original design exposed the actual Invocation class, but this will limit flexibility since the whole invocation can't be changed or fully removed easily.
Field Summary | |
---|---|
protected Callback<Object> |
callback
|
protected long |
callTimeout
|
static long |
DEFAULT_CALL_TIMEOUT
Default call timeout. |
static boolean |
DEFAULT_DESERIALIZE_RESULT
True that the result of an operation automatically should be deserialized to an object. |
static int |
DEFAULT_REPLICA_INDEX
Default replica index. |
static int |
DEFAULT_TRY_COUNT
Default try count. |
static long |
DEFAULT_TRY_PAUSE_MILLIS
Default try pause in milliseconds. |
protected ExecutionCallback<Object> |
executionCallback
|
protected NodeEngineImpl |
nodeEngine
|
protected Operation |
op
|
protected int |
partitionId
|
protected int |
replicaIndex
|
protected boolean |
resultDeserialized
|
protected String |
serviceName
|
protected Address |
target
|
protected int |
tryCount
|
protected long |
tryPauseMillis
|
Constructor Summary | |
---|---|
InvocationBuilder(NodeEngineImpl nodeEngine,
String serviceName,
Operation op,
int partitionId,
Address target)
Creates an InvocationBuilder |
Method Summary | ||
---|---|---|
Callback |
getCallback()
Deprecated. |
|
long |
getCallTimeout()
|
|
ExecutionCallback<Object> |
getExecutionCallback()
Gets the ExecutionCallback. |
|
Operation |
getOp()
Gets the operation to execute. |
|
int |
getPartitionId()
Returns the partition id. |
|
int |
getReplicaIndex()
Gets the replicaIndex. |
|
String |
getServiceName()
Gets the name of the service. |
|
Address |
getTarget()
Returns the target machine. |
|
int |
getTryCount()
Gets the try count; the number of times this operation can be retried. |
|
long |
getTryPauseMillis()
Gets the pause time in milliseconds. |
|
abstract
|
invoke()
|
|
boolean |
isResultDeserialized()
Checks if the Future should automatically deserialize the result. |
|
InvocationBuilder |
setCallback(Callback<Object> callback)
Deprecated. |
|
InvocationBuilder |
setCallTimeout(long callTimeout)
|
|
InvocationBuilder |
setExecutionCallback(ExecutionCallback<Object> executionCallback)
Sets the ExecutionCallback. |
|
InvocationBuilder |
setReplicaIndex(int replicaIndex)
Sets the replicaIndex. |
|
InvocationBuilder |
setResultDeserialized(boolean resultDeserialized)
Sets the automatic deserialized option for the result. |
|
InvocationBuilder |
setTryCount(int tryCount)
Sets the try count; the number of times this operation can be retried. |
|
InvocationBuilder |
setTryPauseMillis(long tryPauseMillis)
Sets the pause time in milliseconds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_CALL_TIMEOUT
public static final int DEFAULT_REPLICA_INDEX
public static final int DEFAULT_TRY_COUNT
public static final long DEFAULT_TRY_PAUSE_MILLIS
public static final boolean DEFAULT_DESERIALIZE_RESULT
protected final NodeEngineImpl nodeEngine
protected final String serviceName
protected final Operation op
protected final int partitionId
protected final Address target
protected Callback<Object> callback
protected ExecutionCallback<Object> executionCallback
protected long callTimeout
protected int replicaIndex
protected int tryCount
protected long tryPauseMillis
protected boolean resultDeserialized
Constructor Detail |
---|
public InvocationBuilder(NodeEngineImpl nodeEngine, String serviceName, Operation op, int partitionId, Address target)
nodeEngine
- the nodeEngineserviceName
- the name of the serviceop
- the operation to executepartitionId
- the id of the partition upon which to execute the operationtarget
- the target machine. Either the partitionId or the target needs to be set.Method Detail |
---|
public InvocationBuilder setReplicaIndex(int replicaIndex)
replicaIndex
- the replica index
IllegalArgumentException
- if replicaIndex smaller than 0 or larger than the max replica count.public boolean isResultDeserialized()
Data
to be returned, but the deserialized object. But in some
cases, you want to get the raw Data object.
Defaults to true.
public InvocationBuilder setResultDeserialized(boolean resultDeserialized)
resultDeserialized
- true if data
isResultDeserialized()
public InvocationBuilder setTryCount(int tryCount)
tryCount
- the try count; the number of times this operation can be retried
public InvocationBuilder setTryPauseMillis(long tryPauseMillis)
tryPauseMillis
- the pause time in milliseconds.
public InvocationBuilder setCallTimeout(long callTimeout)
public String getServiceName()
public Operation getOp()
public int getReplicaIndex()
public int getTryCount()
public long getTryPauseMillis()
public Address getTarget()
public int getPartitionId()
public long getCallTimeout()
@Deprecated public Callback getCallback()
getExecutionCallback()
@Deprecated public InvocationBuilder setCallback(Callback<Object> callback)
setExecutionCallback(ExecutionCallback)
public ExecutionCallback<Object> getExecutionCallback()
public InvocationBuilder setExecutionCallback(ExecutionCallback<Object> executionCallback)
executionCallback
- the new ExecutionCallback. If null is passed, the ExecutionCallback is unset.
IllegalStateException
- if a Callback
already has been set.public abstract <E> InternalCompletableFuture<E> invoke()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |