use of org.jboss.as.controller.capability.CapabilityServiceSupport in project wildfly by wildfly.
the class TracingDeploymentProcessor method getTracerConfiguration.
private String getTracerConfiguration(DeploymentPhaseContext deploymentPhaseContext) {
DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit();
JBossWebMetaData jbossWebMetaData = getJBossWebMetaData(deploymentUnit);
if (null == jbossWebMetaData || null == jbossWebMetaData.getContextParams()) {
return null;
}
for (ParamValueMetaData param : jbossWebMetaData.getContextParams()) {
if (SMALLRYE_OPENTRACING_TRACER_CONFIGURATION.equals(param.getParamName())) {
String value = param.getParamValue();
if (value != null && !value.isEmpty()) {
return TRACER_CAPABILITY.getDynamicName(param.getParamValue());
}
}
}
final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
if (support.hasCapability(DEFAULT_TRACER_CAPABILITY_NAME)) {
return WildFlyTracerFactory.getDefaultTracerName();
}
return null;
}
use of org.jboss.as.controller.capability.CapabilityServiceSupport in project wildfly by wildfly.
the class TracingDependencyProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
addDependencies(deploymentUnit);
final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
if (support.hasCapability(DEFAULT_TRACER_CAPABILITY_NAME)) {
phaseContext.getServiceTarget().addDependency(DEFAULT_TRACER_CAPABILITY.getCapabilityServiceName());
}
ServiceName tracerConfiguration = getTracerConfigurationServiceDependency(phaseContext);
if (tracerConfiguration != null) {
phaseContext.getServiceTarget().addDependency(tracerConfiguration);
}
}
use of org.jboss.as.controller.capability.CapabilityServiceSupport in project wildfly by wildfly.
the class ReactiveMessagingDependencyProcessor method ignorePrecalulatedJandex.
@SuppressWarnings("deprecation")
private void ignorePrecalulatedJandex(DeploymentUnit deploymentUnit, String... modules) {
final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
if (support.hasCapability(WELD_CAPABILITY_NAME)) {
WeldCapability weld = support.getOptionalCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class).get();
weld.ignorePrecalculatedJandexForModules(deploymentUnit, modules);
}
}
use of org.jboss.as.controller.capability.CapabilityServiceSupport in project wildfly by wildfly.
the class JndiNamingDependencyProcessor method deploy.
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
ServiceName namingStoreServiceName = support.getCapabilityServiceName(NamingService.CAPABILITY_NAME);
// this will always be up but we need to make sure the naming service is
// not shut down before the deployment is undeployed when the container is shut down
phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, namingStoreServiceName);
final ServiceName serviceName = serviceName(deploymentUnit.getServiceName());
final ServiceBuilder<?> serviceBuilder = phaseContext.getServiceTarget().addService(serviceName, new RuntimeBindReleaseService());
addAllDependencies(serviceBuilder, deploymentUnit.getAttachmentList(Attachments.JNDI_DEPENDENCIES));
Map<ServiceName, Set<ServiceName>> compJndiDeps = deploymentUnit.getAttachment(Attachments.COMPONENT_JNDI_DEPENDENCIES);
Set<ServiceName> aggregatingServices = installComponentJndiAggregatingServices(phaseContext.getServiceTarget(), compJndiDeps);
addAllDependencies(serviceBuilder, aggregatingServices);
if (deploymentUnit.getParent() != null) {
addAllDependencies(serviceBuilder, deploymentUnit.getParent().getAttachment(Attachments.JNDI_DEPENDENCIES));
compJndiDeps = deploymentUnit.getParent().getAttachment(Attachments.COMPONENT_JNDI_DEPENDENCIES);
aggregatingServices = installComponentJndiAggregatingServices(phaseContext.getServiceTarget(), compJndiDeps);
addAllDependencies(serviceBuilder, aggregatingServices);
}
serviceBuilder.requires(namingStoreServiceName);
serviceBuilder.install();
}
use of org.jboss.as.controller.capability.CapabilityServiceSupport in project wildfly by wildfly.
the class EarApplicationScopedObserverMethodProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) {
// ear deployment only processor
return;
}
final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
if (support.hasCapability(WELD_CAPABILITY_NAME)) {
final WeldCapability api = support.getOptionalCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class).get();
if (api.isPartOfWeldDeployment(deploymentUnit)) {
api.registerExtensionInstance(new PortableExtension(deploymentUnit), deploymentUnit);
}
}
}
Aggregations