com.emarsys.ecommon.time.schedule
Class ChainFactory<T>

java.lang.Object
  extended by com.emarsys.ecommon.time.schedule.ChainFactory<T>
Type Parameters:
T -

public class ChainFactory<T>
extends java.lang.Object

A factory for QueueSchedulingStrategyChains.

Author:
Michael "kULO" Kulovits


Field Summary
protected  java.util.List<ChainElement<T>> chain
           
static org.apache.commons.collections.Predicate DEFAULT_FIRE
           
static org.apache.commons.collections.Predicate DEFAULT_PROCEED
           
protected  org.apache.commons.collections.Predicate defaultFire
           
protected  org.apache.commons.collections.Predicate defaultProceed
           
 
Constructor Summary
ChainFactory(java.util.List<ChainElement<T>> elements)
          Creates a new ChainFactory instance that is already initialized with the passed elements.
ChainFactory(QueueSchedulingStrategy<T> strategy)
          Creates a new "empty" ChainFactory instance capable of creating QueueSchedulingStrategyChains for the passed concrete strategy instance.
ChainFactory(SchedulableQueueElement<T> concreteSchedulable)
          Creates a new "empty" ChainFactory instance capable of creating QueueSchedulingStrategyChains for the passed concrete schedulable instance.
 
Method Summary
 ChainFactory<T> add(org.apache.commons.collections.Predicate fire, QueueSchedulingStrategy<T> strategy)
           
 ChainFactory<T> add(org.apache.commons.collections.Predicate fire, QueueSchedulingStrategy<T> strategy, org.apache.commons.collections.Predicate proceed)
           
 ChainFactory<T> add(QueueSchedulingStrategy<T> strategy)
           
 ChainFactory<T> add(QueueSchedulingStrategy<T> strategy, org.apache.commons.collections.Predicate proceed)
           
 java.util.List<ChainElement<T>> getChain()
           
 QueueSchedulingStrategyChain<T> getStrategyChainInstance()
           
 ChainFactory<T> setDefaultFire(org.apache.commons.collections.Predicate defaultFire)
           
 ChainFactory<T> setDefaultProceed(org.apache.commons.collections.Predicate defaultProceed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FIRE

public static org.apache.commons.collections.Predicate DEFAULT_FIRE

DEFAULT_PROCEED

public static org.apache.commons.collections.Predicate DEFAULT_PROCEED

chain

protected java.util.List<ChainElement<T>> chain

defaultFire

protected org.apache.commons.collections.Predicate defaultFire

defaultProceed

protected org.apache.commons.collections.Predicate defaultProceed
Constructor Detail

ChainFactory

public ChainFactory(QueueSchedulingStrategy<T> strategy)
Creates a new "empty" ChainFactory instance capable of creating QueueSchedulingStrategyChains for the passed concrete strategy instance.

Parameters:
strategy - - a concrete strategy, just to bind the type parameter and enable type safety.

ChainFactory

public ChainFactory(SchedulableQueueElement<T> concreteSchedulable)
Creates a new "empty" ChainFactory instance capable of creating QueueSchedulingStrategyChains for the passed concrete schedulable instance.

Parameters:
concreteSchedulable - - the concrete schedulable, see GenericAdapter.getConcreteInstance() just to bind the type parameter and enable type safety.

ChainFactory

public ChainFactory(java.util.List<ChainElement<T>> elements)
Creates a new ChainFactory instance that is already initialized with the passed elements.

Parameters:
elements -
Method Detail

getStrategyChainInstance

public QueueSchedulingStrategyChain<T> getStrategyChainInstance()
Returns:

setDefaultFire

public ChainFactory<T> setDefaultFire(org.apache.commons.collections.Predicate defaultFire)
Parameters:
defaultFire -
Returns:

setDefaultProceed

public ChainFactory<T> setDefaultProceed(org.apache.commons.collections.Predicate defaultProceed)
Parameters:
defaultProceed -
Returns:

add

public ChainFactory<T> add(QueueSchedulingStrategy<T> strategy)
Parameters:
fire -
strategy -
Returns:

add

public ChainFactory<T> add(org.apache.commons.collections.Predicate fire,
                           QueueSchedulingStrategy<T> strategy)
Parameters:
fire -
strategy -
Returns:

add

public ChainFactory<T> add(QueueSchedulingStrategy<T> strategy,
                           org.apache.commons.collections.Predicate proceed)
Parameters:
fire -
strategy -
Returns:

add

public ChainFactory<T> add(org.apache.commons.collections.Predicate fire,
                           QueueSchedulingStrategy<T> strategy,
                           org.apache.commons.collections.Predicate proceed)
Parameters:
fire -
strategy -
Returns:

getChain

public java.util.List<ChainElement<T>> getChain()
Returns:


Copyright © 2010 emarsys AG. All Rights Reserved.