org.quartz.locality.constraint.evaluator
Class OsEvaluator

java.lang.Object
  extended by org.quartz.locality.constraint.evaluator.OsEvaluator
All Implemented Interfaces:
Evaluator<OsConstraint>, PersistentEvaluator<OsConstraint,java.util.Set<java.lang.String>>

public class OsEvaluator
extends java.lang.Object
implements PersistentEvaluator<OsConstraint,java.util.Set<java.lang.String>>

Evaluator that persists all nodes' Operation Systems

Author:
Alex Snaps

Constructor Summary
OsEvaluator()
           
 
Method Summary
 void initialize(java.lang.String nodeName, java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<java.lang.String>> storage)
          During its bootstrapping, the JobStore will call this method once on each node, passing a Clustered ConcurrentMap instance and the local instanceId of the Scheduler
 boolean matches(OsConstraint constraint)
          Evaluates the constraint against local node.
 java.util.List<java.lang.String> suitedNodes(OsConstraint constraint)
          Returns a list of best suited node (instanceId) based on the constraint
 void verify(OsConstraint constraint)
          Verifies the validity of a constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsEvaluator

public OsEvaluator()
Method Detail

matches

public boolean matches(OsConstraint constraint)
Evaluates the constraint against local node.

Specified by:
matches in interface Evaluator<OsConstraint>
Parameters:
constraint - The constraint to evaluate
Returns:
true if local node is a match
See Also:
Constraint#matches(Object)

suitedNodes

public java.util.List<java.lang.String> suitedNodes(OsConstraint constraint)
Returns a list of best suited node (instanceId) based on the constraint

Specified by:
suitedNodes in interface Evaluator<OsConstraint>
Parameters:
constraint - To find best suited nodes for
Returns:
List of best suited Quartz instanceId

verify

public void verify(OsConstraint constraint)
Verifies the validity of a constraint. Throws exception should the constraint fail to validate.

Specified by:
verify in interface Evaluator<OsConstraint>
Parameters:
constraint - The constraint to validate

initialize

public void initialize(java.lang.String nodeName,
                       java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<java.lang.String>> storage)
During its bootstrapping, the JobStore will call this method once on each node, passing a Clustered ConcurrentMap instance and the local instanceId of the Scheduler

Specified by:
initialize in interface PersistentEvaluator<OsConstraint,java.util.Set<java.lang.String>>
Parameters:
nodeName - Local instanceId
storage - the shared persistent storage for the Evaluator


Copyright 2001-2011, Terracotta, Inc.