org.eclipse.gemini.blueprint.util.internal
Class PrivilegedUtils

java.lang.Object
  extended by org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils

public abstract class PrivilegedUtils
extends Object

Utility class for commons actions used within PrivilegedBlocks.

Author:
Costin Leau

Nested Class Summary
static interface PrivilegedUtils.UnprivilegedExecution<T>
           
static interface PrivilegedUtils.UnprivilegedThrowableExecution<T>
           
 
Constructor Summary
PrivilegedUtils()
           
 
Method Summary
static
<T> T
executeWithCustomTCCL(ClassLoader customClassLoader, PrivilegedUtils.UnprivilegedExecution<T> execution)
          Temporarily changes the TCCL to the given one for the duration of the given execution.
static
<T> T
executeWithCustomTCCL(ClassLoader customClassLoader, PrivilegedUtils.UnprivilegedThrowableExecution<T> execution)
          Temporarily changes the TCCL to the given one for the duration of the given execution.
static ClassLoader getTCCL()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivilegedUtils

public PrivilegedUtils()
Method Detail

getTCCL

public static ClassLoader getTCCL()

executeWithCustomTCCL

public static <T> T executeWithCustomTCCL(ClassLoader customClassLoader,
                                          PrivilegedUtils.UnprivilegedExecution<T> execution)
Temporarily changes the TCCL to the given one for the duration of the given execution. All actions except the execution are executed with privileged access. Consider checking if there is a security manager in place before calling this method.

Parameters:
customClassLoader -
execution -
Returns:

executeWithCustomTCCL

public static <T> T executeWithCustomTCCL(ClassLoader customClassLoader,
                                          PrivilegedUtils.UnprivilegedThrowableExecution<T> execution)
                               throws Throwable
Temporarily changes the TCCL to the given one for the duration of the given execution. All actions except the execution are executed with privileged access. Consider checking if there is a security manager in place before calling this method.

Parameters:
customClassLoader -
execution -
Returns:
Throws:
Throwable


Copyright © 2006-2012. All Rights Reserved.