Search in sources :

Example 6 with Processor

use of loghub.Processor 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

Processor (loghub.Processor)6 Event (loghub.Event)3 Collection (java.util.Collection)2 Pipeline (loghub.Pipeline)2 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 Reader (java.io.Reader)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 DateTimeException (java.time.DateTimeException)1 ZoneId (java.time.ZoneId)1 ArrayList (java.util.ArrayList)1