From 0b6c9aa927e8cdd5cb973632ba4001baff1c5a15 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Fri, 19 May 2017 09:43:15 +0200 Subject: [PATCH] KEYCLOAK-4723 Refactor service dependencies for caches in KeycloakServerDeploymentProcessor --- pom.xml | 2 +- .../KeycloakServerDeploymentProcessor.java | 21 +++++-------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 5559502d34..e18f9da00d 100755 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ 1.2.2.Final 7.1.0.Beta1-redhat-2 1.2.2.Final - 2.0.10.Final + 3.0.0.Beta11 1.1.0.Beta32 1.0.0.Beta14 diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakServerDeploymentProcessor.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakServerDeploymentProcessor.java index d83cd189ea..53e97a5e58 100755 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakServerDeploymentProcessor.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakServerDeploymentProcessor.java @@ -96,22 +96,11 @@ public class KeycloakServerDeploymentProcessor implements DeploymentUnitProcesso } private void addInfinispanCaches(DeploymentPhaseContext context) { - // TODO Can be removed once we upgrade to WildFly 11 - ServiceName wf10CacheContainerService = ServiceName.of("jboss", "infinispan", "keycloak"); - boolean legacy = context.getServiceRegistry().getService(wf10CacheContainerService) != null; - - if (!legacy) { - ServiceTarget st = context.getServiceTarget(); - CapabilityServiceSupport support = context.getDeploymentUnit().getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); - for (String c : CACHES) { - ServiceName sn = support.getCapabilityServiceName("org.wildfly.clustering.infinispan.cache.keycloak." + c); - st.addDependency(sn); - } - } else { - ServiceTarget st = context.getServiceTarget(); - for (String c : CACHES) { - st.addDependency(wf10CacheContainerService.append(c)); - } + ServiceTarget st = context.getServiceTarget(); + CapabilityServiceSupport support = context.getDeploymentUnit().getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); + for (String c : CACHES) { + ServiceName sn = support.getCapabilityServiceName("org.wildfly.clustering.infinispan.cache", "keycloak", c); + st.addDependency(sn); } }