Search in sources :

Example 6 with Locking

use of org.jgroups.protocols.Locking in project JGroups by belaban.

the class LockServiceDuplicateLockTest method assertServerLocks.

protected void assertServerLocks(int num, int... indices) {
    for (int index : indices) {
        JChannel ch = channels[index];
        Locking lock = ch.getProtocolStack().findProtocol(Locking.class);
        assert lock.getNumServerLocks() == num : String.format("expected %d server locks but found %d in %s", num, lock.getNumServerLocks(), ch.getAddress());
    }
}
Also used : Locking(org.jgroups.protocols.Locking)

Aggregations

Locking (org.jgroups.protocols.Locking)6 JChannel (org.jgroups.JChannel)3 LockService (org.jgroups.blocks.locking.LockService)2 CENTRAL_LOCK (org.jgroups.protocols.CENTRAL_LOCK)1 Protocol (org.jgroups.stack.Protocol)1 BeforeMethod (org.testng.annotations.BeforeMethod)1