All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.habanero.DynamicArbitrator
java.lang.Object
|
+----ncsa.habanero.ModelObject
|
+----ncsa.habanero.granted.Arbitrator
|
+----ncsa.habanero.DynamicArbitrator
- public class DynamicArbitrator
- extends Arbitrator
- implements Replaceable
The DynamicArbitrator provides a wrapper around another Arbitrator,
to which it delegates most of its messages. This provides two
advantages: it allows dynamic switching between arbitration types
without the knowledge of other classes, and it allows added
functionality to be added to a number of classes which should not
go in a common base class (sort of a poor man's multiple inheritance.)
-
delegate
-
-
DynamicArbitrator(ModelObject, Arbitrator)
- The constructor invokes the parent's constructor and sets the delegate
-
DynamicArbitrator(ModelObject, Arbitrator, Object)
-
-
arbitrate(ActionRequest)
- Send a request to the delegate.
-
completedParticipantAddition(SessionParticipant)
- This will be called by the ParticipantAddingAction to inform any
interested Arbitrators that a participant add has completed.
-
deliver(ServerMessage)
-
-
getDelegate()
-
-
getLock(Lock)
-
getLock
Requires: lkdNew
Modifies: itself
Effects: returns a lock built from the lock descriptor if it
is OK to do so
-
getLock(Lock, Key)
-
-
getReplacement()
-
-
getSerializer()
- Return the Serializer used by this Arbitrator.
-
getTicketGranter()
- Return the TicketGranter used by this Arbitrator.
-
grant_request(ActionRequest)
- Send a request to the delegate.
-
isDistributed()
-
-
releaseLock(Key)
-
releaseLock
Requires: lkFinished - the key of the lock that is no longer needed
Modifies: itself
Effects: releases the lock
-
setOwner(Sharable)
- Set the Sharable which owns this object.
-
stop()
-
-
writeInfo(MarshallOutput)
- Write some subclass-specific information to the output object.
delegate
protected Arbitrator delegate
DynamicArbitrator
protected DynamicArbitrator(ModelObject mama,
Arbitrator proxy)
- The constructor invokes the parent's constructor and sets the delegate
- Parameters:
- proxy - the Arbitrator to which we delegate
DynamicArbitrator
protected DynamicArbitrator(ModelObject mama,
Arbitrator proxy,
Object key)
arbitrate
public synchronized boolean arbitrate(ActionRequest request)
- Send a request to the delegate.
- Parameters:
- request - the ActionRequest we want to grant
- Overrides:
- arbitrate in class Arbitrator
getLock
public Key getLock(Lock lkdNew)
- getLock
Requires: lkdNew
Modifies: itself
Effects: returns a lock built from the lock descriptor if it
is OK to do so
- Overrides:
- getLock in class Arbitrator
getLock
public Key getLock(Lock lkdNew,
Key oldKey)
- Overrides:
- getLock in class Arbitrator
releaseLock
public void releaseLock(Key lkFinished)
- releaseLock
Requires: lkFinished - the key of the lock that is no longer needed
Modifies: itself
Effects: releases the lock
- Overrides:
- releaseLock in class Arbitrator
deliver
public void deliver(ServerMessage message)
- Overrides:
- deliver in class Arbitrator
grant_request
public ActionGranted grant_request(ActionRequest request)
- Send a request to the delegate.
- Parameters:
- request - the ActionRequest we want to grant
- Overrides:
- grant_request in class Arbitrator
getTicketGranter
public TicketGranter getTicketGranter()
- Return the TicketGranter used by this Arbitrator.
- Overrides:
- getTicketGranter in class Arbitrator
getSerializer
public Serializer getSerializer()
- Return the Serializer used by this Arbitrator.
- Overrides:
- getSerializer in class Arbitrator
writeInfo
public void writeInfo(MarshallOutput out)
- Write some subclass-specific information to the output object.
- Overrides:
- writeInfo in class Arbitrator
stop
public synchronized void stop()
- Overrides:
- stop in class Arbitrator
isDistributed
public boolean isDistributed()
- Overrides:
- isDistributed in class Arbitrator
setOwner
public synchronized void setOwner(Sharable owner)
- Set the Sharable which owns this object.
- Overrides:
- setOwner in class Arbitrator
getReplacement
public Object getReplacement()
- Parameters:
- out - the output stream
- Returns:
- writes the key to the output stream
- Overrides:
- getReplacement in class ModelObject
getDelegate
public Arbitrator getDelegate()
- Returns:
- the delegate arbitrator that it is holding
completedParticipantAddition
public void completedParticipantAddition(SessionParticipant p)
- This will be called by the ParticipantAddingAction to inform any
interested Arbitrators that a participant add has completed.
- Overrides:
- completedParticipantAddition in class Arbitrator
All Packages Class Hierarchy This Package Previous Next Index