Interface CustomScope<A extends java.lang.annotation.Annotation>

    • Method Detail

      • annotationType

        java.lang.Class<A> annotationType()
        Returns:
        The scope annotation type
      • getOrCreate

        <T> T getOrCreate​(BeanCreationContext<T> creationContext)
        Resolve an object from the given scope.
        Type Parameters:
        T - The bean generic type
        Parameters:
        creationContext - The creation context
        Returns:
        The bean instance
      • remove

        <T> java.util.Optional<T> remove​(BeanIdentifier identifier)
        Remove a bean definition from the scope.
        Type Parameters:
        T - The generic type
        Parameters:
        identifier - The BeanIdentifier
        Returns:
        An Optional of the instance that was destroyed if it exists
      • findBeanRegistration

        default <T> java.util.Optional<BeanRegistration<T>> findBeanRegistration​(T bean)
        Get the BeanDefinition for the given bean.
        Type Parameters:
        T - The bean generic type
        Parameters:
        bean - The bean
        Returns:
        The bean definition if it can be resolved
      • findBeanRegistration

        default <T> java.util.Optional<BeanRegistration<T>> findBeanRegistration​(BeanDefinition<T> beanDefinition)
        Get the BeanDefinition for the given bean.
        Type Parameters:
        T - The bean generic type
        Parameters:
        beanDefinition - The bean definition
        Returns:
        The bean definition if it can be resolved
        Since:
        3.5.0