Search in sources :

Example 1 with EJBBoundMdbDeliveryMetaData

use of org.jboss.as.ejb3.deliveryactive.metadata.EJBBoundMdbDeliveryMetaData in project wildfly by wildfly.

the class MdbDeliveryMergingProcessor method handleDeploymentDescriptor.

@Override
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final MessageDrivenComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
    final String ejbName = componentConfiguration.getEJBName();
    final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
    if (metaData == null) {
        return;
    }
    final AssemblyDescriptorMetaData assemblyDescriptor = metaData.getAssemblyDescriptor();
    if (assemblyDescriptor == null) {
        return;
    }
    Boolean deliveryActive = null;
    String deliveryGroup = null;
    final List<EJBBoundMdbDeliveryMetaData> deliveryMetaDataList = assemblyDescriptor.getAny(EJBBoundMdbDeliveryMetaData.class);
    if (deliveryMetaDataList != null) {
        for (EJBBoundMdbDeliveryMetaData deliveryMetaData : deliveryMetaDataList) {
            if ("*".equals(deliveryMetaData.getEjbName()) && deliveryActive == null && deliveryGroup == null) {
                deliveryActive = deliveryMetaData.isDeliveryActive();
                deliveryGroup = deliveryMetaData.getDeliveryGroup();
            } else if (ejbName.equals(deliveryMetaData.getEjbName())) {
                deliveryActive = deliveryMetaData.isDeliveryActive();
                deliveryGroup = deliveryMetaData.getDeliveryGroup();
            }
        }
    }
    // delivery group configuration has precedence over deliveryActive
    if (deliveryGroup != null) {
        componentConfiguration.setDeliveryGroup(deliveryGroup);
    } else if (deliveryActive != null) {
        componentConfiguration.setDeliveryActive(deliveryActive);
    }
}
Also used : EjbJarMetaData(org.jboss.metadata.ejb.spec.EjbJarMetaData) EJBBoundMdbDeliveryMetaData(org.jboss.as.ejb3.deliveryactive.metadata.EJBBoundMdbDeliveryMetaData) AssemblyDescriptorMetaData(org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData)

Example 2 with EJBBoundMdbDeliveryMetaData

use of org.jboss.as.ejb3.deliveryactive.metadata.EJBBoundMdbDeliveryMetaData in project wildfly by wildfly.

the class EJBBoundMdbDeliveryMetaDataParser11 method parse.

@Override
public EJBBoundMdbDeliveryMetaData parse(XMLStreamReader reader, final PropertyReplacer propertyReplacer) throws XMLStreamException {
    // we only parse <delivery> (root) element
    if (!ROOT_ELEMENT_DELIVERY.equals(reader.getLocalName())) {
        throw unexpectedElement(reader);
    }
    EJBBoundMdbDeliveryMetaData metaData = new EJBBoundMdbDeliveryMetaData();
    processElements(metaData, reader, propertyReplacer);
    return metaData;
}
Also used : EJBBoundMdbDeliveryMetaData(org.jboss.as.ejb3.deliveryactive.metadata.EJBBoundMdbDeliveryMetaData)

Example 3 with EJBBoundMdbDeliveryMetaData

use of org.jboss.as.ejb3.deliveryactive.metadata.EJBBoundMdbDeliveryMetaData in project wildfly by wildfly.

the class EJBBoundMdbDeliveryMetaDataParser method parse.

@Override
public EJBBoundMdbDeliveryMetaData parse(XMLStreamReader reader, final PropertyReplacer propertyReplacer) throws XMLStreamException {
    // we only parse <delivery> (root) element
    if (!ROOT_ELEMENT_DELIVERY.equals(reader.getLocalName())) {
        throw unexpectedElement(reader);
    }
    EJBBoundMdbDeliveryMetaData metaData = new EJBBoundMdbDeliveryMetaData();
    processElements(metaData, reader, propertyReplacer);
    return metaData;
}
Also used : EJBBoundMdbDeliveryMetaData(org.jboss.as.ejb3.deliveryactive.metadata.EJBBoundMdbDeliveryMetaData)

Aggregations

EJBBoundMdbDeliveryMetaData (org.jboss.as.ejb3.deliveryactive.metadata.EJBBoundMdbDeliveryMetaData)3 AssemblyDescriptorMetaData (org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData)1 EjbJarMetaData (org.jboss.metadata.ejb.spec.EjbJarMetaData)1