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:
-
If the
env-entry-valuefor the env-entry is not specified, but the field or method is annotated with an@Resourceannotation with nolookup()ormappedName(), 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. -
If the
env-entry-valuefor the env-entry is specified,, but the field or method is not annotated with an@Resourceannotation, 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeploy(org.jboss.as.server.deployment.DeploymentPhaseContext deploymentPhaseContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.as.server.deployment.DeploymentUnitProcessor
undeploy
-
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:
deployin interfaceorg.jboss.as.server.deployment.DeploymentUnitProcessor- Throws:
org.jboss.as.server.deployment.DeploymentUnitProcessingException
-