Class SimpleEnvEntryCdiResourceInjectionProcessor

java.lang.Object
org.jboss.as.weld.deployment.processors.SimpleEnvEntryCdiResourceInjectionProcessor
All Implemented Interfaces:
org.jboss.as.server.deployment.DeploymentUnitProcessor

public class SimpleEnvEntryCdiResourceInjectionProcessor extends Object implements org.jboss.as.server.deployment.DeploymentUnitProcessor
Processes deployment descriptor env-entry configurations looking for cases where an injection target is specified and the env-entry-type is one of the 'Simple Environment Entry' Java types listed in Section 5.4 of the Jakarta EE 9.1 Platform specification. If any are found, adds a CDI @{link Extension} that observes CDI ProcessAnnotatedType events in order to ensure that the annotated type's resource injection configuration reflects any env-entry that was found. Specifically, if the class name for the annotated type matches the injection-target-class of a found env-entry, and the name of a field or name of a property with a setter method matches the injection-target-name of that env-entry, and the type of the field or setter parameter is assignable from the specified env-entry-type of that env-entry:
  1. If the env-entry-value for the env-entry is not specified, but the field or method is annotated with an @Resource annotation with no lookup() or mappedName(), configured, CDI is instructed to remove the @Resource annotation, thus disabling injection, as discussed in section 5.4.1.3 of the Jakarta EE 9.1 Platform specification.
  2. If the env-entry-value for the env-entry is specified,, but the field or method is not annotated with an @Resource annotation, CDI is instructed to add the @Resource annotation, thus enabling injection, as discussed in section 5.4.1.3 of the Jakarta EE 9.1 Platform specification.
  • Constructor Details

    • SimpleEnvEntryCdiResourceInjectionProcessor

      public SimpleEnvEntryCdiResourceInjectionProcessor()
  • Method Details

    • deploy

      public void deploy(org.jboss.as.server.deployment.DeploymentPhaseContext deploymentPhaseContext) throws org.jboss.as.server.deployment.DeploymentUnitProcessingException
      Specified by:
      deploy in interface org.jboss.as.server.deployment.DeploymentUnitProcessor
      Throws:
      org.jboss.as.server.deployment.DeploymentUnitProcessingException