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

All 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 Detail

waitLock

public boolean waitLock(long timeout)
                 throws java.lang.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
Throws:
java.lang.InterruptedException - if the thread has been interrupted

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


getLockLevel

public byte getLockLevel()
Get the requested lock level

Returns:
the requested lock level


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