ariba.util.core
Interface GlobalLock


public interface GlobalLock

Interface for a GlobalLock. The GlobalLockingService implementation will return an instance of one of these for the locking implementation. All operations on a lock object (extending the timeout, releasing the lock, etc) happen through this interface.


Method Summary
 java.lang.String getGroup()
           
 java.lang.String getName()
           
 boolean isValid()
           
 void release()
          relelase the lock.
 void setExpirationTime(long millisFromNow)
          Set the lifetime of the lock.
 void setGroup(java.lang.String groupName)
          Add this lock to the specified lock group
 

Method Detail

isValid

boolean isValid()
Returns:
true if this lock is valid (has not expired), false otherwise.

getName

java.lang.String getName()
Returns:
The name of the lock

getGroup

java.lang.String getGroup()
Returns:
the group this lock belongs to. Null if it belongs to no group

setGroup

void setGroup(java.lang.String groupName)
              throws GlobalLockingException
Add this lock to the specified lock group

Parameters:
groupName - The name of the group. It must already exist
Throws:
Throw - global locking exception on error. Errors are 1) the lock is not valid, 2) the lock group does not exist, and 3) there is no more room in the group
GlobalLockingException

release

void release()
             throws GlobalLockingException
relelase the lock.

Throws:
if - the lock is invalid (has expired or was released)
GlobalLockingException

setExpirationTime

void setExpirationTime(long millisFromNow)
                       throws GlobalLockingException
Set the lifetime of the lock. This sets the new expiration time to the current time plus the number of milliseconds requested.

Parameters:
millisFromNow - Milliseconds from now for the new expiration
Throws:
GlobalLockingException - if the lock is not valid (has already expired, or was released)


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.