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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    protected Object
    The main execution method which will be called upon event arrival when there are zero or one function parameter
    protected Object
    execute(Object[] data)
    The main execution method which will be called upon event arrival when there are more then one function parameter
    org.wso2.siddhi.query.api.definition.Attribute.Type
     
    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
    void
    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
    This will be called only once and this can be used to acquire required resources for the processing element.
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      init in class org.wso2.siddhi.core.executor.function.FunctionExecutor
      Parameters:
      attributeExpressionExecutors - are the executors of each function parameters
      executionPlanContext - the context of the execution plan
    • execute

      protected Object execute(Object[] data)
      The main execution method which will be called upon event arrival when there are more then one function parameter
      Specified by:
      execute in class org.wso2.siddhi.core.executor.function.FunctionExecutor
      Parameters:
      data - the runtime values of function parameters
      Returns:
      the function result
    • execute

      protected Object execute(Object data)
      The main execution method which will be called upon event arrival when there are zero or one function parameter
      Specified by:
      execute in class org.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

      public 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
      Returns:
      stateful objects of the processing element as an array
    • restoreState

      public void restoreState(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.
      Parameters:
      state - the stateful objects of the element as an array on the same order provided by currentState().