|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IServerPolicy
IServerPolicy defines the policy interface for an actor acting
as a server for another actor (broker or a site authority).
| Method Summary | |
|---|---|
void |
allocate(long cycle)
Allocates resources to all clients who have requested them. |
boolean |
bind(BrokerReservation reservation)
Handles an incoming request to allocate resources and issue a ticket for the reservation. |
void |
donate(ReservationClient r)
Accepts ticketed resources to be used for allocation of client requests. |
boolean |
extend(BrokerReservation r)
Handles an incoming request to extend previously allocated resources and issue a ticket for the reservation. |
| Methods inherited from interface orca.shirako.api.IPolicy |
|---|
close, closed, extend, finish, getClosing, getGuid, prepare, query, remove, reset, revisit, setActor, setLogger |
| Methods inherited from interface orca.shirako.api.IInitialize |
|---|
initialize |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Methods inherited from interface orca.shirako.api.IRecover |
|---|
revisit |
| Method Detail |
|---|
void donate(ReservationClient r)
throws java.lang.Exception
Note: 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.
resources - reservation representing resources to be used for
allocation
java.lang.Exception
boolean bind(BrokerReservation reservation)
throws java.lang.Exception
reservation.getRequestedResources(). The requested lease
term can be obtained by calling
reservation.getRequestedTerm(). Properties specific to
the allocation protocol can be obtained by calling
reservation.getRequestedResources().getRequestProperties().
This method is invoked with the kernel lock on.
If the policy completed processing this request, the functions should
return true. If no further intervention is required, e.g., approval by an
administrator, the policy should also clear the bidPending
flag.
The policy may decide to defer the request for a later time. In this case
the function should return false and the bidPending flag
should remain unchanged.
This method may be invoked multiple times for a given reservation, i.e., if the policy delays the allocation, the system will continue invoking this method at later times until the policy completes processing this request.
reservation - reservation to allocate resources for.
java.lang.Exception
boolean extend(BrokerReservation r)
throws java.lang.Exception
reservation.getRequestedResources().
Properties specific to the allocation protocol can be obtained by calling
reservation.getRequestedResources().getRequestProperties().
The requested lease term can be obtained by calling
reservation.getRequestedTerm(). The new term must extend
the currently allocated term. This method is invoked with the kernel lock
on.
If the policy completed processing this request, the functions should
return true. If no further intervention is required, e.g., approval by an
administrator, the policy should also clear the bidPending
flag.
The policy may decide to defer the request for a later time. In this case
the function should return false and the bidPending flag
should remain unchanged.
This method may be invoked multiple times for a given reservation, i.e., if the policy delays the allocation, the system will continue invoking this method at later times until the policy completes processing this request.
While the policy is free to modify the term as it wishes, care must be taken that the client reservation is not closed before the extension is actually granted.
reservation - reservation to allocate resources for.
java.lang.Exception
void allocate(long cycle)
throws java.lang.Exception
cycle - the cycle for this allocation
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||