|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.core.Actor
orca.shirako.core.Broker
public class Broker
Broker offers the base for all broker actors.
| Field Summary | |
|---|---|
protected PeerRegistry |
registry
The peer registry. |
| Fields inherited from class orca.shirako.core.Actor |
|---|
clock, currentCycle, DefaultDescription, description, firstTick, fromDB, guid, identity, kernel, logger, monitor, policy, PropertyAuthToken, PropertyDescription, PropertyManager, PropertyMapper, PropertyMapperClass, PropertyPlugin, PropertyPluginClass, PropertyType, recovered, spi, stopped, type, wrapper |
| Fields inherited from interface orca.shirako.api.IActor |
|---|
PropertyClass, PropertyGuid, PropertyName, TypeAll, TypeBroker, TypeServiceManager, TypeSiteAuthority |
| Fields inherited from interface orca.shirako.api.IActor |
|---|
PropertyClass, PropertyGuid, PropertyName, TypeAll, TypeBroker, TypeServiceManager, TypeSiteAuthority |
| Constructor Summary | |
|---|---|
Broker()
Default constructor. |
|
Broker(AuthToken identity,
ActorClock clock)
Creates a new broker with the given identity and term factory. |
|
| Method Summary | |
|---|---|
void |
actorAdded()
Informs the actor that it has been integrated in the container. |
void |
addBroker(IBrokerProxy broker)
Registers a broker. |
protected void |
bid(long cycle)
Bids for resources as dictated by the plugin bidding policy for the current cycle. |
ReservationClient |
claim(ReservationID reservationID,
ResourceSet resources)
Claims already exported resources from the default upstream broker. |
ReservationClient |
claim(ReservationID reservationID,
ResourceSet resources,
IBrokerProxy broker)
Claims already exported resources from the given broker. |
ReservationClient |
claim(ReservationID reservationID,
ResourceSet resources,
Slice slice,
IBrokerProxy broker)
Claims already exported resources from the given broker. |
void |
claim(ResourceReservation reservation,
IClientCallbackProxy callback,
AuthToken caller)
Services a request to claim a previously exported ticket. |
protected void |
closeExpiring(long cycle)
Close expiring reservations |
void |
demand(ReservationClient reservation)
Injects a new resource demand into the demand stream. |
void |
donate(ReservationClient reservation)
Accepts ticketed resources to be used for allocation of client requests. |
void |
export(BrokerReservation reservation,
AuthToken client)
Exports the resources described by the reservation to the client. |
ReservationID |
export(ResourceSet resources,
Term term,
AuthToken client)
Exports the specified resources for the given period of time to the client. |
void |
extendTicket(BrokerReservation reservation)
Processes an extend ticket request for the reservation. |
void |
extendTicket(ReservationClient reservation)
Issues a ticket extend request for the given reservation. |
void |
extendTicket(ReservationSet set)
Issues a ticket request for every reservation in the set. |
void |
extendTicket(ResourceReservation reservation,
AuthToken caller)
Services an incoming request to extend an existing ticket. |
IBrokerProxy |
getBroker(java.lang.String name)
Gets the broker proxy with the given name |
IBrokerProxy[] |
getBrokers()
Returns all brokers registered with the actor. |
IBrokerProxy |
getDefaultBroker()
Returns the default broker. |
protected Slice |
getDefaultSlice()
|
void |
initialize()
Initializes a generic actor. |
void |
ticket(BrokerReservation reservation)
Processes a ticket request for the reservation. |
void |
ticket(ReservationClient reservation)
Issues a ticket request for the given reservation. |
void |
ticket(ReservationSet set)
Issues a ticket request for every reservation in the set. |
void |
ticket(ResourceReservation reservation,
IClientCallbackProxy callback,
AuthToken caller)
Services an incoming request for a new ticket. |
protected void |
tickHandler()
Handles a timer interrupt. |
void |
updateTicket(ResourceReservation reservation,
UpdateData udd,
AuthToken caller)
Handles an incoming ticket update. |
| Methods inherited from class orca.shirako.core.Actor |
|---|
close, close, close, error, extend, extend, externalTick, getActorClock, getClientSlices, getCurrentCycle, getDescription, getGuid, getIdentity, getInventorySlices, getKernel, getLogger, getName, getName, getPolicy, getReservation, getReservations, getShirakoPlugin, getSlice, getSlices, getType, getType, initializeKeyStore, internalError, isFromDatabase, isRecovered, isStopped, query, recover, register, registerSlice, removeReservation, removeReservation, removeSlice, removeSlice, reregister, reregisterSlice, reset, reset, revisit, save, save, setActorClock, setDescription, setGuid, setIdentity, setLogger, setPolicy, setRecovered, setShirakoPlugin, setStopped, start, stop, toString, unregister, unregister, unregisterSlice, unregisterSlice |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface orca.shirako.api.IActor |
|---|
getActorClock, getCurrentCycle, getDescription, getLogger, getPolicy, getShirakoPlugin, getType, initializeKeyStore, isFromDatabase, isRecovered, isStopped, recover, setActorClock, setDescription, setGuid, setIdentity, setLogger, setPolicy, setRecovered, setShirakoPlugin, start, stop |
| Methods inherited from interface orca.shirako.api.ITick |
|---|
externalTick |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Methods inherited from interface orca.shirako.api.IRecover |
|---|
revisit |
| Methods inherited from interface orca.shirako.api.IActorPublic |
|---|
query |
| Methods inherited from interface orca.shirako.api.IActorIdentity |
|---|
getGuid, getIdentity, getName |
| Methods inherited from interface orca.shirako.api.ISliceOperations |
|---|
getClientSlices, getInventorySlices, getSlice, getSlices, registerSlice, removeSlice, removeSlice, reregisterSlice, unregisterSlice, unregisterSlice |
| Methods inherited from interface orca.shirako.api.IReservationOperations |
|---|
close, close, close, extend, extend, getReservation, getReservations, register, removeReservation, removeReservation, reregister, unregister, unregister |
| Methods inherited from interface orca.shirako.api.IActor |
|---|
getActorClock, getCurrentCycle, getDescription, getLogger, getPolicy, getShirakoPlugin, getType, initializeKeyStore, isFromDatabase, isRecovered, isStopped, recover, setActorClock, setDescription, setGuid, setIdentity, setLogger, setPolicy, setRecovered, setShirakoPlugin, start, stop |
| Methods inherited from interface orca.shirako.api.ITick |
|---|
externalTick |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Methods inherited from interface orca.shirako.api.IRecover |
|---|
revisit |
| Methods inherited from interface orca.shirako.api.IActorPublic |
|---|
query |
| Methods inherited from interface orca.shirako.api.IActorIdentity |
|---|
getGuid, getIdentity, getName |
| Methods inherited from interface orca.shirako.api.ISliceOperations |
|---|
getClientSlices, getInventorySlices, getSlice, getSlices, registerSlice, removeSlice, removeSlice, reregisterSlice, unregisterSlice, unregisterSlice |
| Methods inherited from interface orca.shirako.api.IReservationOperations |
|---|
close, close, close, extend, extend, getReservation, getReservations, register, removeReservation, removeReservation, reregister, unregister, unregister |
| Field Detail |
|---|
protected PeerRegistry registry
| Constructor Detail |
|---|
public Broker()
public Broker(AuthToken identity,
ActorClock clock)
identity - broker identityclock - term factory| Method Detail |
|---|
public void initialize()
throws java.lang.Exception
Actor
initialize in interface IInitializeinitialize in class Actorjava.lang.Exception - Throws exception of some required fields are missing.
public void actorAdded()
throws java.lang.Exception
IActor
actorAdded in interface IActoractorAdded in class Actorjava.lang.Exception
public void donate(ReservationClient reservation)
throws java.lang.Exception
IServerActor
donate in interface IServerActorjava.lang.Exceptionpublic void demand(ReservationClient reservation)
IClientActor
demand in interface IClientActorreservation - reservation representing resource demand
public void ticket(ReservationClient reservation)
throws java.lang.Exception
IClientActor
ticket in interface IClientActorreservation - reservation to obtain a ticket for
java.lang.ExceptionIReservationOperations#register(orca.shirako.kernel.Reservation)
public void ticket(BrokerReservation reservation)
throws java.lang.Exception
IBroker
ticket in interface IBrokerreservation - reservation representing a request for a new ticket
java.lang.Exceptionpublic void ticket(ReservationSet set)
IClientActor
ticket in interface IClientActorset - set of reservations to obtain tickets for
public void extendTicket(ReservationClient reservation)
throws java.lang.Exception
IClientActor
extendTicket in interface IClientActorreservation - reservation to extend the ticket for
java.lang.ExceptionIReservationOperations#register(orca.shirako.kernel.Reservation)
public void extendTicket(BrokerReservation reservation)
throws java.lang.Exception
IBroker
extendTicket in interface IBrokerreservation - reservation representing a request for a ticket
extension
java.lang.Exceptionpublic void extendTicket(ReservationSet set)
IClientActor
extendTicket in interface IClientActorset - set of reservations to extend tickets for
public ReservationID export(ResourceSet resources,
Term term,
AuthToken client)
throws java.lang.Exception
IServerActor
export in interface IServerActorresources - resources to exportterm - period the export will be validclient - identity of the client resources will be exported to
java.lang.Exception
public void export(BrokerReservation reservation,
AuthToken client)
throws java.lang.Exception
IServerActor
export in interface IServerActorreservation - reservation describing resources to exportclient - identity of the client resources will be exported to
java.lang.Exception
public ReservationClient claim(ReservationID reservationID,
ResourceSet resources)
throws java.lang.Exception
IClientActor
claim in interface IClientActorreservationID - reservation identifier of the exported reservationresources - resource set describing the resources to claim
java.lang.Exception
protected Slice getDefaultSlice()
throws java.lang.Exception
java.lang.Exception
public ReservationClient claim(ReservationID reservationID,
ResourceSet resources,
IBrokerProxy broker)
throws java.lang.Exception
IClientActor
claim in interface IClientActorreservationID - reservation identifier of the exported reservationresources - resource set describing the resources to claimbroker - broker proxy
java.lang.Exception
public ReservationClient claim(ReservationID reservationID,
ResourceSet resources,
Slice slice,
IBrokerProxy broker)
throws java.lang.Exception
IClientActor
claim in interface IClientActorreservationID - reservation identifier of the exported reservationresources - resource set describing the resources to claimslice - slice in which to store the claimed reservation. As of now,
it is assumed that the exported reservation is stored under a
slice with the same name in the upstream broker.
java.lang.Exception
public void updateTicket(ResourceReservation reservation,
UpdateData udd,
AuthToken caller)
throws java.lang.Exception
IClientPublic
updateTicket in interface IClientPublicreservation - reservation represented by this update. The
reservation object will contain the ticket (if any) as well
information about the actually allocated resources.udd - status of the remote operation.caller - identity of the caller
java.lang.Exception
public void ticket(ResourceReservation reservation,
IClientCallbackProxy callback,
AuthToken caller)
throws java.lang.Exception
IBrokerPublic
ticket in interface IBrokerPublicreservation - reservation object describing the requested resourcescallback - callback to use for sending the resultcaller - caller credentials
java.lang.Exception
public void extendTicket(ResourceReservation reservation,
AuthToken caller)
throws java.lang.Exception
IBrokerPublic
extendTicket in interface IBrokerPublicreservation - reservation object describing the reservation to
extendcaller - caller credentials
java.lang.Exception
public void claim(ResourceReservation reservation,
IClientCallbackProxy callback,
AuthToken caller)
throws java.lang.Exception
IBrokerPublic
claim in interface IBrokerPublicreservation - reservation object describing the exported resourcescallback - callback to use for sending the resultcaller - caller credentials
java.lang.Exceptionpublic void addBroker(IBrokerProxy broker)
IClientActor
addBroker in interface IClientActorbroker - broker to registerpublic IBrokerProxy getBroker(java.lang.String name)
IClientActor
getBroker in interface IClientActorname - broker name
public IBrokerProxy getDefaultBroker()
IClientActor
getDefaultBroker in interface IClientActorpublic IBrokerProxy[] getBrokers()
IClientActor
getBrokers in interface IClientActor
protected void tickHandler()
throws java.lang.Exception
Actor.currentCycle and is guaranteed not to change until the handle
invocation completes.
tickHandler in class Actorjava.lang.Exceptionprotected void closeExpiring(long cycle)
protected void bid(long cycle)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||