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,Set<String>>

public class OsEvaluator
extends Object
implements PersistentEvaluator<OsConstraint,Set<String>>

Evaluator that persists all nodes' Operation Systems

Author:
Alex Snaps

Constructor Summary
OsEvaluator()
           
 
Method Summary
 void initialize(String nName, ConcurrentMap<String,Set<String>> storageSet)
          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.
 List<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 List<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(String nName,
                       ConcurrentMap<String,Set<String>> storageSet)
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,Set<String>>
Parameters:
nName - Local instanceId
storageSet - the shared persistent storage for the Evaluator


Copyright 2001-2013, Terracotta, Inc.