[jboss-cvs] JBossAS SVN: r94426 - in trunk/security/src/main/java/org/jboss/security: plugins and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 6 14:04:02 EDT 2009
Author: mmoyses
Date: 2009-10-06 14:04:01 -0400 (Tue, 06 Oct 2009)
New Revision: 94426
Modified:
trunk/security/src/main/java/org/jboss/security/integration/JNDIBasedSecurityManagement.java
trunk/security/src/main/java/org/jboss/security/plugins/JaasSecurityManagerService.java
Log:
JBAS-3986: enabling the thread to be started/stopped at runtime
Modified: trunk/security/src/main/java/org/jboss/security/integration/JNDIBasedSecurityManagement.java
===================================================================
--- trunk/security/src/main/java/org/jboss/security/integration/JNDIBasedSecurityManagement.java 2009-10-06 17:52:47 UTC (rev 94425)
+++ trunk/security/src/main/java/org/jboss/security/integration/JNDIBasedSecurityManagement.java 2009-10-06 18:04:01 UTC (rev 94426)
@@ -346,6 +346,16 @@
public static void setDefaultCacheFlushPeriod(int flushPeriodInSecs)
{
SecurityConstantsBridge.defaultCacheFlushPeriod = flushPeriodInSecs;
+ if (SecurityConstantsBridge.defaultCacheFlushPeriod == 0 && authCacheFlushThread != null)
+ {
+ authCacheFlushThread.interrupt();
+ authCacheFlushThread = null;
+ }
+ if (SecurityConstantsBridge.defaultCacheFlushPeriod > 0 && authCacheFlushThread == null)
+ {
+ authCacheFlushThread = new AuthenticationCacheFlushThread(securityMgrMap);
+ authCacheFlushThread.start();
+ }
}
@ManagementOperation(description = "Create the context for the specified security domain",
@@ -571,7 +581,7 @@
public void start()
{
// start the authentication cache flush thread
- if (SecurityConstantsBridge.defaultCacheFlushPeriod > 0)
+ if (SecurityConstantsBridge.defaultCacheFlushPeriod > 0 && authCacheFlushThread == null)
{
authCacheFlushThread = new AuthenticationCacheFlushThread(securityMgrMap);
authCacheFlushThread.start();
@@ -581,6 +591,9 @@
public void stop()
{
if (authCacheFlushThread != null)
+ {
authCacheFlushThread.interrupt();
+ authCacheFlushThread = null;
+ }
}
}
\ No newline at end of file
Modified: trunk/security/src/main/java/org/jboss/security/plugins/JaasSecurityManagerService.java
===================================================================
--- trunk/security/src/main/java/org/jboss/security/plugins/JaasSecurityManagerService.java 2009-10-06 17:52:47 UTC (rev 94425)
+++ trunk/security/src/main/java/org/jboss/security/plugins/JaasSecurityManagerService.java 2009-10-06 18:04:01 UTC (rev 94426)
@@ -316,7 +316,7 @@
public void setDefaultCacheFlushPeriod(int flushPeriodInSecs)
{
this.defaultCacheFlushPeriod = flushPeriodInSecs;
- SecurityConstantsBridge.defaultCacheFlushPeriod = flushPeriodInSecs;
+ JNDIBasedSecurityManagement.setDefaultCacheFlushPeriod(flushPeriodInSecs);
}
/** flush the cache policy for the indicated security domain if one exists.
More information about the jboss-cvs-commits
mailing list