|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.kernel.Reservation
orca.shirako.kernel.ResourceReservation
orca.shirako.kernel.ReservationServer
public class ReservationServer
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class orca.shirako.kernel.Reservation |
|---|
Reservation.CountHelper |
| Field Summary | |
|---|---|
protected ICallbackProxy |
callback
Callback proxy. |
protected AuthToken |
client
Identity of the client actor. |
protected AuthToken |
owner
Identity of the server actor. |
protected IPolicy |
policy
Policy in control of the reservation. |
protected long |
processTime
The cycle in which this reservation is scheduled for processing. |
static java.lang.String |
PropertyCallback
|
static java.lang.String |
PropertyClient
|
static java.lang.String |
PropertyOwner
|
static java.lang.String |
PropertyProcessTime
|
static java.lang.String |
PropertySequenceNumberIn
|
static java.lang.String |
PropertySequenceNumberOut
|
static java.lang.String |
PropertyServicePending
|
static java.lang.String |
PropertyUpdateCount
|
static java.lang.String |
PropertyUpdateData
|
protected int |
sequenceIn
Sequence number for incoming messages. |
protected int |
sequenceOut
Sequence number for outgoing messages. |
protected int |
servicePending
Scratch element to trigger post-actions on a probe. |
protected UpdateData |
udd
Status of the last server-side operation for the reservation. |
protected int |
updateCount
How many update messages have been sent to the client. |
| Fields inherited from class orca.shirako.kernel.ResourceReservation |
|---|
approved, approvedResources, approvedTerm, bidPending, ElasticSize, ElasticTime, previousResources, previousTerm, PropertyApprovedResources, PropertyApprovedTerm, PropertyBidPending, PropertyPreviousTerm, PropertyRenewable, PropertyRequestedResources, PropertyRequestedTerm, PropertyResources, PropertyTerm, renewable, requestedResources, requestedTerm, resources, term |
| Fields inherited from class orca.shirako.kernel.Reservation |
|---|
actor, category, closeTime, dirty, errMsg, expired, extended, from, guard, listeners, logger, pending, PropertyCategory, PropertyCloseTime, PropertyExtended, PropertyGuard, PropertyPending, PropertySlice, PropertySliceID, PropertyState, rid, slice, sliceID, slicename, state, stateTransition |
| Fields inherited from interface orca.shirako.api.IReservation |
|---|
CategoryAll, CategoryAuthority, CategoryBroker, CategoryClient, PropertyClass, PropertyID |
| Constructor Summary | |
|---|---|
protected |
ReservationServer()
Creates a new blank reservation instance. |
protected |
ReservationServer(ReservationID rid,
ResourceSet resources,
Term term,
Slice slice)
Creates a new reservation instance to represent a server-side request for resources. |
protected |
ReservationServer(ResourceSet resources,
Term term,
Slice slice)
Creates a new reservation instance to represent a server-side request for resources. |
| Method Summary | |
|---|---|
protected void |
clearNotice()
Clears all event notices associated with the reservation. |
protected Reservation.CountHelper |
count(java.util.Date when)
|
void |
count(ResourceCount rc,
java.util.Date when)
Tallies up resources in the reservation. |
void |
fail(java.lang.String message)
Marks an operation failure. |
void |
fail(java.lang.String message,
java.lang.Exception e)
Marks an operation failure. |
protected void |
failNotify(java.lang.String message)
Reports an operation failure and notifies the client. |
void |
failWarn(java.lang.String message)
Marks an operation failure. |
int |
forecastUnits(java.util.Date when)
Estimate the resource units controlled by this reservation at some time which may be in the future. |
protected void |
generateUpdate()
Generates an update to the callback object (if any) for this reservation. |
ICallbackProxy |
getCallback()
Returns the callback proxy. |
AuthToken |
getClientAuthToken()
Returns the identity of the client represented by the reservation. |
long |
getProcessTime()
Returns the time the reservation is going to be processed. |
int |
getSequenceIn()
Returns the sequence number of the last received message. |
int |
getSequenceOut()
Returns the sequence number of the last sent message. |
AuthToken |
getServerAuthToken()
Returns the identity of the server actor that controls the reservation. |
ResourceType |
getType()
Returns the resource type allocated to the reservation. |
protected void |
incomingRequest()
Checks reservation state prior to handling an incoming request. |
protected void |
prepare(ICallbackProxy srt,
LoggingTool logger)
Prepare |
void |
probe()
Probes a reservation and sync with resource status and client (server only). |
void |
reset(java.util.Properties p)
De-serializes the object from the given properties list. |
void |
revisit(IActor actor,
java.util.Properties p)
Recovers state of the component using a previously saved properties list and a references to the actor this component belongs to. |
void |
save(java.util.Properties p)
Serializes the object into the given properties list. |
void |
setOwner(AuthToken owner)
Sets the identity of the server actor that controls the reservation. |
void |
setProcessTime(long time)
Sets the time the reservation is going to be processed. |
void |
setSequenceIn(int sequence)
Sets the sequence number of the last received message. |
protected void |
setServicePending(int pending)
sets the type of pending operation that is in progress for the reservation. |
protected void |
updateLease(ResourceReservation rarg,
UpdateData udd)
Update the lease |
protected void |
updateTicket(ResourceReservation rarg,
UpdateData udd)
Update the ticket |
protected void |
validateIncoming()
Validates a reservation as it arrives to an actor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface orca.shirako.api.IResourceReservation |
|---|
getApprovedResources, getApprovedTerm, getApprovedType, getApprovedUnits, getLeasedAbstractUnits, getLeasedUnits, getPreviousResources, getPreviousTerm, getRequestedResources, getRequestedTerm, getRequestedType, getRequestedUnits, getResources, getTerm, getUnits, holding, isApproved, isBidPending, isRenewable, setApproved, setApproved, setApprovedResources, setApprovedTerm, setBidPending |
| Methods inherited from interface orca.shirako.api.IReservation |
|---|
awaitActive, awaitClosed, awaitTicketed, clearDirty, getActor, getCategory, getCloseTime, getPendingState, getPendingStateName, getPreviousReservationState, getReservationID, getReservationState, getSlice, getState, getStateName, hasUncommittedTransition, isDirty, registerListener, setCloseTime, setDirty, setSlice, unregisterListener |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
save |
| Methods inherited from interface orca.shirako.api.IReservationStatus |
|---|
isActive, isActiveTicketed, isClosed, isClosing, isExpired, isExpired, isExtended, isExtendingLease, isExtendingTicket, isFailed, isNascent, isNoPending, isPriming, isRedeeming, isTerminal, isTicketed, isTicketing, setExpired |
| Field Detail |
|---|
public static final java.lang.String PropertyCallback
public static final java.lang.String PropertyOwner
public static final java.lang.String PropertyClient
public static final java.lang.String PropertyUpdateData
public static final java.lang.String PropertyUpdateCount
public static final java.lang.String PropertyServicePending
public static final java.lang.String PropertySequenceNumberIn
public static final java.lang.String PropertySequenceNumberOut
public static final java.lang.String PropertyProcessTime
protected int sequenceIn
protected int sequenceOut
protected ICallbackProxy callback
protected UpdateData udd
protected int updateCount
protected int servicePending
protected AuthToken owner
protected AuthToken client
protected long processTime
protected IPolicy policy
| Constructor Detail |
|---|
protected ReservationServer()
protected ReservationServer(ResourceSet resources,
Term term,
Slice slice)
This method will generate a new reservation identifier.
resources - requested resourcesterm - requested termslice - slice for the reservation
protected ReservationServer(ReservationID rid,
ResourceSet resources,
Term term,
Slice slice)
rid - reservation identifierresources - requested resourcesterm - requested termslice - slice for the reservation| Method Detail |
|---|
public void save(java.util.Properties p)
throws java.lang.Exception
ISerialize
save in interface ISerializesave in class ResourceReservationp - 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 ResourceReservationp - properties list containing the serialized version of
the object
java.lang.Exception
public void revisit(IActor actor,
java.util.Properties p)
throws java.lang.Exception
IRecover
revisit in interface IRecoverrevisit in class ResourceReservationactor - actor object the component belongs top - properties list containing configuration data about the
component
java.lang.Exception
protected void validateIncoming()
throws java.lang.Exception
Reservation
validateIncoming in class Reservationjava.lang.Exceptionprotected void generateUpdate()
udd - status informationpublic void fail(java.lang.String message)
fail in interface IResourceReservationfail in class ResourceReservationmessage - the error message
public void fail(java.lang.String message,
java.lang.Exception e)
IResourceReservation
fail in interface IResourceReservationfail in class ResourceReservationmessage - the error messagee - The exceptionpublic void failWarn(java.lang.String message)
IResourceReservation
failWarn in interface IResourceReservationfailWarn in class ResourceReservationmessage - the error messageprotected void failNotify(java.lang.String message)
message - the error message
public void probe()
throws java.lang.Exception
probe in class Reservationjava.lang.Exception
protected void prepare(ICallbackProxy srt,
LoggingTool logger)
throws java.lang.Exception
srt - the slices returnlogger - for diagnostic logging
java.lang.Exception
protected void incomingRequest()
throws java.lang.Exception
java.lang.Exception
protected void updateTicket(ResourceReservation rarg,
UpdateData udd)
throws java.lang.Exception
updateTicket in class Reservationrarg - the reservationudd - the update data
java.lang.Exception - thrown when method is called
protected void updateLease(ResourceReservation rarg,
UpdateData udd)
throws java.lang.Exception
updateLease in class Reservationrarg - the reservationudd - the update data
java.lang.Exception - thrown when method is calledpublic int forecastUnits(java.util.Date when)
forecastUnits in interface IResourceReservationforecastUnits in class ResourceReservationthen - the date to forecast
public void count(ResourceCount rc,
java.util.Date when)
IResourceReservationNote: "just a hint" unless the kernel lock is held. An exception to our rule of not touching ResourceSet fields. Determines count based on time.
count in interface IResourceReservationcount in class ResourceReservationprotected Reservation.CountHelper count(java.util.Date when)
protected void clearNotice()
Reservation
clearNotice in class Reservationpublic void setOwner(AuthToken owner)
IServerReservation
setOwner in interface IServerReservationowner - identity of server actorpublic AuthToken getServerAuthToken()
IServerReservation
getServerAuthToken in interface IServerReservationpublic AuthToken getClientAuthToken()
IServerReservation
getClientAuthToken in interface IServerReservationpublic ICallbackProxy getCallback()
IServerReservation
getCallback in interface IServerReservationpublic int getSequenceIn()
IServerReservation
getSequenceIn in interface IServerReservationpublic void setSequenceIn(int sequence)
IServerReservation
setSequenceIn in interface IServerReservationpublic int getSequenceOut()
IServerReservation
getSequenceOut in interface IServerReservationprotected void setServicePending(int pending)
pending - operation type codepublic ResourceType getType()
IResourceReservation
getType in interface IResourceReservationgetType in class ResourceReservationpublic long getProcessTime()
IServerReservation
getProcessTime in interface IServerReservationpublic void setProcessTime(long time)
IServerReservation
setProcessTime in interface IServerReservationtime - time the reservation is going to be processed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||