Search in sources :

Example 1 with EJBBoundPoolMetaData

use of org.jboss.as.ejb3.pool.EJBBoundPoolMetaData in project wildfly by wildfly.

the class AbstractPoolMergingProcessor method handleDeploymentDescriptor.

@Override
protected void handleDeploymentDescriptor(DeploymentUnit deploymentUnit, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, T description) throws DeploymentUnitProcessingException {
    final String ejbName = description.getEJBName();
    final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
    if (metaData == null) {
        return;
    }
    final AssemblyDescriptorMetaData assemblyDescriptor = metaData.getAssemblyDescriptor();
    if (assemblyDescriptor == null) {
        return;
    }
    // get the pool metadata
    final List<EJBBoundPoolMetaData> pools = assemblyDescriptor.getAny(EJBBoundPoolMetaData.class);
    String poolName = null;
    if (pools != null) {
        for (final EJBBoundPoolMetaData poolMetaData : pools) {
            // for the specific bean (i.e. via an ejb-name match)
            if ("*".equals(poolMetaData.getEjbName()) && poolName == null) {
                poolName = poolMetaData.getPoolName();
            } else if (ejbName.equals(poolMetaData.getEjbName())) {
                poolName = poolMetaData.getPoolName();
            }
        }
    }
    if (poolName != null) {
        this.setPoolName(description, poolName);
    }
}
Also used : EjbJarMetaData(org.jboss.metadata.ejb.spec.EjbJarMetaData) AssemblyDescriptorMetaData(org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData) EJBBoundPoolMetaData(org.jboss.as.ejb3.pool.EJBBoundPoolMetaData)

Aggregations

EJBBoundPoolMetaData (org.jboss.as.ejb3.pool.EJBBoundPoolMetaData)1 AssemblyDescriptorMetaData (org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData)1 EjbJarMetaData (org.jboss.metadata.ejb.spec.EjbJarMetaData)1