Package 

Class RuntimeManager


  • 
    public class RuntimeManager
    
                        

    Manager that contains library state and locks

    • Constructor Detail

      • RuntimeManager

        RuntimeManager()
        Constructor
    • Method Detail

      • setContext

         void setContext(Context context)

        Set the context, you should NEVER call this method outside of a changeState methodThis method is NOT thread safe

        Parameters:
        context - Android's context
      • setActivity

         void setActivity(Activity activity)

        Set the activity, you should NEVER call this method outside of a changeState methodThis method is NOT thread safe

        Parameters:
        activity - Android's activity
      • readConfig

         void readConfig(@NonNull() ConfigAction action)

        Execute an action to read the batch configurationYou should never use this method to update the configuration.To do that use updateConfig

        Parameters:
        action - action that will read the config.
      • updateConfig

         void updateConfig(@NonNull() ConfigAction action)

        Execute an action to update the batch configuration.Configuration can only be update if the sdk is not started.

        Parameters:
        action - action that will modify the config
      • changeState

         boolean changeState(ChangeStateAction action)

        Execute an action to modify the state

        Parameters:
        action - action that will modify the given state
      • changeStateIf

         boolean changeStateIf(State wantedState, ChangeStateAction action)

        Execute an action to modify the state if the current state equals the wanted one

        Parameters:
        wantedState - The state we want
        action - The action to modify the state
      • run

         void run(StateAction action)

        Execute an action with read lock

        Parameters:
        action - action that can read the given state
      • runIf

         void runIf(State wantedState, StateAction action)

        Execute an action with read lock if the current state equals the wanted state

        Parameters:
        wantedState - The state we want
        action - The action to to read state
      • runIfReady

         boolean runIfReady(Runnable action)

        Run this action if Batch is ready

        Parameters:
        action - The action to
      • runIf

         boolean runIf(State wantedState, Runnable action)

        Run this action if Batch is at the given wanted state

        Parameters:
        wantedState - The state we want
        action - The action to run
      • onStart

         Long onStart()

        Method to call when onStart is called to get the last stop timestamp (if any)This method is NOT thread safe, should only be called on a changeState method

      • onStopWithoutFinishing

         void onStopWithoutFinishing()

        Method to call when onStop is called without a finishing activityThis method is NOT thread safe, should only be called on a changeState method

      • isReady

         boolean isReady()

        Checks if Batch is ready

      • isRetainedByService

         boolean isRetainedByService()

        Checks if the service's refcount is greater than 0

      • updateLastUserStartDate

         void updateLastUserStartDate()

        Set the last time the Batch was started for user activity to now.You should NEVER call this method outside of a changeState methodThis method is NOT thread safe