Search in sources :

Example 1 with NamedSubPipeline

use of loghub.processors.NamedSubPipeline in project LogHub by fbacchella.

the class Configuration method getProcessor.

private Processor getProcessor(ConfigListener.Pipenode i, String currentPipeLineName, int depth, AtomicInteger subPipeLine) throws ConfigException {
    Processor t;
    if (i instanceof ConfigListener.PipeRef) {
        ConfigListener.PipeRef cpr = (ConfigListener.PipeRef) i;
        NamedSubPipeline pr = new NamedSubPipeline();
        pr.setPipeRef(cpr.pipename);
        t = pr;
    } else if (i instanceof ConfigListener.PipenodesList) {
        subPipeLine.incrementAndGet();
        AnonymousSubPipeline subpipe = new AnonymousSubPipeline();
        Pipeline p = parsePipeline((ConfigListener.PipenodesList) i, currentPipeLineName, depth + 1, subPipeLine);
        subpipe.setPipeline(p);
        t = subpipe;
    } else if (i instanceof ConfigListener.ProcessorInstance) {
        ConfigListener.ProcessorInstance ti = (ConfigListener.ProcessorInstance) i;
        t = (Processor) parseObjectDescription(ti, emptyConstructor, currentPipeLineName, depth, subPipeLine);
    } else {
        throw new RuntimeException("Unreachable code for " + i);
    }
    return t;
}
Also used : Processor(loghub.Processor) NamedSubPipeline(loghub.processors.NamedSubPipeline) AnonymousSubPipeline(loghub.processors.AnonymousSubPipeline) Pipeline(loghub.Pipeline) NamedSubPipeline(loghub.processors.NamedSubPipeline) AnonymousSubPipeline(loghub.processors.AnonymousSubPipeline)

Aggregations

Pipeline (loghub.Pipeline)1 Processor (loghub.Processor)1 AnonymousSubPipeline (loghub.processors.AnonymousSubPipeline)1 NamedSubPipeline (loghub.processors.NamedSubPipeline)1