keycloak-aplcache

KEYCLOAK-4723 Refactor service dependencies for caches

5/19/2017 4:43:15 AM

Details

pom.xml 2(+1 -1)

diff --git a/pom.xml b/pom.xml
index 5559502..e18f9da 100755
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,7 @@
         <wildfly.build-tools.version>1.2.2.Final</wildfly.build-tools.version>
         <eap.version>7.1.0.Beta1-redhat-2</eap.version>
         <eap.build-tools.version>1.2.2.Final</eap.build-tools.version>
-        <wildfly.core.version>2.0.10.Final</wildfly.core.version>
+        <wildfly.core.version>3.0.0.Beta11</wildfly.core.version>
 
         <version.org.wildfly.security.wildfly-elytron>1.1.0.Beta32</version.org.wildfly.security.wildfly-elytron>
         <version.org.wildfly.security.elytron-web.undertow-server>1.0.0.Beta14</version.org.wildfly.security.elytron-web.undertow-server>
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 d83cd18..53e97a5 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);
         }
     }