org.objectweb.jotm.core.conflict
Interface ConflictTable

All Known Implementing Classes:
BasicConflictTable

public interface ConflictTable

Conflict Table is a table that for each pair of lock modes specifies whether they are conflicting or not. It is not necesarilly symmetric (to support e.g. "update locks" and other non-symmetreic locks) and transitive.


Method Summary
 java.lang.String[] getLockModes()
          Gets lock modes.
 boolean isConflict(java.lang.String requestMode, java.lang.String holdMode)
          Tests if there is conflict between two lock modes.
 

Method Detail

isConflict

public boolean isConflict(java.lang.String requestMode,
                          java.lang.String holdMode)
                   throws ConflictUndefinedException
Tests if there is conflict between two lock modes. Note that it is important to differentiate between the requested and hold lock modes, since the conflict table can be assymetric.

Parameters:
requestMode - requested lock mode
holdMode - hold lock mode
Returns:
true if given lock modes are conflicting, false otherwise
Throws:
ConflictUndefinedException - if conflict between given lock modes is undefined

getLockModes

public java.lang.String[] getLockModes()
Gets lock modes. The method return an array of all lock modes defined in this conflict table.

Returns:
array of all conflict table lock modes