Search in sources :

Example 1 with Fork

use of com.nextdoor.bender.operation.fork.ForkOperationConfig.Fork in project bender by Nextdoor.

the class ForkOperationFactory method setConf.

@Override
public void setConf(AbstractConfig config) {
    this.config = (ForkOperationConfig) config;
    List<List<OperationProcessor>> processors = new ArrayList<List<OperationProcessor>>();
    OperationFactoryFactory off = new OperationFactoryFactory();
    for (Fork fork : this.config.getForks()) {
        List<OperationProcessor> processorsInFork = new ArrayList<OperationProcessor>();
        for (OperationConfig opConfig : fork.getOperations()) {
            try {
                processorsInFork.add(new OperationProcessor(off.getFactory(opConfig)));
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(e);
            }
        }
        processors.add(processorsInFork);
    }
    this.processors = processors;
}
Also used : Fork(com.nextdoor.bender.operation.fork.ForkOperationConfig.Fork) ArrayList(java.util.ArrayList) OperationConfig(com.nextdoor.bender.operation.OperationConfig) List(java.util.List) ArrayList(java.util.ArrayList) OperationProcessor(com.nextdoor.bender.operation.OperationProcessor) OperationFactoryFactory(com.nextdoor.bender.operation.OperationFactoryFactory)

Aggregations

OperationConfig (com.nextdoor.bender.operation.OperationConfig)1 OperationFactoryFactory (com.nextdoor.bender.operation.OperationFactoryFactory)1 OperationProcessor (com.nextdoor.bender.operation.OperationProcessor)1 Fork (com.nextdoor.bender.operation.fork.ForkOperationConfig.Fork)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1