org.jppf.node.policy
Class ExecutionPolicy

java.lang.Object
  extended by org.jppf.node.policy.ExecutionPolicy
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AtLeast, AtMost, BetweenEE, BetweenEI, BetweenIE, BetweenII, Contains, CustomPolicy, Equal, ExecutionPolicy.LogicalRule, ExecutionPolicy.NotRule, LessThan, MoreThan, OneOf, PolicyRuleTest, RegExp

public abstract class ExecutionPolicy
extends Object
implements Serializable

Interface for all execution policy implementations.

Author:
Laurent Cohen
See Also:
Serialized Form

Nested Class Summary
static class ExecutionPolicy.AndRule
          An execution policy that realizes a logical "AND" combination of multiple policies specified as operands.
static class ExecutionPolicy.LogicalRule
          An execution policy that realizes a binary logical combination of the policies specified as operands.
static class ExecutionPolicy.NotRule
          An execution policy that realizes the negation of a policy specified as operand.
static class ExecutionPolicy.OrRule
          An execution policy that realizes a logical "OR" combination of multiple policies specified as operands.
static class ExecutionPolicy.XorRule
          An execution policy that realizes a logical "XOR" combination of multiple policies specified as operands.
 
Field Summary
protected  String computedToString
          Stores the XML representation of this object.
 
Constructor Summary
ExecutionPolicy()
           
 
Method Summary
abstract  boolean accepts(JPPFSystemInformation info)
          Determines whether this policy accepts the specified node.
 ExecutionPolicy and(ExecutionPolicy... rules)
          Create an execution policy that is a logical "AND" combination of this policy and the one specified as operand.
 String getProperty(JPPFSystemInformation info, String name)
          Get the value of the specified property in the specified set of system information.
protected static String indent()
          Get an indented string.
 ExecutionPolicy not()
          Create an execution policy that is a negation of this policy.
 ExecutionPolicy or(ExecutionPolicy... rules)
          Create an execution policy that is a logical "OR" combination of this policy and those specified as operands.
 ExecutionPolicy xor(ExecutionPolicy... rules)
          Create an execution policy that is a logical "XOR" combination of the 2 policies specified as operands.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

computedToString

protected String computedToString
Stores the XML representation of this object. Used to avoid doing it more than once.

Constructor Detail

ExecutionPolicy

public ExecutionPolicy()
Method Detail

accepts

public abstract boolean accepts(JPPFSystemInformation info)
Determines whether this policy accepts the specified node.

Parameters:
info - system information for the node on which the tasks will run if accepted.
Returns:
true if the node is accepted, false otherwise.

and

public ExecutionPolicy and(ExecutionPolicy... rules)
Create an execution policy that is a logical "AND" combination of this policy and the one specified as operand.

Parameters:
rules - rules to combine this one with.
Returns:
an execution policy that combines the this policy with the operand in an "AND" operation.

or

public ExecutionPolicy or(ExecutionPolicy... rules)
Create an execution policy that is a logical "OR" combination of this policy and those specified as operands.

Parameters:
rules - rules to combine this one with.
Returns:
an execution policy that combines the this policy with the operand in an "OR" operation.

xor

public ExecutionPolicy xor(ExecutionPolicy... rules)
Create an execution policy that is a logical "XOR" combination of the 2 policies specified as operands.

Parameters:
rules - rules to combine this one with.
Returns:
an execution policy that combines the this policy with the operand in an "XOR" operation.

not

public ExecutionPolicy not()
Create an execution policy that is a negation of this policy.

Returns:
an execution policy that negates this policy.

getProperty

public String getProperty(JPPFSystemInformation info,
                          String name)
Get the value of the specified property in the specified set of system information.

Parameters:
info - the system information in which to lookup the property.
name - the name of the proeprty to look for.
Returns:
the value of the property, or null if it could not be found.

indent

protected static String indent()
Get an indented string.

Returns:
an indented string depending on the value of toStringIndent.


Copyright © 2005-2010 JPPF Team.