use of org.jboss.as.server.deployment.annotation.CompositeIndex in project wildfly by wildfly.
the class ResourceLookupDependenciesProvider method getDependencies.
@Override
public Set<ServiceName> getDependencies(DeploymentUnit unit) {
CompositeIndex index = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
PropertyReplacer replacer = EJBAnnotationPropertyReplacement.propertyReplacer(unit);
List<AnnotationInstance> annotations = index.getAnnotations(RESOURCE_ANNOTATION_NAME);
Set<ServiceName> result = !annotations.isEmpty() ? new TreeSet<>() : Collections.emptySet();
for (AnnotationInstance annotation : annotations) {
AnnotationValue lookupValue = annotation.value("lookup");
if (lookupValue != null) {
String lookup = replacer.replaceProperties(lookupValue.asString());
try {
ServiceName name = ContextNames.bindInfoFor(lookup).getBinderServiceName();
if (ContextNames.JBOSS_CONTEXT_SERVICE_NAME.isParentOf(name)) {
result.add(name);
}
} catch (RuntimeException e) {
// No associated naming store
}
}
}
return result;
}
use of org.jboss.as.server.deployment.annotation.CompositeIndex in project wildfly by wildfly.
the class CompensationsDependenciesDeploymentProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit unit = phaseContext.getDeploymentUnit();
final CompositeIndex compositeIndex = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
if (compositeIndex == null) {
return;
}
if (isCompensationAnnotationPresent(compositeIndex)) {
addCompensationsModuleDependency(unit);
}
}
use of org.jboss.as.server.deployment.annotation.CompositeIndex in project wildfly by wildfly.
the class XTSDependenciesDeploymentProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit unit = phaseContext.getDeploymentUnit();
final CompositeIndex compositeIndex = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
if (compositeIndex == null) {
return;
}
if (isCompensationAnnotationPresent(compositeIndex) || isTransactionalEndpointPresent(compositeIndex)) {
addXTSModuleDependency(unit);
}
}
Aggregations