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

org.jboss.as.xts.jandex.TransactionalAnnotation Maven / Gradle / Ivy

There is a newer version: 33.0.2.Final
Show newest version
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */
package org.jboss.as.xts.jandex;

import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.xts.XTSException;

import jakarta.ejb.TransactionAttribute;
import jakarta.transaction.Transactional;

/**
 * @author Gytis Trikleris
 * @author Paul Robinson
 */
public class TransactionalAnnotation {

    public static final String[] TRANSACTIONAL_ANNOTATIONS = {
            TransactionAttribute.class.getName(),
            Transactional.class.getName()
    };

    private TransactionalAnnotation() {
    }

    public static TransactionalAnnotation build(DeploymentUnit unit, String endpoint) throws XTSException {
        for (final String annotation : TRANSACTIONAL_ANNOTATIONS) {
            if (JandexHelper.getAnnotation(unit, endpoint, annotation) != null) {
                return new TransactionalAnnotation();
            }
        }

        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy