Search in sources :

Example 1 with EJBBoundResourceAdapterBindingMetaData

use of org.jboss.as.ejb3.resourceadapterbinding.metadata.EJBBoundResourceAdapterBindingMetaData in project wildfly by wildfly.

the class ResourceAdaptorMergingProcessor 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;
    }
    final List<EJBBoundResourceAdapterBindingMetaData> resourceAdapterBindingDataList = assemblyDescriptor.getAny(EJBBoundResourceAdapterBindingMetaData.class);
    String configuredAdapterName = null;
    if (resourceAdapterBindingDataList != null) {
        for (EJBBoundResourceAdapterBindingMetaData resourceAdapterBindingData : resourceAdapterBindingDataList) {
            if ("*".equals(resourceAdapterBindingData.getEjbName()) && configuredAdapterName == null) {
                configuredAdapterName = resourceAdapterBindingData.getResourceAdapterName();
            } else if (ejbName.equals(resourceAdapterBindingData.getEjbName())) {
                configuredAdapterName = resourceAdapterBindingData.getResourceAdapterName();
            }
        }
    }
    if (configuredAdapterName != null) {
        final String adapterName = addEarPrefixIfRelativeName(configuredAdapterName, deploymentUnit, componentClass);
        componentConfiguration.setResourceAdapterName(adapterName);
    }
}
Also used : EjbJarMetaData(org.jboss.metadata.ejb.spec.EjbJarMetaData) AssemblyDescriptorMetaData(org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData) EJBBoundResourceAdapterBindingMetaData(org.jboss.as.ejb3.resourceadapterbinding.metadata.EJBBoundResourceAdapterBindingMetaData)

Example 2 with EJBBoundResourceAdapterBindingMetaData

use of org.jboss.as.ejb3.resourceadapterbinding.metadata.EJBBoundResourceAdapterBindingMetaData in project wildfly by wildfly.

the class EJBBoundResourceAdapterBindingMetaDataParser method parse.

@Override
public EJBBoundResourceAdapterBindingMetaData parse(XMLStreamReader reader, final PropertyReplacer propertyReplacer) throws XMLStreamException {
    EJBBoundResourceAdapterBindingMetaData metaData = new EJBBoundResourceAdapterBindingMetaData();
    processElements(metaData, reader, propertyReplacer);
    return metaData;
}
Also used : EJBBoundResourceAdapterBindingMetaData(org.jboss.as.ejb3.resourceadapterbinding.metadata.EJBBoundResourceAdapterBindingMetaData)

Aggregations

EJBBoundResourceAdapterBindingMetaData (org.jboss.as.ejb3.resourceadapterbinding.metadata.EJBBoundResourceAdapterBindingMetaData)2 AssemblyDescriptorMetaData (org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData)1 EjbJarMetaData (org.jboss.metadata.ejb.spec.EjbJarMetaData)1