org.objectweb.perseus.concurrency.distributed.globallock.api

Interface GlobalLockWaiter

Known Implementing Classes:
GlobalLockWaiterImpl

public interface GlobalLockWaiter

This interface is used to sychronize with lock requests in asynchronous mode. It is returned by the upgrade method of the GlobalLock interface. This can be used to ensure FIFO handling of requests when implementing multilevel lock management.

See Also:
GlobalLock

Method Summary

byte
getLockLevel()
Get the requested lock level
void
signalHandled()
Signal that the lock granting has been handled by the waiter and that next waiters can have their requests granted if possible
boolean
waitLock(long timeout)
Wait until the lock is granted or refused.

Method Details

getLockLevel

public byte getLockLevel()
Get the requested lock level

Returns:
the requested lock level


signalHandled

public void signalHandled()
Signal that the lock granting has been handled by the waiter and that next waiters can have their requests granted if possible


waitLock

public boolean waitLock(long timeout)
            throws InterruptedException
Wait until the lock is granted or refused.

Parameters:
timeout - max time to wait

Returns:
true if the lock is granted, false if refused


Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.