Package ca.uqac.lif.cep.json
Class JsonLineFeeder
java.lang.Object
ca.uqac.lif.cep.Processor
ca.uqac.lif.cep.SynchronousProcessor
ca.uqac.lif.cep.tmf.Source
ca.uqac.lif.cep.json.JsonLineFeeder
- All Implemented Interfaces:
ca.uqac.lif.cep.Contextualizable,ca.uqac.lif.cep.Duplicable,ca.uqac.lif.cep.DuplicableProcessor
public class JsonLineFeeder
extends ca.uqac.lif.cep.tmf.Source
A source of JSON events taking its data from a JSON file. To facilitate
parsing, the source expects one complete JSON snippet per text line.
- Since:
- 0.8
- Author:
- Sylvain Hallé
-
Nested Class Summary
Nested classes/interfaces inherited from class ca.uqac.lif.cep.SynchronousProcessor
ca.uqac.lif.cep.SynchronousProcessor.InputPushable, ca.uqac.lif.cep.SynchronousProcessor.OutputPullableNested classes/interfaces inherited from class ca.uqac.lif.cep.Processor
ca.uqac.lif.cep.Processor.InternalProcessorState -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final InputStreamThe input stream to read JSON content from.protected final ScannerThe scanner pulling lines from the input stream.protected static final ca.uqac.lif.json.JsonParserThe parser used to parse the elements.Fields inherited from class ca.uqac.lif.cep.SynchronousProcessor
m_inputPushables, m_outputPullables, m_tempQueueFields inherited from class ca.uqac.lif.cep.Processor
m_context, m_hasBeenNotifiedOfEndOfTrace, m_inputArity, m_inputPullables, m_inputQueues, m_notifiedEndOfTraceDownstream, m_outputArity, m_outputPushables, m_outputQueues, MAX_PULL_RETRIES, s_versionString -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the source, by providing an input stream to read text from. -
Method Summary
Methods inherited from class ca.uqac.lif.cep.tmf.Source
pushMethods inherited from class ca.uqac.lif.cep.SynchronousProcessor
getPullableOutput, getPushableInputMethods inherited from class ca.uqac.lif.cep.Processor
allNotifiedEndOfTrace, allNull, copyInputQueue, copyOutputQueue, duplicate, duplicateInto, equals, getAt, getContext, getContext, getEmptyQueue, getId, getInputArity, getInputQueue, getInputType, getInputTypesFor, getOutputArity, getOutputQueue, getOutputType, getPullableInput, getPullableOutput, getPushableInput, getPushableOutput, hashCode, leftShift, newContext, onEndOfTrace, or, or, or, printState, readState, reset, rightShift, setContext, setContext, setPullableInput, setPushableOutput, start, startAll, stopAll
-
Field Details
-
s_parser
protected static final ca.uqac.lif.json.JsonParser s_parserThe parser used to parse the elements. All instances of the processor share the same parser. -
m_is
The input stream to read JSON content from. -
m_scanner
The scanner pulling lines from the input stream.
-
-
Constructor Details
-
JsonLineFeeder
Creates a new instance of the source, by providing an input stream to read text from.- Parameters:
is- The input stream
-
-
Method Details
-
compute
- Specified by:
computein classca.uqac.lif.cep.SynchronousProcessor
-
duplicate
- Specified by:
duplicatein interfaceca.uqac.lif.cep.Duplicable- Specified by:
duplicatein classca.uqac.lif.cep.Processor
-
stop
public void stop()- Overrides:
stopin classca.uqac.lif.cep.Processor
-