/** * @see stream.DataProcessor#init(stream.Context) */ @Override public void init(ProcessContext context) throws Exception { super.init(context); this.context = context; for (Processor p : processors) { if (p instanceof StatefulProcessor) { ((StatefulProcessor) p).init(context); } } }
/** * @see stream.DataProcessor#init(stream.Context) */ @Override public void init(ProcessContext context) throws Exception { super.init(context); this.context = context; for (Processor p : processors) { if (p instanceof StatefulProcessor) { ((StatefulProcessor) p).init(context); } } }
/** * @see stream.DataProcessor#init(stream.runtime.Context) */ public void init(Context context) throws Exception { parentContext = context; processContext = new ProcessContextImpl(context); for (Processor proc : processors) { if (proc instanceof StatefulProcessor) { ((StatefulProcessor) proc).init(processContext); } } log.debug("Process {} (source: {}) initialized, processors: ", this, getInput()); }
/** * @see stream.data.AbstractProcessor#init(stream.Context) */ @Override public void init(ProcessContext ctx) throws Exception { super.init(ctx); this.script = loadScript(); try { this.initScript(); if (impl != null && (impl instanceof StatefulProcessor)) { try { ((StatefulProcessor) impl).init(ctx); } catch (NoSuchMethodException nsm) { log.warn("No init() function defined in JavaScript."); } catch (Exception e) { e.printStackTrace(); } } } catch (Exception e) { log.error("Error while initializing script: {}", e.getMessage()); if (log.isDebugEnabled()) e.printStackTrace(); } }
/** * @see stream.AbstractProcessor#init(stream.Context) */ @Override public void init(ProcessContext ctx) throws Exception { super.init(ctx); this.script = loadScript(); try { this.initScript(); if (impl != null && (impl instanceof StatefulProcessor)) { try { ((StatefulProcessor) impl).init(ctx); } catch (NoSuchMethodException nsm) { log.warn("No init() function defined in JavaScript."); } catch (Exception e) { e.printStackTrace(); } } } catch (Exception e) { log.error("Error while initializing script: {}", e.getMessage()); if (log.isDebugEnabled()) e.printStackTrace(); } }
/** * @see Process#init(ApplicationContext) */ public void init(ApplicationContext context) throws Exception { parentContext = context; processContext = new ProcessContextImpl(this.getId(), context); for (Processor proc : processors) { if (proc instanceof StatefulProcessor) ((StatefulProcessor) proc).init(processContext); } log.debug("Process {} (source: {}) initialized, processors: ", this, getInput()); }
public IronBeeAuditReader(InputStream in) throws IOException { inputStream = new BufferedInputStream(in); processors.add(new IronBeeHttpHeaderParser("http-request-headers", "HTTP_REQUEST_HEADERS", "REQUEST_LINE")); processors.add(new IronBeeHttpHeaderParser("http-response-headers", "HTTP_RESPONSE_HEADERS", "RESPONSE_LINE")); processors.add(new IronBeeJSONProcessor()); processors.add(new Timestamp("DATE", "yyyy-mm-dd'T'hh:mm:ss.SZ", "REQUEST_TIMESTAMP")); processors.add(new Timestamp("RECEIVED", "yyyy-mm-dd'T'hh:mm:ss.SZ", "LOG_TIMESTAMP")); final ProcessContext ctx = new ProcessContextImpl(); for (Processor p : processors) { try { if (p instanceof StatefulProcessor) ((StatefulProcessor) p).init(ctx); } catch (Exception e) { throw new IOException( "Failed to initialize processor for IronBeeAuditReader: " + e.getMessage()); } } stream.setContentHandler(handler); }