Interface ResourceInjectionServices

All Superinterfaces:
Service
All Known Implementing Classes:
AbstractResourceServices, ForwardingResourceInjectionServices

public interface ResourceInjectionServices extends Service
A container should implement this interface to allow the Weld to resolve Resources ResourceInjectionServices is per-module service.
Author:
Pete Muir, Jozef Hartinger
  • Method Details

    • registerResourceInjectionPoint

      ResourceReferenceFactory<Object> registerResourceInjectionPoint(jakarta.enterprise.inject.spi.InjectionPoint injectionPoint)
      Register a resource injection point. The implementation validates the injection point. If the validation passes, an instance of ResourceReferenceFactory is returned which may be used at runtime for creating instances of the resource.
      Parameters:
      injectionPoint - the injection point metadata
      Returns:
      resource factory
      Throws:
      jakarta.enterprise.inject.spi.DefinitionException - if the injection point is not annotated with @Resource, if the injection point is a method that doesn't follow JavaBean conventions or if the injection point type does not match the resource type
      IllegalStateException - if no resource can be resolved
    • registerResourceInjectionPoint

      ResourceReferenceFactory<Object> registerResourceInjectionPoint(String jndiName, String mappedName)
      Register a resource injection point with the given JNDI name and mapped name. The implementation validates the injection point. If the validation passes, an instance of ResourceReferenceFactory is returned which may be used at runtime for creating instances of the resource.
      Parameters:
      jndiName - JNDI name
      mappedName - mapped name
      Returns:
      resource factory
      Throws:
      IllegalStateException - if no resource can be resolved
      IllegalArgumentException - if both jndiName and mappedName are null