Class ContextObservers


  • @Deprecated
    public final class ContextObservers
    extends Object
    Deprecated.
    The (static) utility methods from this class were moved to the ContextManagers class.
    Utility class to assist Context implementors.

    It implements the SPI behaviour, locating appropriate ContextObserver implementations to be notified of activate and deactivate occurrances.

    Author:
    Sjoerd Talsma
    See Also:
    ContextManagers
    • Method Detail

      • onActivate

        @Deprecated
        public static <T> void onActivate​(Class<? extends ContextManager<? super T>> contextManager,
                                          T activatedContextValue,
                                          T previousContextValue)
        Deprecated.
        This method was moved to the ContextManagers utility class.
        Notifies all context observers for the specified contextManager about the activated context value.
        Type Parameters:
        T - The type managed by the context manager.
        Parameters:
        contextManager - The context manager type that activated the context (required to observe).
        activatedContextValue - The activated context value or null if no value was activated.
        previousContextValue - The previous context value or null if unknown or unsupported.
        See Also:
        ContextManagers.onActivate(Class, Object, Object)
      • onDeactivate

        @Deprecated
        public static <T> void onDeactivate​(Class<? extends ContextManager<? super T>> contextManager,
                                            T deactivatedContextValue,
                                            T restoredContextValue)
        Deprecated.
        This method was moved to the ContextManagers utility class.
        Notifies all context observers for the specified contextManager about the deactivated context value.
        Type Parameters:
        T - The type managed by the context manager.
        Parameters:
        contextManager - The context manager type that deactivated the context (required to observe).
        deactivatedContextValue - The deactivated context value
        restoredContextValue - The restored context value or null if unknown or unsupported.
        See Also:
        ContextManagers.onDeactivate(Class, Object, Object)