Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.util.ThreadUtils Class Reference

List of all members.

Static Public Member Functions

static Runnable wrapSafe (Logger log, final Runnable runnable)
static Thread runSafeAsync (String name, final Logger log, final Runnable runnable)
static Thread runSafeAsync (final Logger log, final Runnable runnable)
static void runSafeSync (Logger log, Runnable runnable)

Member Function Documentation

static Thread de.fu_berlin.inf.dpp.util.ThreadUtils.runSafeAsync ( String  name,
final Logger  log,
final Runnable  runnable 
) [static]

Run the given runnable in a new thread (with the given name) and log any RuntimeExceptions to the given log.

Returns:
The Thread which has been created and started to run the given runnable
static Thread de.fu_berlin.inf.dpp.util.ThreadUtils.runSafeAsync ( final Logger  log,
final Runnable  runnable 
) [static]

Run the given runnable in a new thread and log any RuntimeExceptions to the given log.

Returns:
The Thread which has been created and started to run the given runnable.
static void de.fu_berlin.inf.dpp.util.ThreadUtils.runSafeSync ( Logger  log,
Runnable  runnable 
) [static]

Run the given runnable (in the current thread!) and log any RuntimeExceptions to the given log and block until the runnable returns.

static Runnable de.fu_berlin.inf.dpp.util.ThreadUtils.wrapSafe ( Logger  log,
final Runnable  runnable 
) [static]

Return a new Runnable which runs the given runnable but catches all RuntimeExceptions and logs them to the given log.

Errors are logged and re-thrown.

This method does NOT actually run the given runnable, but only wraps it.

Parameters:
logThe log to print any exception messages thrown which occur when running the given runnable or null
 All Classes Namespaces Files Functions Variables Enumerations