Package org.jppf.node.policy
Class PolicyContext
java.lang.Object
org.jppf.node.policy.PolicyContext
Instances of this class provide contextual information to execution policies.
It contains information on the job, if any, against which the policy is evaluated, and on the server for server-side policies.
- Since:
- 5.0
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionPolicyContext(JobSLA sla, JobClientSLA clientSLA, JobMetadata metadata, int jobDispatches, JPPFStatistics stats) Initialize this policy context. -
Method Summary
Modifier and TypeMethodDescriptionGet the job client side SLA, set at runtime by the server.intGet the number of nodes the job is already dispatched to.Get the job metadata, set at runtime by the server.getSLA()Get the job server side SLA, set at runtime by the server.getStats()Get the server statistics.
-
Constructor Details
-
PolicyContext
public PolicyContext(JobSLA sla, JobClientSLA clientSLA, JobMetadata metadata, int jobDispatches, JPPFStatistics stats) Initialize this policy context.- Parameters:
sla- the job server side SLA, set at runtime by the server.clientSLA- the job client side SLA, set at runtime by the server.metadata- the job metadata, set at runtime by the server.jobDispatches- the number of nodes the job is already dispatched to.stats- the server statistics.
-
-
Method Details
-
getSLA
Get the job server side SLA, set at runtime by the server.- Returns:
- a
JobSLAobject.
-
getClientSLA
Get the job client side SLA, set at runtime by the server.- Returns:
- a
JobClientSLAobject.
-
getMetadata
Get the job metadata, set at runtime by the server.- Returns:
- a
JobMetadataobject.
-
getJobDispatches
public int getJobDispatches()Get the number of nodes the job is already dispatched to.- Returns:
- the number of nodes as an int.
-
getStats
Get the server statistics.- Returns:
- a
JPPFStatisticsobject.
-