org.eclipse.emf.emfstore.client.util
Class RunESCommand.WithException

java.lang.Object
  extended by org.eclipse.emf.emfstore.client.util.RunESCommand.WithException
Enclosing class:
RunESCommand

public static class RunESCommand.WithException
extends Object

The Callable to be executed may throw an exception.


Constructor Summary
RunESCommand.WithException()
           
 
Method Summary
static
<T extends Exception>
void
run(Class<T> exceptionType, Callable<Void> callable)
          Executes the given Callable and returns the result.
static
<T,E extends Exception>
T
runWithResult(Class<E> exceptionType, Callable<T> callable)
          Executes the given @link Callable} and returns the result.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunESCommand.WithException

public RunESCommand.WithException()
Method Detail

runWithResult

public static <T,E extends Exception> T runWithResult(Class<E> exceptionType,
                                                      Callable<T> callable)
                       throws E extends Exception
Executes the given @link Callable} and returns the result.

Type Parameters:
E - Exception in case an error occurs during execution of the Callable
T - the return type of the Callable
Parameters:
callable - the callable to be execued
exceptionType - the type of the exception that might be thrown during execution
Returns:
the return value of the Callable
Throws:
E - on execution failure
E extends Exception

run

public static <T extends Exception> void run(Class<T> exceptionType,
                                             Callable<Void> callable)
                throws T extends Exception
Executes the given Callable and returns the result.

Type Parameters:
T - the exception type
Parameters:
callable - the callable to be executed
exceptionType - the type of the exception
Throws:
T - in case an error occurs during execution of the callable
T extends Exception


Copyright © 2015. All Rights Reserved.