All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.habanero.LimitArbitrator
java.lang.Object
|
+----ncsa.habanero.ModelObject
|
+----ncsa.habanero.granted.Arbitrator
|
+----ncsa.habanero.CentralArbitrator
|
+----ncsa.habanero.LimitArbitrator
- public class LimitArbitrator
- extends CentralArbitrator
- implements Observer
A LimitArbitrator is an arbitrator that forces you to have a lock
for all actions except the quit action. The LimitArbitrator
provides keys, compares a new lock against older locks, and
requires all actions to have keys. Also allows actions or
keys to block until allowed.
-
validLockSet
-
-
LimitArbitrator()
-
-
LimitArbitrator(Arbitrator)
-
-
anyBlocks(Action)
-
-
anyConflicts(Lock, Key)
-
-
arbitrate(ActionRequest)
- These routines should be overridden to do something with the
request.
-
blockingGetLock(Lock, Key)
- This blocks for up to 5 seconds if it cannot get a lock, then tries
again
-
checkLockSet()
-
-
doArbitration(ActionRequest)
-
-
findLocker(Key)
-
-
getLock(Lock, Key)
-
-
keylessAction(Action)
-
-
releaseLock(int)
-
-
releaseLock(Key)
-
-
releaseOwnedLocks(SessionParticipant)
-
-
update(Observable, Object)
-
-
validate(Key)
-
validLockSet
protected Vector validLockSet
LimitArbitrator
protected LimitArbitrator(Arbitrator parent) throws IOException
- Parameters:
- parent - the parent arbitrator
- r - the router
- Returns:
- a new arbitrator
LimitArbitrator
protected LimitArbitrator()
- Returns:
- creates a new arbitrator
doArbitration
protected boolean doArbitration(ActionRequest request)
arbitrate
public synchronized boolean arbitrate(ActionRequest request)
- These routines should be overridden to do something with the
request. The result should be an ActionGranted sent to the
router.
- Parameters:
- request - the action request to be performed
- Returns:
- true if the action was performed, false if it was not able to
- Overrides:
- arbitrate in class CentralArbitrator
getLock
public synchronized Key getLock(Lock ldNew,
Key oldKey)
- Parameters:
- ldNew - - the new lock descriptor
- oldKey - - the key used to acquire this new lock
- Returns:
- returns a key for a lock built from the lock
descriptor if it is OK to do so
- Overrides:
- getLock in class CentralArbitrator
blockingGetLock
public synchronized Key blockingGetLock(Lock ldNew,
Key oldKey)
- This blocks for up to 5 seconds if it cannot get a lock, then tries
again
- Overrides:
- blockingGetLock in class Arbitrator
releaseLock
public synchronized void releaseLock(Key kFinished)
- Parameters:
- kFinished - - the key of the lock that is no longer needed
- Returns:
- releases the lock
- Overrides:
- releaseLock in class CentralArbitrator
releaseLock
protected synchronized void releaseLock(int kFinished)
- Parameters:
- kFinished - - the index of the lock that is no longer needed
- Returns:
- releases the lock
releaseOwnedLocks
protected synchronized void releaseOwnedLocks(SessionParticipant client)
validate
public boolean validate(Key kUse)
- Parameters:
- kUse - - the key we are going to use
- Returns:
- determines if the lock is good, and returns
true if it has been used
anyConflicts
protected boolean anyConflicts(Lock ldRequest,
Key oldKey)
- Parameters:
- ldRequest - - the description the user is requesting
- Returns:
- returns true if there is a conflicts with earlier locks
keylessAction
protected boolean keylessAction(Action act)
- Parameters:
- act - - the action that we are checking to see if anyone objects
- Returns:
- returns true if a lock objects to the action
anyBlocks
protected boolean anyBlocks(Action act)
- Parameters:
- act - - the action that we are checking to see if anyone objects
- Returns:
- returns true if a lock objects to the action
findLocker
protected Locker findLocker(Key key)
- Parameters:
- kSearch - - the key of the lock we are searching for
- Returns:
- returns the lock if it exists, and null otherwise
checkLockSet
protected void checkLockSet()
update
public void update(Observable o,
Object arg)
All Packages Class Hierarchy This Package Previous Next Index