From afea8badd9e9eafcfe64c77a8c830a362c4ac53b Mon Sep 17 00:00:00 2001 From: Michal Petrov Date: Fri, 11 Oct 2024 19:10:04 +0200 Subject: [PATCH] WFLY-19843: deregister capability on removal --- .../subsystem/ApplicationSecurityDomainDefinition.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/ApplicationSecurityDomainDefinition.java b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/ApplicationSecurityDomainDefinition.java index c5d61fe7f869..953456ed433a 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/ApplicationSecurityDomainDefinition.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/ApplicationSecurityDomainDefinition.java @@ -189,6 +189,14 @@ protected void performRemove(OperationContext context, ModelNode operation, Mode this.knownApplicationSecurityDomains.removeIf(domain -> domain.isSameDomain(name)); } + @Override + protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { + super.recordCapabilitiesAndRequirements(context, operation, resource); + context.deregisterCapability( + RuntimeCapability.buildDynamicCapabilityName(CAPABILITY_APPLICATION_SECURITY_DOMAIN_KNOWN_DEPLOYMENTS, context.getCurrentAddressValue()) + ); + } + @Override protected ServiceName serviceName(String name) { return APPLICATION_SECURITY_DOMAIN_CAPABILITY.getCapabilityServiceName(ApplicationSecurityDomain.class, name);