public class InMemorySource extends Source
Source to receive events through in-memory transport.Source.ConnectionCallback| Constructor and Description |
|---|
InMemorySource() |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(Source.ConnectionCallback connectionCallback)
Called to connect to the source backend for receiving events
|
Map<String,Object> |
currentState()
Used to collect the serializable state of the processing element, that need to be
persisted for the reconstructing the element to the same state on a different point of time
|
void |
destroy()
Called at the end to clean all the resources consumed
|
void |
disconnect()
Called to disconnect from the source backend, or when ConnectionUnavailableException is thrown
|
Class[] |
getOutputEventClasses()
Get produced event class types
|
void |
init(SourceEventListener sourceEventListener,
OptionHolder optionHolder,
String[] requestedTransportPropertyNames,
ConfigReader configReader,
SiddhiAppContext siddhiAppContext)
To initialize the source.
|
void |
pause()
Called to pause event consumption
|
void |
restoreState(Map<String,Object> state)
Used to restore serialized state of the processing element, for reconstructing
the element to the same state as if was on a previous point of time.
|
void |
resume()
Called to resume event consumption
|
connectWithRetry, getElementId, getMapper, getStreamDefinition, getType, init, shutdownpublic void init(SourceEventListener sourceEventListener, OptionHolder optionHolder, String[] requestedTransportPropertyNames, ConfigReader configReader, SiddhiAppContext siddhiAppContext)
Sourceinit in class SourcesourceEventListener - The listener to pass the events for processing which are consumed
by the sourceoptionHolder - Contains static options of the sourcerequestedTransportPropertyNames - Requested transport properties that should be passed to
SourceEventListenerconfigReader - System configuration reader for sourcesiddhiAppContext - Siddhi application contextpublic Class[] getOutputEventClasses()
SourcegetOutputEventClasses in class Sourcepublic void connect(Source.ConnectionCallback connectionCallback) throws ConnectionUnavailableException
Sourceconnect in class SourceconnectionCallback - Callback to pass the ConnectionUnavailableException for connection failure after
initial successful connectionConnectionUnavailableException - if it cannot connect to the source backendpublic void disconnect()
Sourcedisconnect in class Sourcepublic void destroy()
Sourcepublic void pause()
Sourcepublic void resume()
Sourcepublic Map<String,Object> currentState()
Snapshotablepublic void restoreState(Map<String,Object> state)
Snapshotablestate - the stateful objects of the element as an array on
the same order provided by currentState().Copyright © 2019 WSO2. All rights reserved.