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
-
ExclusiveLock()
-
-
allows(Action)
-
This method is used when an action is being attempted, it
checks to see if the action is allowed.
-
blocks(Action)
-
This method is executed when the application attempts an action
without a lock.
-
consistent(Lock)
-
This routine is used to determine if this lock can coexist with this
older lock.
-
equals(Object)
-
Used to compare locks
-
keyWorksWith(Lock)
-
The user has the key to the current lock, is the lock still legal.
-
releaseAfterUsing()
-
Should this lock be released after it has been used only once
ExclusiveLock
public ExclusiveLock()
- Returns:
- an exclusive lock, only one of these may be created at any time
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
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
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
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
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
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