User: starksm Date: 01/07/28 19:22:28 Modified: src/main/org/jboss/security/plugins Tag: Branch_2_4 JaasSecurityManagerService.java JaasSecurityManagerServiceMBean.java Log: Add method to flush the authentication cache of a security domain Revision Changes Path No revision No revision 1.2.2.3 +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.2.2.2 retrieving revision 1.2.2.3 diff -u -r1.2.2.2 -r1.2.2.3 --- JaasSecurityManagerService.java 2001/07/27 03:38:32 1.2.2.2 +++ JaasSecurityManagerService.java 2001/07/29 02:22:28 1.2.2.3 @@ -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.1.2.1 +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.1.2.1 diff -u -r1.1 -r1.1.2.1 --- JaasSecurityManagerServiceMBean.java 2001/04/11 01:54:46 1.1 +++ JaasSecurityManagerServiceMBean.java 2001/07/29 02:22:28 1.1.2.1 @@ -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