org.quartz.locality
Class LocalityTriggerBuilder

java.lang.Object
  extended by org.quartz.locality.LocalityTriggerBuilder

public class LocalityTriggerBuilder
extends Object

Builder for LocalityAware Triggers, which decorate the Trigger and adds the Locality feature to it, by adding a reference to a NodeSpec.

Usage:

 localTrigger(
     newTrigger()
         .forJob("testJob")
         .withIdentity("trigger1", "group")
         .startAt(new Date(when)))
     .where(
         node()
             .is(partOfNodeGroup("group1")))
     .build();
 

Author:
Alex Snaps

Constructor Summary
LocalityTriggerBuilder(Trigger trigger)
           
LocalityTriggerBuilder(TriggerBuilder triggerBuilder)
           
 
Method Summary
 LocalityTrigger build()
          Method building an immutable LocalityAware Trigger, wrapping the actual Trigger instance If a TriggerBuilder was used at construction time, its build method is invoked
static LocalityTriggerBuilder localTrigger(Trigger trigger)
          Creates a delegating LocalityTriggerBuilder based on the Trigger
static LocalityTriggerBuilder localTrigger(TriggerBuilder triggerBuilder)
          Creates a delegating LocalityTriggerBuilder based on the TriggerBuilder
 LocalityTriggerBuilder where(NodeSpecBuilder specBuilder)
          Setter to the NodeSpecBuilder that will be build at JobDetail build() time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalityTriggerBuilder

public LocalityTriggerBuilder(TriggerBuilder triggerBuilder)

LocalityTriggerBuilder

public LocalityTriggerBuilder(Trigger trigger)
Method Detail

localTrigger

public static LocalityTriggerBuilder localTrigger(TriggerBuilder triggerBuilder)
Creates a delegating LocalityTriggerBuilder based on the TriggerBuilder

Parameters:
triggerBuilder - Wrapped builder
Returns:
A LocalityTriggerBuilder instance

localTrigger

public static LocalityTriggerBuilder localTrigger(Trigger trigger)
Creates a delegating LocalityTriggerBuilder based on the Trigger

Parameters:
trigger - Wrapped trigger
Returns:
A LocalityTriggerBuilder instance

where

public LocalityTriggerBuilder where(NodeSpecBuilder specBuilder)
Setter to the NodeSpecBuilder that will be build at JobDetail build() time

Parameters:
specBuilder - The builder to the node specifications
Returns:
this

build

public LocalityTrigger build()
Method building an immutable LocalityAware Trigger, wrapping the actual Trigger instance If a TriggerBuilder was used at construction time, its build method is invoked

Returns:
the LocalityJobDetail instance


Copyright 2001-2013, Terracotta, Inc.