Interface PollingSource<T extends Event>

    • Field Detail

      • CONF_POLL_TIME

        static final String CONF_POLL_TIME
        Configuration key for the time in milliseconds between two polls.
        See Also:
        Constant Field Values
      • CONF_START_TIME

        static final String CONF_START_TIME
        Configuration key for the absolute point in time to use for calculating the start time.
        See Also:
        Constant Field Values
    • Method Detail

      • getPollTime

        long getPollTime()
        Gets the time in milliseconds this event source polls, more precisely, the time span between two polls. If this is 0 or negative, no polling will apply. However, init() and terminate() will be called.
        Returns:
        The time in milliseconds this event source polls (> 0).
      • getStartTime

        long getStartTime()
        Gets the absolute time in milliseconds since midnight, January 1, 1970 UTC when this polling source should start polling. This is used for calculating the first poll time by adding the time span defined in getPollTime().
        Returns:
        The absolute time in milliseconds since midnight, January 1, 1970 UTC when this polling source should start polling.
      • init

        void init()
        Initialises this polling source. This is called once before polling is started the first time.
      • terminate

        void terminate()
        Terminates this polling source. This is called once after polling has terminated and this source is removed.
        Note that this may be called any time, even when creating or handling an event. So take care to synchronise the implementation appropriately!