Package io.siddhi.core.stream
Class StreamJunction
- java.lang.Object
-
- io.siddhi.core.stream.StreamJunction
-
- All Implemented Interfaces:
EventBufferHolder
public class StreamJunction extends Object implements EventBufferHolder
Stream Junction is the place where streams are collected and distributed. There will be an Stream Junction per evey event stream.StreamJunction.Publishercan be used to publish events to the junction andStreamJunction.Receivercan be used to receive events from Stream Junction. Stream Junction will hold the events till they are consumed by registered Receivers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStreamJunction.OnErrorActionDifferent Type of On Error ActionsclassStreamJunction.PublisherInterface to be implemented to send events into the Stream Junction.static interfaceStreamJunction.ReceiverInterface to be implemented by all receivers who need to subscribe to Stream Junction and receive events.
-
Constructor Summary
Constructors Constructor Description StreamJunction(io.siddhi.query.api.definition.StreamDefinition streamDefinition, ExecutorService executorService, int bufferSize, StreamJunction faultStreamJunction, SiddhiAppContext siddhiAppContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamJunction.PublisherconstructPublisher()booleancontainsBufferedEvents()longgetBufferedEvents()io.siddhi.query.api.definition.StreamDefinitiongetStreamDefinition()StringgetStreamId()voidhandleError(long timeStamp, Object[] data, Exception e)voidhandleError(Object event, Exception e)voidsendEvent(ComplexEvent complexEvent)voidsendEvent(Event event)voidstartProcessing()Create and start disruptor based on annotations given in the streamDefinition.voidstopProcessing()voidsubscribe(StreamJunction.Receiver receiver)voidunsubscribe(StreamCallback streamCallback)
-
-
-
Constructor Detail
-
StreamJunction
public StreamJunction(io.siddhi.query.api.definition.StreamDefinition streamDefinition, ExecutorService executorService, int bufferSize, StreamJunction faultStreamJunction, SiddhiAppContext siddhiAppContext)
-
-
Method Detail
-
sendEvent
public void sendEvent(ComplexEvent complexEvent)
-
sendEvent
public void sendEvent(Event event)
-
startProcessing
public void startProcessing()
Create and start disruptor based on annotations given in the streamDefinition.
-
stopProcessing
public void stopProcessing()
-
constructPublisher
public StreamJunction.Publisher constructPublisher()
-
subscribe
public void subscribe(StreamJunction.Receiver receiver)
-
unsubscribe
public void unsubscribe(StreamCallback streamCallback)
-
getStreamId
public String getStreamId()
-
getStreamDefinition
public io.siddhi.query.api.definition.StreamDefinition getStreamDefinition()
-
getBufferedEvents
public long getBufferedEvents()
- Specified by:
getBufferedEventsin interfaceEventBufferHolder
-
containsBufferedEvents
public boolean containsBufferedEvents()
- Specified by:
containsBufferedEventsin interfaceEventBufferHolder
-
-