Interface ScopeResolver

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T get​(java.lang.Object key, CreationalContext<T> creationalContext)
      Returns an existing instance associated with the given key, or uses the given context to create one.
      java.lang.annotation.Annotation getAnnotation()
      Returns the annotation this resolver handles.
      boolean isActive()
      Returns true when this scope is currently active, otherwise false.
      void remove​(java.lang.Object key)
      Removes the given key from this scope resolver.
    • Method Detail

      • getAnnotation

        java.lang.annotation.Annotation getAnnotation()
        Returns the annotation this resolver handles. Returns null when the handler handles unscoped injectables.
        Returns:
        the annotation this resolver handles, never null
      • isActive

        boolean isActive()
        Returns true when this scope is currently active, otherwise false.
        Returns:
        true when this scope is currently active, otherwise false
      • get

        <T> T get​(java.lang.Object key,
                  CreationalContext<T> creationalContext)
           throws ScopeNotActiveException,
                  java.lang.Exception
        Returns an existing instance associated with the given key, or uses the given context to create one.
        Type Parameters:
        T - the type of the instances provided by the CreationalContext
        Parameters:
        key - an object suitable as a key for use in a map, cannot be null
        creationalContext - an CreationalContext, cannot be null
        Returns:
        an instance of the given type, never null
        Throws:
        ScopeNotActiveException - when there is no scope active
        java.lang.Exception - when the object factory throws an exception
      • remove

        void remove​(java.lang.Object key)
        Removes the given key from this scope resolver.
        Parameters:
        key - an object suitable as a key for use in a map, cannot be null