KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > security > SecurityRolesAssociation


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.security;
9
10 import java.util.Map JavaDoc;
11
12 /**
13  * The SecurityRolesAssociation uses a ThreadLocal to accociatw the SecurityRoleMetaData
14  * from the deployment with the current thread.
15  *
16  * @author Thomas.Diesler@jboss.org
17  * @version $Revision: 1.1 $
18  */

19 public final class SecurityRolesAssociation
20 {
21    /** Thread local that holds the deployment security roles */
22    private static ThreadLocal JavaDoc threadSecurityRoleMapping = new ThreadLocal JavaDoc();
23
24    /**
25     * Get the current map of SecurityRoleMetaData.
26     * @return A Map that stores SecurityRoleMetaData by roleName
27     */

28    public static Map JavaDoc getSecurityRoles()
29    {
30       return (Map JavaDoc) threadSecurityRoleMapping.get();
31    }
32
33    /**
34     * Get the current map of SecurityRoleMetaData.
35     */

36    public static void setSecurityRoles(Map JavaDoc securityRoles)
37    {
38       threadSecurityRoleMapping.set(securityRoles);
39    }
40
41 }
42
Popular Tags