Interface ResourceReferenceProvider


  • public interface ResourceReferenceProvider
    Makes it possible to resolve non-CDI injection points, such as Java EE resources.
    • Method Detail

      • get

        InstanceHandle<Object> get​(Type type,
                                   Set<Annotation> annotations)
        A resource reference handle is a dependent object of the object it is injected into. InstanceHandle.destroy() is called when the target object is destroyed.
         class ResourceBean {
        
             @Resource(lookup = "bar")
             String bar;
        
             @Produces
             @PersistenceContext
             EntityManager entityManager;
         }
         
        Parameters:
        type -
        annotations -
        Returns:
        the resource reference handle or null if not resolvable
      • getAnnotation

        default <T extends Annotation> T getAnnotation​(Set<Annotation> annotations,
                                                       Class<T> annotationType)
        Convenient util method.
        Parameters:
        annotations -
        annotationType -
        Returns: