Stay organized with collections Save and categorize content based on your preferences.

ApplicationLifecycleMonitorRegistry

public final class ApplicationLifecycleMonitorRegistry


An exposed registry instance to make it easy for callers to find the application lifecycle monitor for their application.

Summary

Public constructors

Public methods

static ApplicationLifecycleMonitor

Returns the ActivityLifecycleMonitor.

static void

Stores a lifecycle monitor in the registry.

Public constructors

ApplicationLifecycleMonitorRegistry

public ApplicationLifecycleMonitorRegistry()

Public methods

getInstance

public static ApplicationLifecycleMonitor getInstance()

Returns the ActivityLifecycleMonitor.

This monitor is not guaranteed to be present under all instrumentations.

Returns
ApplicationLifecycleMonitor

ActivityLifecycleMonitor the monitor for this application.

Throws
java.lang.IllegalStateException java.lang.IllegalStateException

if no monitor has been registered.

registerInstance

public static void registerInstance(ApplicationLifecycleMonitor monitor)

Stores a lifecycle monitor in the registry.

This is a global registry - so be aware of the impact of calling this method!

Parameters
ApplicationLifecycleMonitor monitor

the monitor for this application. Null deregisters any existing monitor.