Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 13537 invoked from network); 11 Feb 2009 19:28:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2009 19:28:52 -0000 Received: (qmail 67704 invoked by uid 500); 11 Feb 2009 19:28:52 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 67659 invoked by uid 500); 11 Feb 2009 19:28:52 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 67650 invoked by uid 99); 11 Feb 2009 19:28:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 11:28:52 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 19:28:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E3F3E238899B; Wed, 11 Feb 2009 19:28:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r743457 - /geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java Date: Wed, 11 Feb 2009 19:28:28 -0000 To: scm@geronimo.apache.org From: gawor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090211192828.E3F3E238899B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gawor Date: Wed Feb 11 19:28:28 2009 New Revision: 743457 URL: http://svn.apache.org/viewvc?rev=743457&view=rev Log: revert 741735. must set Policy first before calling PolicyConfigurationFactory.getPolicyConfigurationFactory() (GERONIMO-4037) Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java?rev=743457&r1=743456&r2=743457&view=diff ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java (original) +++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java Wed Feb 11 19:28:28 2009 @@ -59,21 +59,6 @@ ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerSOAPMessage(), true); ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerHttpServletRequest(), true); - //Initialize PolicyConfigurationFactory before registering the GeronimoPolicy to the security system. - //So in the process of initializing PolicyConfigurationFactory, default Policy Object is still in effect - //In this way, we could avoid the infinite loop between the policy checking and loading PolicyConfigurationFactory - policyConfigurationFactory = sysOverRide(policyConfigurationFactory, POLICY_CONFIG_FACTORY); - if (policyConfigurationFactory != null) { - Thread currentThread = Thread.currentThread(); - ClassLoader oldClassLoader = currentThread.getContextClassLoader(); - currentThread.setContextClassLoader(classLoader); - try { - PolicyConfigurationFactory.getPolicyConfigurationFactory(); - } finally { - currentThread.setContextClassLoader(oldClassLoader); - } - } - if (!POLICY_INSTALLED) { policyProvider = sysOverRide(policyProvider, POLICY_PROVIDER); @@ -86,6 +71,17 @@ POLICY_INSTALLED = true; } + policyConfigurationFactory = sysOverRide(policyConfigurationFactory, POLICY_CONFIG_FACTORY); + if (policyConfigurationFactory != null) { + Thread currentThread = Thread.currentThread(); + ClassLoader oldClassLoader = currentThread.getContextClassLoader(); + currentThread.setContextClassLoader(classLoader); + try { + PolicyConfigurationFactory.getPolicyConfigurationFactory(); + } finally { + currentThread.setContextClassLoader(oldClassLoader); + } + } if (keyStore != null) sysOverRide(serverInfo.resolveServerPath(keyStore), KEYSTORE); if (keyStorePassword != null) sysOverRide(keyStorePassword, KEYSTORE_PASSWORD);