All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.habanero.ExclusiveLock

java.lang.Object
   |
   +----ncsa.habanero.Lock
           |
           +----ncsa.habanero.ExclusiveLock

public class ExclusiveLock
extends Lock
ExclusiveLock - a limitation on the types of action that can be performed


Constructor Index

 o ExclusiveLock()

Method Index

 o allows(Action)
This method is used when an action is being attempted, it checks to see if the action is allowed.
 o blocks(Action)
This method is executed when the application attempts an action without a lock.
 o consistent(Lock)
This routine is used to determine if this lock can coexist with this older lock.
 o equals(Object)
Used to compare locks
 o keyWorksWith(Lock)
The user has the key to the current lock, is the lock still legal.
 o releaseAfterUsing()
Should this lock be released after it has been used only once

Constructors

 o ExclusiveLock
 public ExclusiveLock()
Returns:
an exclusive lock, only one of these may be created at any time

Methods

 o allows
 public boolean allows(Action act)
This method is used when an action is being attempted, it checks to see if the action is allowed.

Parameters:
act - the action that is being attempted
Returns:
true, always, this lock allows anything to be done
Overrides:
allows in class Lock
 o blocks
 public boolean blocks(Action act)
This method is executed when the application attempts an action without a lock.

Parameters:
act - the action that is being attempted without a lock
Returns:
returns true if the action is not allowed by the lock, an exclusive lock doesn't let anything happen while it exists
Overrides:
blocks in class Lock
 o consistent
 public boolean consistent(Lock lkdRequest)
This routine is used to determine if this lock can coexist with this older lock.

Parameters:
lkdRequest - the other lock that is attempted
Returns:
false, always this lock conflicts with anything
Overrides:
consistent in class Lock
 o keyWorksWith
 public boolean keyWorksWith(Lock ldRequest)
The user has the key to the current lock, is the lock still legal.

Parameters:
ldRequest - the request that the user is making
Returns:
always returns false, this is the only lock that can exist
Overrides:
keyWorksWith in class Lock
 o releaseAfterUsing
 public boolean releaseAfterUsing()
Should this lock be released after it has been used only once

Returns:
always returns true, since it maintains such a strong hold on actions
Overrides:
releaseAfterUsing in class Lock
 o equals
 public boolean equals(Object another)
Used to compare locks

Parameters:
another - the other lock
Returns:
always true
Overrides:
equals in class Lock

All Packages  Class Hierarchy  This Package  Previous  Next  Index