User: starksm
Date: 01/07/28 19:28:52
Modified: src/main/org/jboss/security/plugins
JaasSecurityManagerService.java
JaasSecurityManagerServiceMBean.java
Log:
Add method to flush the authentication cache of a security domain
Revision Changes Path
1.4 +24 -3
jbosssx/src/main/org/jboss/security/plugins/JaasSecurityManagerService.java
Index: JaasSecurityManagerService.java
===================================================================
RCS file:
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/plugins/JaasSecurityManagerService.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JaasSecurityManagerService.java 2001/07/27 04:18:13 1.3
+++ JaasSecurityManagerService.java 2001/07/29 02:28:52 1.4
@@ -126,12 +126,33 @@
{
this.cacheJndiName = jndiName;
}
-
+ /** flush the cache policy for the indicated security domain if the security
manager
+ * instance supports a flushCache() method.
+ */
+ public void flushAuthenticationCache(String securityDomain)
+ {
+ String jndiName = "java:/jaas/" + securityDomain;
+ try
+ {
+ InitialContext ic = new InitialContext();
+ Object securityMgr = ic.lookup(jndiName);
+ Class clazz = securityMgr.getClass();
+ Class[] argTypes = {};
+ Method flush = clazz.getMethod("flushCache", argTypes);
+ Object[] args = {};
+ flush.invoke(securityMgr, args);
+ }
+ catch(Exception e)
+ {
+ log.error("flushAuthenticationCache failed", e);
+ }
+ }
+
public String getName()
{
return "JAAS Security Manager";
}
-
+
protected ObjectName getObjectName(MBeanServer server, ObjectName name)
throws MalformedObjectNameException
{
@@ -183,7 +204,7 @@
log.error("stopService", e);
}
}
-
+
// ObjectFactory implementation ----------------------------------
public static class SecurityDomainObjectFactory implements InvocationHandler,
ObjectFactory
1.2 +4 -0
jbosssx/src/main/org/jboss/security/plugins/JaasSecurityManagerServiceMBean.java
Index: JaasSecurityManagerServiceMBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/plugins/JaasSecurityManagerServiceMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JaasSecurityManagerServiceMBean.java 2001/04/11 01:54:46 1.1
+++ JaasSecurityManagerServiceMBean.java 2001/07/29 02:28:52 1.2
@@ -36,4 +36,8 @@
is found
*/
public void setAuthenticationCacheJndiName(String jndiName);
+ /** flush the cache policy for the indicated security domain if the security
manager
+ instance supports a flushCache() method.
+ */
+ public void flushAuthenticationCache(String securityDomain);
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development