Interface Activity

    • Method Detail

      • setActivityController

        void setActivityController​(ActivityController activityController)
        Provide the activity with the controls needed to stop itself.
        Parameters:
        activityController - The dedicated control interface for this activity
      • registerAutoCloseable

        void registerAutoCloseable​(java.lang.AutoCloseable closeable)
        Register an object which should be closed after this activity is shutdown.
        Parameters:
        closeable - An Autocloseable object
      • getAlias

        default java.lang.String getAlias()
      • initActivity

        default void initActivity()
      • closeAutoCloseables

        void closeAutoCloseables()
        Close all autocloseables that have been registered with this Activity.
      • getMotorDispenserDelegate

        MotorDispenser getMotorDispenserDelegate()
      • setMotorDispenserDelegate

        void setMotorDispenserDelegate​(MotorDispenser motorDispenser)
      • getInputDispenserDelegate

        InputDispenser getInputDispenserDelegate()
      • setInputDispenserDelegate

        void setInputDispenserDelegate​(InputDispenser inputDispenser)
      • setActionDispenserDelegate

        void setActionDispenserDelegate​(ActionDispenser actionDispenser)
      • setResultFilterDispenserDelegate

        void setResultFilterDispenserDelegate​(IntPredicateDispenser resultFilterDispenser)
      • setOutputDispenserDelegate

        void setOutputDispenserDelegate​(OutputDispenser outputDispenser)
      • setRunState

        void setRunState​(RunState runState)
      • shutdownActivity

        default void shutdownActivity()
      • getCycleSummary

        default java.lang.String getCycleSummary()
      • getCycleLimiter

        RateLimiter getCycleLimiter()
        Get the current cycle rate limiter for this activity. The cycle rate limiter is used to throttle the rate at which cycles are dispatched across all threads in the activity
        Returns:
        the cycle RateLimiter
      • setCycleLimiter

        void setCycleLimiter​(RateLimiter rateLimiter)
        Set the cycle rate limiter for this activity. This method should only be used in a non-concurrent context. Otherwise, the supplier version getCycleRateLimiter(Supplier) should be used.
        Parameters:
        rateLimiter - The cycle RateLimiter for this activity
      • getCycleRateLimiter

        RateLimiter getCycleRateLimiter​(java.util.function.Supplier<? extends RateLimiter> supplier)
        Get or create the cycle rate limiter in a safe way. Implementations should ensure that this method is synchronized or that each requester gets the same cycle rate limiter for the activity.
        Parameters:
        supplier - A RateLimiter Supplier
        Returns:
        An extant or newly created cycle RateLimiter
      • getStrideLimiter

        RateLimiter getStrideLimiter()
        Get the current stride rate limiter for this activity. The stride rate limiter is used to throttle the rate at which new strides are dispatched across all threads in an activity.
        Returns:
        The stride RateLimiter
      • setStrideLimiter

        void setStrideLimiter​(RateLimiter rateLimiter)
        Set the stride rate limiter for this activity. This method should only be used in a non-concurrent context. Otherwise, the supplier version getStrideRateLimiter(Supplier)} should be used.
        Parameters:
        rateLimiter - The stride RateLimiter for this activity.
      • getStrideRateLimiter

        RateLimiter getStrideRateLimiter​(java.util.function.Supplier<? extends RateLimiter> supplier)
        Get or create the stride RateLimiter in a concurrent-safe way. Implementations should ensure that this method is synchronized or that each requester gets the same stride rate limiter for the activity.
        Parameters:
        supplier - A RateLimiter Supplier
        Returns:
        An extant or newly created stride RateLimiter
      • getPhaseLimiter

        RateLimiter getPhaseLimiter()
        Get the current phase rate limiter for this activity. The phase rate limiter is used to throttle the rate at which new phases are dispatched across all threads in an activity.
        Returns:
        The stride RateLimiter
      • getResultTimer

        com.codahale.metrics.Timer getResultTimer()
      • setPhaseLimiter

        void setPhaseLimiter​(RateLimiter rateLimiter)
        Set the phase rate limiter for this activity. This method should only be used in a non-concurrent context. Otherwise, the supplier version getPhaseRateLimiter(Supplier)} should be used.
        Parameters:
        rateLimiter - The phase RateLimiter for this activity.
      • getPhaseRateLimiter

        RateLimiter getPhaseRateLimiter​(java.util.function.Supplier<? extends RateLimiter> supplier)
        Get or create the phase RateLimiter in a concurrent-safe way. Implementations should ensure that this method is synchronized or that each requester gets the same phase rate limiter for the activity.
        Parameters:
        supplier - A RateLimiter Supplier
        Returns:
        An extant or newly created phase RateLimiter
      • getInstrumentation

        ActivityInstrumentation getInstrumentation()
        Get or create the instrumentation needed for this activity. This provides a single place to find and manage, and document instrumentation that is uniform across all activities.
        Returns:
        A new or existing instrumentation object for this activity.