use of org.jboss.as.ejb3.cache.EJBBoundCacheMetaData in project wildfly by wildfly.
the class CacheMergingProcessor method handleDeploymentDescriptor.
@Override
protected void handleDeploymentDescriptor(DeploymentUnit deploymentUnit, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, StatefulComponentDescription 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<EJBBoundCacheMetaData> caches = assemblyDescriptor.getAny(EJBBoundCacheMetaData.class);
String cacheName = null;
if (caches != null) {
for (final EJBBoundCacheMetaData cacheMetaData : caches) {
// for the specific bean (i.e. via an ejb-name match)
if ("*".equals(cacheMetaData.getEjbName()) && cacheName == null) {
cacheName = cacheMetaData.getCacheName();
} else if (ejbName.equals(cacheMetaData.getEjbName())) {
cacheName = cacheMetaData.getCacheName();
}
}
}
if (cacheName != null) {
description.setCache(new CacheInfo(cacheName));
}
}
Aggregations