|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.core.Policy
orca.shirako.core.BrokerPolicy
orca.policy.core.BrokerBasePolicyPlugin
public abstract class BrokerBasePolicyPlugin
BrokerBasePolicyPlugin specifies and implements some of the
broker's base resource allocation and upstream bidding policy.
| Field Summary | |
|---|---|
protected BrokerCalendar |
calendar
The broker calendar: list of client requests, source reservations, and allocated reservations. |
static java.lang.String |
PropertyDiscoverTypes
|
static java.lang.String |
PropertyTypeCount
|
static java.lang.String |
PropertyTypeDescriptionPrefix
|
static java.lang.String |
PropertyTypeNamePrefix
|
protected boolean |
requireApproval
If true, every allocated ticket will require administrative approval before being sent back. |
| Fields inherited from class orca.shirako.core.BrokerPolicy |
|---|
recoverer |
| Fields inherited from class orca.shirako.core.Policy |
|---|
actor, clock, guid, logger, PropertyGuid |
| Constructor Summary | |
|---|---|
BrokerBasePolicyPlugin()
Creates a "blank" instance. |
|
| Method Summary | |
|---|---|
protected void |
addForApproval(BrokerReservation r)
Add a reservation to the approval list |
protected void |
addForApprovalCalendar(BrokerReservation r)
Adds the reservation to the approval list and removes the reservation from the closing calendar (if it belongs to it). |
protected void |
addToCalendar(ResourceSet mine,
BrokerReservation reservation,
ReservationClient source,
Term approved)
Record the new reservation in the agent's calendar |
void |
approve(BrokerReservation r)
Approve a reservation. |
protected void |
checkPending()
Checks pending bids, and installs successfully completed requests in the holdings calendar. |
void |
close(ResourceReservation reservation)
Notifies the policy that a reservation is about to be closed. |
void |
closed(ResourceReservation reservation)
Notifies the policy that a reservation has been closed. |
protected ResourceCount |
count(ReservationSet set,
java.util.Date when)
Return a counter for the ReservationSet |
void |
donate(ReservationClient reservation)
Accepts ticketed resources to be used for allocation of client requests. |
void |
finish(long cycle)
Informs the mapper that all processing for the specified cycle is complete. |
ReservationSet |
getClosing(long cycle)
Returns a set of reservations that must be closed. |
ReservationSet |
getForApproval()
Return a list of all reservations that require approval |
protected abstract long |
getRenew(ReservationClient reservation)
Returns the renew time of a given reservation |
void |
initialize()
Initializes the object. |
void |
notApprove(BrokerReservation r)
Do not approve a reservation. |
java.util.Properties |
query(java.util.Properties properties)
Answers a query from another actor. |
protected void |
release(BrokerReservation r)
Release resources associated with a client reservation. |
protected void |
release(ReservationClient r)
Release resources associated with a source reservation. |
protected void |
releaseNotApproved(BrokerReservation r)
Release the resources for a reservation that is not approved. |
void |
remove(ResourceReservation reservation)
Notifies the policy that a reservation is about to be removed. |
protected void |
removeForApproval(BrokerReservation r)
Remove a reservation from the approval list |
void |
revisit(ResourceReservation reservation)
Informs the mapper about a reservation. |
protected void |
revisitClient(ReservationClient r)
Recovers a source reservation. |
protected void |
revisitServer(BrokerReservation r)
Recovers a client reservation. |
| Methods inherited from class orca.shirako.core.BrokerPolicy |
|---|
allocate, bind, demand, extend, formulateBids, getHoldings, getHoldings, getRedeeming, prepareExtend, prepareReserve, reset, revisit, ticketSatisfies, updateTicketComplete |
| Methods inherited from class orca.shirako.core.Policy |
|---|
error, extend, getGuid, internalError, logError, logWarn, prepare, reset, save, save, setActor, setLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface orca.shirako.api.IPolicy |
|---|
extend, getGuid, prepare, setActor, setLogger |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Methods inherited from interface orca.shirako.api.IPolicy |
|---|
extend, getGuid, prepare, setActor, setLogger |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Field Detail |
|---|
public static final java.lang.String PropertyTypeNamePrefix
public static final java.lang.String PropertyTypeDescriptionPrefix
public static final java.lang.String PropertyTypeCount
public static final java.lang.String PropertyDiscoverTypes
protected BrokerCalendar calendar
protected boolean requireApproval
| Constructor Detail |
|---|
public BrokerBasePolicyPlugin()
| Method Detail |
|---|
public void initialize()
throws java.lang.Exception
IInitialize
initialize in interface IInitializeinitialize in class BrokerPolicyjava.lang.Exceptionpublic void finish(long cycle)
IPolicy
Note: The cycle number parameter is redundant and is passed for
convenience. The policy can always obtain the cycle number by calling
IActor.getCurrentCycle().
finish in interface IPolicyfinish in class Policycycle - the cycle number that has just passed
public void donate(ReservationClient reservation)
throws java.lang.Exception
IServerPolicyNote: This method will be invoked only for resources not directly requested by the policy. For example, exported resources claimed manually by an administrator. The policy is itself responsible to "donate" resources to its inventory when resources it requests become available.
donate in interface IServerPolicydonate in class BrokerPolicyjava.lang.Exceptionpublic void close(ResourceReservation reservation)
IPolicy
close in interface IPolicyclose in class Policyreservation - reservation about to closepublic void closed(ResourceReservation reservation)
IPolicy
Note: For an authority resources are released using the
#IAuthorityPolicy.release(ResourceSet) method. Authority policy
implementations should not consider the resources of the passed
reservation as released. The release will take place once all
configuration actions complete.
closed in interface IPolicyclosed in class Policyreservation - closed reservationIAuthorityPolicy.release(ResourceSet)protected void release(ReservationClient r)
r - source reservationprotected void release(BrokerReservation r)
r - client reservationprotected void releaseNotApproved(BrokerReservation r)
r - public void remove(ResourceReservation reservation)
IPolicyNote: Only failed and closed reservations can be removed. The system will not invoke this method if the reservation is not closed or failed.
remove in interface IPolicyremove in class Policyreservation - reservation to be removedpublic ReservationSet getForApproval()
protected void addForApproval(BrokerReservation r)
r -
protected void addForApprovalCalendar(BrokerReservation r)
throws java.lang.Exception
r -
java.lang.Exceptionprotected void removeForApproval(BrokerReservation r)
r - public void approve(BrokerReservation r)
r - public void notApprove(BrokerReservation r)
r -
protected void checkPending()
throws java.lang.Exception
java.lang.Exception
public void revisit(ResourceReservation reservation)
throws java.lang.Exception
IPolicy
revisit in interface IPolicyrevisit in class BrokerPolicyjava.lang.Exception
protected void revisitClient(ReservationClient r)
throws java.lang.Exception
r - reservation to recover
java.lang.Exception
protected void revisitServer(BrokerReservation r)
throws java.lang.Exception
r - reservation to recover
java.lang.Exceptionpublic java.util.Properties query(java.util.Properties properties)
IPolicy
query in interface IPolicyquery in class Policy
protected void addToCalendar(ResourceSet mine,
BrokerReservation reservation,
ReservationClient source,
Term approved)
mine - new ticketreservation - requestsource - source assigned to this requestapproved - approved term
java.lang.Exception
protected ResourceCount count(ReservationSet set,
java.util.Date when)
set - the set of reservations being countedwhen - the date when to count the resources
protected abstract long getRenew(ReservationClient reservation)
throws java.lang.Exception
reservation - reservation to calculate renew time from
java.lang.Exceptionpublic ReservationSet getClosing(long cycle)
IPolicy
getClosing in interface IPolicygetClosing in class Policycycle - the current cycle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||