org.ow2.jonas.lib.execution
Class RunnableHelper

java.lang.Object
  extended by org.ow2.jonas.lib.execution.RunnableHelper

public final class RunnableHelper
extends Object

Helps to run blocks of code under a controlled environment.

Author:
Guillaume Sauthier

Method Summary
static
<T> ExecutionResult<T>
execute(ClassLoader loader, IExecution<T> exec)
          Run a code block in the context of a given ClassLoader.
static ClassLoader getThreadContextClassLader()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public static <T> ExecutionResult<T> execute(ClassLoader loader,
                                             IExecution<T> exec)
Run a code block in the context of a given ClassLoader.

Type Parameters:
T - execution result type.
Parameters:
loader - The ClassLoader to be used as TCCL.
exec - code block.
Returns:
the result of this execution.

getThreadContextClassLader

public static ClassLoader getThreadContextClassLader()
Returns:
Return the current Thread context ClassLoader (using a priviledged block).


Copyright © 2010 OW2 Consortium. All Rights Reserved.