deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.framework.concurrent
Class ExecutionFinishedEvent<T>

java.lang.Object
  extended by org.deegree.framework.concurrent.ExecutionFinishedEvent<T>
Type Parameters:
T - type of return value

public class ExecutionFinishedEvent<T>
extends Object

Event that is sent when asynchronous task finished.

This can mean:

If the task did not finish successfully, the thrown exception / error is rethrown when getResult() is called.

Version:
$Revision: 9339 $, $Date: 2007-12-27 13:31:52 +0100 (Do, 27 Dez 2007) $
Author:
Andreas Poth, Markus Schneider, last edited by: $Author: apoth $

Constructor Summary
ExecutionFinishedEvent(java.util.concurrent.Callable task, T result)
          Constructs an ExecutionFinishedEvent for a task that finished successfully.
ExecutionFinishedEvent(Throwable t, java.util.concurrent.Callable task)
          Constructs an ExecutionFinishedEvent for a task that terminated abnormally.
 
Method Summary
 T getResult()
          Returns the result value that the finished task returned.
 java.util.concurrent.Callable getTask()
          Returns the corresponding task instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionFinishedEvent

ExecutionFinishedEvent(java.util.concurrent.Callable task,
                       T result)
Constructs an ExecutionFinishedEvent for a task that finished successfully.

Parameters:
task -
result -

ExecutionFinishedEvent

ExecutionFinishedEvent(Throwable t,
                       java.util.concurrent.Callable task)
Constructs an ExecutionFinishedEvent for a task that terminated abnormally.

Parameters:
t - Throwable that the terminated task threw
task -
Method Detail

getTask

public java.util.concurrent.Callable getTask()
Returns the corresponding task instance.

Returns:
the corresponding task instance

getResult

public T getResult()
            throws java.util.concurrent.CancellationException,
                   Throwable
Returns the result value that the finished task returned.

If the task produced an exception or error, it is rethrown here. If the task has been cancelled (usually this means that the time out occurred), a CancellationException is thrown.

Returns:
the result value that the task returned
Throws:
java.util.concurrent.CancellationException - if task timed out / has been cancelled
Throwable - if task terminated with an exception or error

deegree 2.2 (2008/12/22 11:33 build-3038-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net