All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.as.ee.structure.AnnotationPropertyReplacementProcessor Maven / Gradle / Ivy

There is a newer version: 35.0.0.Beta1
Show newest version
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.jboss.as.ee.structure;

import org.jboss.as.server.deployment.AttachmentKey;
import org.jboss.as.server.deployment.DeploymentPhaseContext;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor;

/**
 * {@link org.jboss.as.server.deployment.DeploymentUnitProcessor} responsible for determining if property replacement should be
 * done on Jakarta Enterprise Beans annotations.
 */
public class AnnotationPropertyReplacementProcessor implements DeploymentUnitProcessor {

    private volatile boolean annotationPropertyReplacement = false;
    private final AttachmentKey attachmentKey;

    public AnnotationPropertyReplacementProcessor(final AttachmentKey attachmentKey) {
        this.attachmentKey = attachmentKey;
    }

    @Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        deploymentUnit.putAttachment(attachmentKey, annotationPropertyReplacement);

    }

    public void setDescriptorPropertyReplacement(boolean annotationPropertyReplacement) {
        this.annotationPropertyReplacement = annotationPropertyReplacement;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy