|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.core.Policy
public class Policy
Base class to simplify policy development.
| Field Summary | |
|---|---|
protected IActor |
actor
Actor this policy belongs to. |
protected ActorClock |
clock
The converter from real to local time |
protected ID |
guid
Policy guid. |
protected LoggingTool |
logger
Logger in use by this mapper. |
static java.lang.String |
PropertyGuid
|
| Constructor Summary | |
|---|---|
Policy()
Default constructor. |
|
Policy(Actor actor)
Creates a new mapper instance. |
|
| Method Summary | |
|---|---|
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 void |
error(java.lang.String string)
|
void |
extend(ResourceReservation reservation,
ResourceSet resources,
Term term)
Notifies the policy that a reservation is about to be extended. |
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. |
ID |
getGuid()
Returns the globally unique identifier of this policy object instance. |
void |
initialize()
Initializes the object. |
protected void |
internalError(java.lang.String string)
|
protected void |
logError(java.lang.String string)
|
protected void |
logWarn(java.lang.String string)
|
void |
prepare(long cycle)
Informs the policy that processing for a new cycle is about to begin. |
java.util.Properties |
query(java.util.Properties properties)
Answers a query from another actor. |
void |
remove(ResourceReservation reservation)
Notifies the policy that a reservation is about to be removed. |
void |
reset()
Post recovery entry point. |
void |
reset(java.util.Properties p)
De-serializes the object from the given properties list. |
void |
revisit(IActor actor,
java.util.Properties properties)
Recovers state of the component using a previously saved properties list and a references to the actor this component belongs to. |
void |
revisit(ResourceReservation reservation)
Informs the mapper about a reservation. |
java.util.Properties |
save()
Serializes the object into a properties list. |
void |
save(java.util.Properties p)
Serializes the object into the given properties list. |
void |
setActor(IActor actor)
Sets the actor the mapper belongs to. |
void |
setLogger(LoggingTool logger)
Sets the logger to be used by the mapper. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PropertyGuid
protected LoggingTool logger
protected IActor actor
protected ActorClock clock
protected ID guid
| Constructor Detail |
|---|
public Policy()
public Policy(Actor actor)
actor - actor this mapper belongs to| Method Detail |
|---|
public void initialize()
throws java.lang.Exception
IInitialize
initialize in interface IInitializejava.lang.Exception
public java.util.Properties save()
throws java.lang.Exception
ISerialize
save in interface ISerializejava.lang.Exception
public void save(java.util.Properties p)
throws java.lang.Exception
ISerialize
save in interface ISerializep - 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 ISerializep - properties list containing the serialized version of
the object
java.lang.Exceptionpublic java.util.Properties query(java.util.Properties properties)
IPolicy
query in interface IPolicypublic void close(ResourceReservation reservation)
IPolicy
close in interface IPolicyreservation - 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 IPolicyreservation - closed reservationIAuthorityPolicy.release(ResourceSet)
public void extend(ResourceReservation reservation,
ResourceSet resources,
Term term)
IPolicy
extend in interface IPolicyreservation - reservation to be extendedresources - resource set used for the extensionterm - term used for the extensionpublic 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 IPolicyreservation - reservation to be removed
public void revisit(ResourceReservation reservation)
throws java.lang.Exception
IPolicy
revisit in interface IPolicyjava.lang.Exception
public void reset()
throws java.lang.Exception
IPolicy
reset in interface IPolicyjava.lang.Exception
public void revisit(IActor actor,
java.util.Properties properties)
throws java.lang.Exception
IRecover
revisit in interface IRecoveractor - actor object the component belongs toproperties - properties list containing configuration data about the
component
java.lang.Exceptionpublic ReservationSet getClosing(long cycle)
IPolicy
getClosing in interface IPolicycycle - the current cyclepublic void prepare(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().
prepare in interface IPolicycycle - the cycle number that is about to be processedpublic 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 IPolicycycle - the cycle number that has just passed
protected void error(java.lang.String string)
throws java.lang.Exception
java.lang.Exception
protected void internalError(java.lang.String string)
throws java.lang.Exception
java.lang.Exceptionprotected void logError(java.lang.String string)
protected void logWarn(java.lang.String string)
public void setActor(IActor actor)
IPolicy
setActor in interface IPolicyactor - the actor the mapper belongs topublic void setLogger(LoggingTool logger)
IPolicy
setLogger in interface IPolicylogger - logger to usepublic ID getGuid()
IPolicy
getGuid in interface IPolicy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||