|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface TransactionMap.Validator
A callback interface used by TransactionMap implementations.
By providing an implementation of this interface, it is possible to provide alternative strategies for verifying the correctness of concurrent execution of transactions.
Method Summary | |
---|---|
void |
enlist(TransactionMap mapTx,
Object oKey)
Enlist the resource with the specified transaction. |
TransactionMap.Validator |
getNextValidator()
Retrive the next Validator. |
void |
setNextValidator(TransactionMap.Validator v)
Set the next Validator. |
void |
validate(TransactionMap mapTx,
Set setInsert,
Set setUpdate,
Set setDelete,
Set setRead,
Set setPhantom)
Validate that the content of the TransactionMap is "fit" to be committed into the base map. |
Method Detail |
---|
void enlist(TransactionMap mapTx, Object oKey)
getNextValidator().enlist(map, okey);
)
mapTx
- the TransactionMap to enlist the resource withoKey
- the resource key to be enlisted with the transactionvoid validate(TransactionMap mapTx, Set setInsert, Set setUpdate, Set setDelete, Set setRead, Set setPhantom) throws ConcurrentModificationException
map.get(oKey)
, map.getBaseMap().get(oKey)
)
and use the information gathered during "enlist" calls to make
the determination whether or not commit should be allowed to proceed.
To force a roll back it should throw an exception indicating the
reason this transaction cannot be committed.
When that happens, the sets are expected to hold just the keys
of the "offending" resources.
It is this method's responsibility to call a next Validator in the
validation chain (i.e.
getNextValidator().validate(map, setI, setU, setD, setR, setF);
)
mapTx
- the TransactionMap that is being preparedsetInsert
- the set of inserted resourcessetUpdate
- the set of updated resourcessetDelete
- the set of deleted resourcessetRead
- the set of read resources. It is always empty for
TRANSACTION_GET_COMMITTED isolation level.setPhantom
- the set of phantom resources, that is resources that
were added to the base map, but were not known to the
transaction. This set can be not empty only for
TRANSACTION_GET_SERIALIZED isolation level.
ConcurrentModificationException
- if the validator detects
an unresolveable conflict between the resourcesTransactionMap.Validator getNextValidator()
void setNextValidator(TransactionMap.Validator v)
v
- the Validator to be added
IllegalStateException
- if the next validator cannot be changed
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |