org.eclipse.emf.transaction
Class RunnableWithResult.Impl

java.lang.Object
  extended by org.eclipse.emf.transaction.RunnableWithResult.Impl
All Implemented Interfaces:
Runnable, RunnableWithResult
Direct Known Subclasses:
PrivilegedRunnable
Enclosing interface:
RunnableWithResult

public abstract static class RunnableWithResult.Impl
extends Object
implements RunnableWithResult

A convenient partial implementation of the RunnableWithResult interface that implements a settable result field and commit status.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.transaction.RunnableWithResult
RunnableWithResult.Impl
 
Constructor Summary
RunnableWithResult.Impl()
           
 
Method Summary
 Object getResult()
          Returns a result computed by my Runnable.run() method.
 IStatus getStatus()
          Queries my commit status.
protected  void setResult(Object result)
          Sets my result.
 void setStatus(IStatus status)
          Sets the commit status after completion of the Runnable.run() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

RunnableWithResult.Impl

public RunnableWithResult.Impl()
Method Detail

setResult

protected final void setResult(Object result)
Sets my result.

Parameters:
result - my result

getStatus

public final IStatus getStatus()
Description copied from interface: RunnableWithResult
Queries my commit status. My status is only available after I have finished running and after the editing domain has attempted to commit my transaction.

Specified by:
getStatus in interface RunnableWithResult
Returns:
the status of my commit (as set by the RunnableWithResult.setStatus(IStatus) method)

getResult

public final Object getResult()
Description copied from interface: RunnableWithResult
Returns a result computed by my Runnable.run() method.

Specified by:
getResult in interface RunnableWithResult
Returns:
my result, or null if none

setStatus

public final void setStatus(IStatus status)
Description copied from interface: RunnableWithResult
Sets the commit status after completion of the Runnable.run() method.

Specified by:
setStatus in interface RunnableWithResult
Parameters:
status - an OK status if commit succeeds, or an error status if it fails (in which case the transaction rolled back and the status provides details in human-readable form)

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.