|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hazelcast.transaction.TransactionOptions
public final class TransactionOptions
Contains the configuration for a Hazelcast transaction.
Nested Class Summary | |
---|---|
static class |
TransactionOptions.TransactionType
The type of transaction. |
Field Summary | |
---|---|
static long |
DEFAULT_TIMEOUT_MILLIS
2 minutes as default timeout value |
Constructor Summary | |
---|---|
TransactionOptions()
Creates a new default configured TransactionsOptions. |
Method Summary | |
---|---|
static TransactionOptions |
getDefault()
Creates a new TransactionOptions configured with default settings. |
int |
getDurability()
Gets the transaction durability. |
long |
getTimeoutMillis()
Gets the timeout in milliseconds. |
TransactionOptions.TransactionType |
getTransactionType()
Gets the TransactionOptions.TransactionType . |
void |
readData(ObjectDataInput in)
Reads fields from the input stream |
TransactionOptions |
setDurability(int durability)
Sets the transaction durability. |
TransactionOptions |
setTimeout(long timeout,
TimeUnit timeUnit)
Sets the timeout. |
TransactionOptions |
setTransactionType(TransactionOptions.TransactionType transactionType)
Sets the TransactionOptions.TransactionType . |
String |
toString()
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_TIMEOUT_MILLIS
Constructor Detail |
---|
public TransactionOptions()
Method Detail |
---|
public TransactionOptions.TransactionType getTransactionType()
TransactionOptions.TransactionType
.
public TransactionOptions setTransactionType(TransactionOptions.TransactionType transactionType)
TransactionOptions.TransactionType
.
A local transaction is less safe than a two phase transaction; when a member fails during the commit
of a local transaction, it could be that some of the changes are committed, while others are not and this
can leave your system in an inconsistent state.
transactionType
- the new TransactionType.
getTransactionType()
,
setDurability(int)
public long getTimeoutMillis()
setTimeout(long, java.util.concurrent.TimeUnit)
public TransactionOptions setTimeout(long timeout, TimeUnit timeUnit)
timeout
- the timeout.timeUnit
- the TimeUnit of the timeout.
IllegalArgumentException
- if timeout smaller or equal than 0, or timeUnit is null.getTimeoutMillis()
public int getDurability()
setDurability(int)
public TransactionOptions setDurability(int durability)
TransactionOptions.TransactionType.TWO_PHASE
is selected.
durability
- the durability
IllegalArgumentException
- if durability smaller than 0.public static TransactionOptions getDefault()
TransactionOptions()
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- output
IOException
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- input
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |