From f1378a60927f9fbc6c52ff83d573b7e9367c9f27 Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 21 Nov 2014 23:49:29 +0100 Subject: [PATCH] KEYCLOAK-858 avoid creating inner DeploymentDelegate for each request --- .../org/keycloak/adapters/AdapterDeploymentContext.java | 8 +++++--- .../java/org/keycloak/adapters/KeycloakDeployment.java | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java b/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java index b52b34e30e..532b2097e5 100755 --- a/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java +++ b/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java @@ -78,9 +78,11 @@ public class AdapterDeploymentContext { if (deployment == null) return null; if (deployment.getAuthServerBaseUrl() == null) return deployment; - deployment = resolveUrls(deployment, facade); - if (deployment.getRealmKey() == null) resolveRealmKey(deployment); - return deployment; + KeycloakDeployment resolvedDeployment = resolveUrls(deployment, facade); + if (resolvedDeployment.getRealmKey() == null) { + resolveRealmKey(resolvedDeployment); + } + return resolvedDeployment; } protected KeycloakDeployment resolveUrls(KeycloakDeployment deployment, HttpFacade facade) { diff --git a/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java b/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java index 4b13bd89de..f4b9c9029a 100755 --- a/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java +++ b/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java @@ -24,7 +24,7 @@ public class KeycloakDeployment { protected RelativeUrlsUsed relativeUrls; protected String realm; - protected PublicKey realmKey; + protected volatile PublicKey realmKey; protected String authServerBaseUrl; protected String realmInfoUrl; protected KeycloakUriBuilder authUrl;