Module aeonics.core

Class Origin.Background

  • All Implemented Interfaces:
    Exportable, Snapshotable, java.io.Closeable, java.lang.AutoCloseable, java.lang.Runnable
    Enclosing class:
    Origin

    public static class Origin.Background
    extends Origin.Type
    implements java.lang.Runnable
    This class represents a data Origin that runs in the background in order to collect data and inject it in the system.

    You should implement the run() method and call the Origin.Type.emit(Message, String) method to inject data in the system.

    • Constructor Detail

      • Background

        public Background()
    • Method Detail

      • run

        public <T extends Origin.Background> T run​(java.lang.Runnable runner)
        Sets the run function as an alternative to run().
        Type Parameters:
        T - this
        Parameters:
        runner - the run function
        Returns:
        this
      • run

        public void run()
        Collects data in the background and calls Origin.Type.emit(Message, String) method to inject data in the system.
        Specified by:
        run in interface java.lang.Runnable
      • start

        public void start()
        Description copied from class: Origin.Type
        Starts this Origin entity. The Origin can only be started if it is currently stopped, otherwise it does nothing. Implementations are responsible to set and maintain the internal state.
        Overrides:
        start in class Origin.Type
      • stop

        public void stop()
        Description copied from class: Origin.Type
        Stops this Origin entity. The Origin can only be stopped if it is currently running, otherwise it does nothing. Implementations are responsible to set and maintain the internal state.
        Overrides:
        stop in class Origin.Type