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.)


Variable Index

 o delegate

Constructor Index

 o DynamicArbitrator(ModelObject, Arbitrator)
The constructor invokes the parent's constructor and sets the delegate
 o DynamicArbitrator(ModelObject, Arbitrator, Object)

Method Index

 o arbitrate(ActionRequest)
Send a request to the delegate.
 o completedParticipantAddition(SessionParticipant)
This will be called by the ParticipantAddingAction to inform any interested Arbitrators that a participant add has completed.
 o deliver(ServerMessage)
 o getDelegate()
 o getLock(Lock)
getLock Requires: lkdNew Modifies: itself Effects: returns a lock built from the lock descriptor if it is OK to do so
 o getLock(Lock, Key)
 o getReplacement()
 o getSerializer()
Return the Serializer used by this Arbitrator.
 o getTicketGranter()
Return the TicketGranter used by this Arbitrator.
 o grant_request(ActionRequest)
Send a request to the delegate.
 o isDistributed()
 o releaseLock(Key)
releaseLock Requires: lkFinished - the key of the lock that is no longer needed Modifies: itself Effects: releases the lock
 o setOwner(Sharable)
Set the Sharable which owns this object.
 o stop()
 o writeInfo(MarshallOutput)
Write some subclass-specific information to the output object.

Variables

 o delegate
 protected Arbitrator delegate

Constructors

 o 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
 o DynamicArbitrator
 protected DynamicArbitrator(ModelObject mama,
                             Arbitrator proxy,
                             Object key)

Methods

 o 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
 o 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
 o getLock
 public Key getLock(Lock lkdNew,
                    Key oldKey)
Overrides:
getLock in class Arbitrator
 o 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
 o deliver
 public void deliver(ServerMessage message)
Overrides:
deliver in class Arbitrator
 o 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
 o getTicketGranter
 public TicketGranter getTicketGranter()
Return the TicketGranter used by this Arbitrator.

Overrides:
getTicketGranter in class Arbitrator
 o getSerializer
 public Serializer getSerializer()
Return the Serializer used by this Arbitrator.

Overrides:
getSerializer in class Arbitrator
 o writeInfo
 public void writeInfo(MarshallOutput out)
Write some subclass-specific information to the output object.

Overrides:
writeInfo in class Arbitrator
 o stop
 public synchronized void stop()
Overrides:
stop in class Arbitrator
 o isDistributed
 public boolean isDistributed()
Overrides:
isDistributed in class Arbitrator
 o setOwner
 public synchronized void setOwner(Sharable owner)
Set the Sharable which owns this object.

Overrides:
setOwner in class Arbitrator
 o getReplacement
 public Object getReplacement()
Parameters:
out - the output stream
Returns:
writes the key to the output stream
Overrides:
getReplacement in class ModelObject
 o getDelegate
 public Arbitrator getDelegate()
Returns:
the delegate arbitrator that it is holding
 o 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