Package org.wso2.siddhi.sample.util
Class CustomFunctionExtension
java.lang.Object
org.wso2.siddhi.core.executor.function.FunctionExecutor
org.wso2.siddhi.sample.util.CustomFunctionExtension
- All Implemented Interfaces:
org.wso2.siddhi.core.executor.ExpressionExecutor,org.wso2.siddhi.core.util.extension.holder.EternalReferencedHolder,org.wso2.siddhi.core.util.snapshot.Snapshotable
public class CustomFunctionExtension
extends org.wso2.siddhi.core.executor.function.FunctionExecutor
-
Field Summary
Fields inherited from class org.wso2.siddhi.core.executor.function.FunctionExecutor
attributeExpressionExecutors, elementId, executionPlanContext, queryName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[]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 timeprotected ObjectThe main execution method which will be called upon event arrival when there are zero or one function parameterprotected ObjectThe main execution method which will be called upon event arrival when there are more then one function parameterorg.wso2.siddhi.query.api.definition.Attribute.Typeprotected voidinit(org.wso2.siddhi.core.executor.ExpressionExecutor[] attributeExpressionExecutors, org.wso2.siddhi.core.config.ExecutionPlanContext executionPlanContext) The initialization method for FunctionExecutor, this method will be called before the other methodsvoidrestoreState(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.voidstart()This will be called only once and this can be used to acquire required resources for the processing element.voidstop()This will be called only once and this can be used to release the acquired resources for processing.Methods inherited from class org.wso2.siddhi.core.executor.function.FunctionExecutor
cloneExecutor, execute, getElementId, initExecutor
-
Constructor Details
-
CustomFunctionExtension
public CustomFunctionExtension()
-
-
Method Details
-
init
protected void init(org.wso2.siddhi.core.executor.ExpressionExecutor[] attributeExpressionExecutors, org.wso2.siddhi.core.config.ExecutionPlanContext executionPlanContext) The initialization method for FunctionExecutor, this method will be called before the other methods- Specified by:
initin classorg.wso2.siddhi.core.executor.function.FunctionExecutor- Parameters:
attributeExpressionExecutors- are the executors of each function parametersexecutionPlanContext- the context of the execution plan
-
execute
The main execution method which will be called upon event arrival when there are more then one function parameter- Specified by:
executein classorg.wso2.siddhi.core.executor.function.FunctionExecutor- Parameters:
data- the runtime values of function parameters- Returns:
- the function result
-
execute
The main execution method which will be called upon event arrival when there are zero or one function parameter- Specified by:
executein classorg.wso2.siddhi.core.executor.function.FunctionExecutor- Parameters:
data- null if the function parameter count is zero or runtime data value of the function parameter- Returns:
- the function result
-
start
public void start()This will be called only once and this can be used to acquire required resources for the processing element. This will be called after initializing the system and before starting to process the events. -
stop
public void stop()This will be called only once and this can be used to release the acquired resources for processing. This will be called before shutting down the system. -
getReturnType
public org.wso2.siddhi.query.api.definition.Attribute.Type getReturnType() -
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- Returns:
- stateful objects of the processing element as an array
-
restoreState
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.- Parameters:
state- the stateful objects of the element as an array on the same order provided by currentState().
-