All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.habanero.Lock
java.lang.Object
|
+----ncsa.habanero.Lock
- public abstract class Lock
- extends Object
- implements Marshallable
Lock - a limitation on the Locker
-
originator
-
-
Lock()
-
-
Lock(String)
-
-
allows(Action)
-
This method is executed when you attempt an Action using the key
to this lock.
-
blocks(Action)
-
This method is executed when the application attempts an action
without a lock.
-
consistent(Lock)
-
This method is executed when an application is requesting a new
lock, but does not have the key to this lock.
-
equals(Object)
-
-
getType()
-
-
isOwnedBy(SessionParticipant)
-
-
keyWorksWith(Lock)
-
This method is executed when an application is requesting a new
lock, and the application has the key to this lock.
-
releaseAfterUsing()
-
This method returns true if the lock should only be used
once and then automatically released, and this method returns
false if the application is responsible for releasing
the lock.
originator
protected String originator
Lock
public Lock(String name)
- Parameters:
- name - the name of the descriptor
- Returns:
- Creates a lock
Lock
public Lock()
- Returns:
- Creates a lock, should only be used by Marshall
equals
public boolean equals(Object another)
- Parameters:
- another - any type of object
- Returns:
- returns true if the locks are equal
- Overrides:
- equals in class Object
getType
public String getType()
- Returns:
- returns the type of lock (the name of the lock)
isOwnedBy
public boolean isOwnedBy(SessionParticipant p)
allows
public abstract boolean allows(Action act)
- This method is executed when you attempt an Action using the key
to this lock.
- Parameters:
- act - the action to be performed
- Returns:
- returns the true if the lock allows the action to be performed
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,
our assumption is that a lock doesn't block anything
unless you say it does
consistent
public abstract boolean consistent(Lock lkdRequest)
- This method is executed when an application is requesting a new
lock, but does not have the key to this lock.
- Parameters:
- ldRequest - the lock request
- Returns:
- returns false if the request conflicts with the lock,
this is used when the user does not have the key
keyWorksWith
public boolean keyWorksWith(Lock ldRequest)
- This method is executed when an application is requesting a new
lock, and the application has the key to this lock.
- Parameters:
- ldRequest - the lock request
- Returns:
- returns false if the request conflicts with the lock,
this is used when the user has the key
releaseAfterUsing
public boolean releaseAfterUsing()
- This method returns true if the lock should only be used
once and then automatically released, and this method returns
false if the application is responsible for releasing
the lock.
- Returns:
- returns true if the lock may only be used once
All Packages Class Hierarchy This Package Previous Next Index