Interface Service.ScopeHandler

Enclosing class:
Service

@Contract public static interface Service.ScopeHandler
Extension point for the service registry to support new scopes.

Implementation must be qualified with the fully qualified name of the corresponding scope annotation class.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeName
    Type name of this interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    activate(Scope scope)
    Activate the given scope.
    Get the current scope if available.
    default void
    De-activate the given scope.
  • Field Details

    • TYPE

      static final TypeName TYPE
      Type name of this interface. Service registry uses TypeName in its APIs.
  • Method Details

    • currentScope

      Optional<Scope> currentScope()
      Get the current scope if available.
      Returns:
      current scope instance, or empty if the scope is not active
    • activate

      default void activate(Scope scope)
      Activate the given scope.
      Parameters:
      scope - scope to activate
    • deactivate

      default void deactivate(Scope scope)
      De-activate the given scope.
      Parameters:
      scope - scope to de-activate