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


Variable Index

 o originator

Constructor Index

 o Lock()
 o Lock(String)

Method Index

 o allows(Action)
This method is executed when you attempt an Action using the key to this lock.
 o blocks(Action)
This method is executed when the application attempts an action without a lock.
 o consistent(Lock)
This method is executed when an application is requesting a new lock, but does not have the key to this lock.
 o equals(Object)
 o getType()
 o isOwnedBy(SessionParticipant)
 o keyWorksWith(Lock)
This method is executed when an application is requesting a new lock, and the application has the key to this lock.
 o 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.

Variables

 o originator
 protected String originator

Constructors

 o Lock
 public Lock(String name)
Parameters:
name - the name of the descriptor
Returns:
Creates a lock
 o Lock
 public Lock()
Returns:
Creates a lock, should only be used by Marshall

Methods

 o 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
 o getType
 public String getType()
Returns:
returns the type of lock (the name of the lock)
 o isOwnedBy
 public boolean isOwnedBy(SessionParticipant p)
 o 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
 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, our assumption is that a lock doesn't block anything unless you say it does
 o 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
 o 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
 o 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