|
||||||||||
| 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.ServiceManager
public class ServiceManager
ServiceManager is the base implementation for a service
manager actor.
| Field Summary | |
|---|---|
protected boolean |
initialized
initialization status |
protected ILoadSource |
loadSource
Source of load. |
static java.lang.String |
PropertyLoadSource
|
protected PeerRegistry |
registry
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 |
| Constructor Summary | |
|---|---|
ServiceManager()
Default constructor. |
|
ServiceManager(AuthToken identity,
ActorClock clock)
Creates a new service manager with the given identity and clock 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()
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. |
protected void |
closeExpiring()
Issue close requests on all reservations scheduled for closing on the current cycle |
void |
demand(ReservationClient reservation)
Injects a new resource demand into the demand stream. |
void |
extendLease(ReservationClient reservation)
Issues an extend lease request for the given reservation. |
void |
extendLease(ReservationSet set)
Issues an extend lease request for every reservation in the set. |
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. |
IBrokerProxy |
getBroker(java.lang.String name)
Gets the broker proxy with the given name |
IBrokerProxy[] |
getBrokers()
Returns all brokers registered with the service manager. |
java.util.Vector<IController> |
getControllers()
Returns all registered controllers. |
IBrokerProxy |
getDefaultBroker()
Returns the default broker. |
ILoadSource |
getLoadSource()
Returns the load source. |
void |
initialize()
Initializes a generic actor. |
protected void |
initializeControllers()
Initializes all controllers. |
protected void |
processRedeeming()
Issue redeem requests on all reservations scheduled for redeeming on the current cycle |
void |
redeem(ReservationClient reservation)
Issues a redeem request for the given reservation. |
void |
redeem(ReservationSet set)
Issues a redeem request for every reservation in the set. |
void |
reset(java.util.Properties p)
De-serializes the object from the given properties list. |
void |
save(java.util.Properties p)
Serializes the object into the given properties list. |
void |
setLoadSource(ILoadSource source)
Sets the load source. |
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. |
protected void |
tickHandler()
Handles a timer interrupt. |
void |
updateLease(ResourceReservation r,
UpdateData udd,
AuthToken caller)
Handles an incoming lease update. |
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, revisit, 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 |
|---|
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 |
|---|
public static final java.lang.String PropertyLoadSource
protected ILoadSource loadSource
protected PeerRegistry registry
protected boolean initialized
| Constructor Detail |
|---|
public ServiceManager()
public ServiceManager(AuthToken identity,
ActorClock clock)
identity - actor identityclock - clock 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
protected void initializeControllers()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Vector<IController> getControllers()
IServiceManager
getControllers in interface IServiceManager
public void save(java.util.Properties p)
throws java.lang.Exception
ISerialize
save in interface ISerializesave in class Actorp - properties list to serialize the object into
java.lang.Exception
public void reset(java.util.Properties p)
throws java.lang.Exception
ISerialize
reset in interface ISerializereset in class Actorp - properties list containing the serialized version of
the object
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 updateLease(ResourceReservation r,
UpdateData udd,
AuthToken caller)
throws java.lang.Exception
IServiceManagerPublic
updateLease in interface IServiceManagerPublicr - reservation represented by this update. The
reservation object will contain the lease (if any) as well
information about the actually leased resources.udd - status of the remote operation.caller - identity of the caller
java.lang.Exceptionpublic void demand(ReservationClient reservation)
IClientActor
demand in interface IClientActorreservation - reservation representing resource demandpublic void redeem(ReservationSet set)
IServiceManager
redeem in interface IServiceManagerset - set of reservations to redeem
public void redeem(ReservationClient reservation)
throws java.lang.Exception
IServiceManager
redeem in interface IServiceManagerreservation - reservation to be redeemed
java.lang.ExceptionIReservationOperations#register(orca.shirako.kernel.Reservation)
public void extendLease(ReservationClient reservation)
throws java.lang.Exception
IServiceManager
extendLease in interface IServiceManagerreservation - reservation to be redeemed
java.lang.ExceptionIReservationOperations#register(orca.shirako.kernel.Reservation)
public void extendLease(ReservationSet set)
throws java.lang.Exception
IServiceManager
extendLease in interface IServiceManagerset - set of reservations to extend the lease for
java.lang.Exception
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(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(ReservationSet set)
IClientActor
extendTicket in interface IClientActorset - set of reservations to extend tickets for
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
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.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()
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()
protected void processRedeeming()
protected void bid()
throws java.lang.Exception
java.lang.Exceptionpublic void setLoadSource(ILoadSource source)
IServiceManager
setLoadSource in interface IServiceManagersource - load source to setpublic ILoadSource getLoadSource()
IServiceManager
getLoadSource in interface IServiceManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||