use of org.jboss.as.ejb3.clustering.EJBBoundClusteringMetaData in project wildfly by wildfly.
the class ClusteredSingletonMergingProcessor method handleDeploymentDescriptor.
@Override
protected void handleDeploymentDescriptor(DeploymentUnit deploymentUnit, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, MessageDrivenComponentDescription componentDescription) throws DeploymentUnitProcessingException {
final EjbJarMetaData ejbJarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
Boolean allBeansClusteredSingleton = null;
if (ejbJarMetaData != null) {
final AssemblyDescriptorMetaData assemblyMetadata = ejbJarMetaData.getAssemblyDescriptor();
if (assemblyMetadata != null) {
final List<EJBBoundClusteringMetaData> clusteringMetaDatas = assemblyMetadata.getAny(EJBBoundClusteringMetaData.class);
if (clusteringMetaDatas != null) {
for (final EJBBoundClusteringMetaData clusteringMetaData : clusteringMetaDatas) {
if ("*".equals(clusteringMetaData.getEjbName())) {
allBeansClusteredSingleton = clusteringMetaData.isClusteredSingleton();
} else if (componentDescription.getComponentName().equals(clusteringMetaData.getEjbName())) {
componentDescription.setClusteredSingleton(clusteringMetaData.isClusteredSingleton());
return;
}
}
}
}
}
if (allBeansClusteredSingleton != null && allBeansClusteredSingleton) {
componentDescription.setClusteredSingleton(true);
}
}
Aggregations