[jboss-cvs] JBossAS SVN: r69630 - projects/security/security-spi/trunk/spi/src/main/org/jboss/security.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 5 16:57:16 EST 2008


Author: anil.saldhana at jboss.com
Date: 2008-02-05 16:57:15 -0500 (Tue, 05 Feb 2008)
New Revision: 69630

Added:
   projects/security/security-spi/trunk/spi/src/main/org/jboss/security/SecurityContextAssociation.java
Log:
SECURITY-115: SecCtxAssociation to spi

Added: projects/security/security-spi/trunk/spi/src/main/org/jboss/security/SecurityContextAssociation.java
===================================================================
--- projects/security/security-spi/trunk/spi/src/main/org/jboss/security/SecurityContextAssociation.java	                        (rev 0)
+++ projects/security/security-spi/trunk/spi/src/main/org/jboss/security/SecurityContextAssociation.java	2008-02-05 21:57:15 UTC (rev 69630)
@@ -0,0 +1,52 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.security;
+ 
+import org.jboss.security.SecurityContext;
+
+//$Id$
+
+/**
+ *  Security Context association in a threadlocal
+ *  @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
+ *  @since  Dec 27, 2006 
+ *  @version $Revision$
+ */
+public class SecurityContextAssociation
+{
+   private static ThreadLocal<SecurityContext> securityContextLocal = new ThreadLocal<SecurityContext>();
+   
+   public static void setSecurityContext(SecurityContext sc)
+   {
+      securityContextLocal.set(sc);
+   }
+   
+   public static SecurityContext getSecurityContext()
+   {
+      return securityContextLocal.get();
+   } 
+   
+   public static void clearSecurityContext() 
+   {
+      securityContextLocal.set(null);
+   }
+}




More information about the jboss-cvs-commits mailing list