All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.habanero.Locker

java.lang.Object
   |
   +----ncsa.habanero.Locker

public class Locker
extends Object
implements Serializable
Locker - a limitation on a collaboration session


Variable Index

 o code

Constructor Index

 o Locker()
 o Locker(Lock, KeyGen)

Method Index

 o blocks(Action)
 o conflict(Lock, Key)
 o equals(Object)
 o getKey()
 o getLock()
allows the user to get the lock out
 o isOwnedBy(SessionParticipant)
 o onlyOnce()
onlyOnce
 o openedBy(Key)
 o use(ActionRequest)
 o valid()

Variables

 o code
 protected Key code

Constructors

 o Locker
 public Locker(Lock desc,
               KeyGen keyGenerator)
Parameters:
desc - - the descriptor
keyGenerator - - the key generator
Returns:
Creates a Locker
 o Locker
 public Locker()
Returns:
Creates a Locker - should only be used by Marshall

Methods

 o isOwnedBy
 public boolean isOwnedBy(SessionParticipant p)
 o getLock
 public Lock getLock()
allows the user to get the lock out

Returns:
the lock associated with this locker
 o equals
 public boolean equals(Object another)
Parameters:
ldAnother - - a lock descriptor
Returns:
compares the lock descriptor, and returns true if they are the same
Overrides:
equals in class Object
 o valid
 public boolean valid()
Returns:
returns true if the lock is still valid
 o onlyOnce
 public boolean onlyOnce()
onlyOnce

Returns:
returns true if this lock can only be used once, a lock derived from this class has no limit to the number of times it can be used.
 o use
 public boolean use(ActionRequest req)
Returns:
uses the Locker
 o conflict
 public boolean conflict(Lock ldRequest,
                         Key oldKey)
Parameters:
ldRequest - - the key descriptor
oldKey - - the old key which gives us permission to get the request
Returns:
returns true if the old Locker and the lock descriptor would be allowing people do to things that they weren't supposed to
 o blocks
 public boolean blocks(Action act)
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 getKey
 public Key getKey()
Returns:
returns the key
 o openedBy
 public boolean openedBy(Key key)
Parameters:
key - - a key
Returns:
returns true if the key opens the Locker

All Packages  Class Hierarchy  This Package  Previous  Next  Index