Interface IProcessExec

All Known Subinterfaces:
IProcessChainExec
All Known Implementing Classes:
AbstractProcessImpl, AggregateProcessImpl, ExecutableChainImpl, ExecutableProcessImpl, PhysicalComponentImpl, PhysicalSystemImpl, SimpleProcessImpl

public interface IProcessExec
  • Method Details

    • getProcessInfo

      ProcessInfo getProcessInfo()
      Returns:
      all process information (name, UID, etc.)
    • setInstanceName

      void setInstanceName(String name)
      Sets the name of this process instance
      Parameters:
      name -
    • getInstanceName

      String getInstanceName()
      Returns:
      name of this process instance
    • init

      void init() throws ProcessException
      Initialize the process and its internal variables (fixed parameters). This is called only once before the process is executed.
      Throws:
      ProcessException
    • canRun

      boolean canRun()
      Check that all needed connections are ready for the process to run
      Returns:
      true if so and false if at least one connection is not ready.
    • run

      void run() throws ProcessException
      Runs the process which includes fetching input data, calling execute and producing output data
      Throws:
      ProcessException
    • execute

      void execute() throws ProcessException
      Execute contains the logic to transform input/parameter values into output values. This method should be optimized as much as possible.
      Throws:
      ProcessException
    • start

      void start(Consumer<Throwable> onError) throws ProcessException
      Start process in its own thread
      Parameters:
      onError - Called when the process ends with an unrecoverable error
      Throws:
      ProcessException
    • start

      void start(ExecutorService threadPool, Consumer<Throwable> onError) throws ProcessException
      Start process using threads from the given thread pool
      Parameters:
      threadPool -
      onError - Called when the process ends with an unrecoverable error
      Throws:
      ProcessException
    • stop

      void stop()
      Stop process thread gracefully
    • dispose

      void dispose()
      Override to dispose of all resources allocated for the process (stop threads, OS resources, etc...)
    • getInputList

      IOPropertyList getInputList()
      Returns:
      List of inputs
    • getOutputList

      IOPropertyList getOutputList()
      Returns:
      List of outputs
    • getParameterList

      IOPropertyList getParameterList()
      Returns:
      List of parameters
    • getInputConnections

      Map<String,DataConnectionList> getInputConnections()
      Returns:
      Read-only list of connections input ports
    • getOutputConnections

      Map<String,DataConnectionList> getOutputConnections()
      Returns:
      Read-only list of connections output ports
    • getParamConnections

      Map<String,DataConnectionList> getParamConnections()
      Returns:
      Read-only list of connections parameter ports
    • connect

      void connect(DataComponent component, IDataConnection connection) throws ProcessException
      Connects one of this process ports with the given connection
      Parameters:
      component - input, parameter or output component to connect
      connection - connection object to use
      Throws:
      IllegalArgumentException - if component is not part on this process ports
      ProcessException - if connection cannot be validated (this usually happens because source and destination components are not compatible)
    • disconnect

      void disconnect(IDataConnection connection)
      Detach connection from this process input, output or parameter
      Parameters:
      connection -
      Throws:
      IllegalArgumentException - if connection is not attached to any of this process ports
    • needSync

      boolean needSync()
      Returns:
      True if this process is asynchronous (i.e. outputs are not generated everytime inputs are read) and thus need synchronization with other processes in the chain
    • notifyParamChange

      void notifyParamChange()
      Notifies the process that one or more parameter values have changed before or during execution
    • setParentLogger

      void setParentLogger(org.slf4j.Logger log)
      Set the parent logger for this process.
      The parent logger is used to group log events occuring in all processes that are part of the same processing component (e.g. a process chain for instance) while still allowing to differentiate the actual process instance that issued the log.
      Parameters:
      log -