[jboss-cvs] JBossAS SVN: r88581 - branches/Branch_5_x_BootstrapLegacyRemoval/main/src/main/org/jboss.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat May 9 23:32:08 EDT 2009
Author: ALRubinger
Date: 2009-05-09 23:32:07 -0400 (Sat, 09 May 2009)
New Revision: 88581
Added:
branches/Branch_5_x_BootstrapLegacyRemoval/main/src/main/org/jboss/SecurityActions.java
Log:
[JBAS-6856] Add new SecurityActions to main module
Added: branches/Branch_5_x_BootstrapLegacyRemoval/main/src/main/org/jboss/SecurityActions.java
===================================================================
--- branches/Branch_5_x_BootstrapLegacyRemoval/main/src/main/org/jboss/SecurityActions.java (rev 0)
+++ branches/Branch_5_x_BootstrapLegacyRemoval/main/src/main/org/jboss/SecurityActions.java 2009-05-10 03:32:07 UTC (rev 88581)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * SecurityActions
+ *
+ * Collection of tasks to be run under a security manager,
+ * package-private so we don't leak out.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+class SecurityActions
+{
+
+ //-------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ /**
+ * No external instanciation
+ */
+ private SecurityActions()
+ {
+
+ }
+
+ //-------------------------------------------------------------------------------||
+ // Utility Methods --------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ static ClassLoader getThreadContextClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+
+ });
+ }
+}
More information about the jboss-cvs-commits
mailing list