org.eclipse.emf.emfstore.internal.client.common
Class UnknownEMFStoreWorkloadCommand<T>

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.common.UnknownEMFStoreWorkloadCommand<T>
Type Parameters:
T - the return type of the command's run method

public abstract class UnknownEMFStoreWorkloadCommand<T>
extends Object

This class provides a way to indicate the progress of a command without knowing the actual workload, i.e. the IProgressMonitor instance that is passed to the run method is incremented every

Author:
emueller

Constructor Summary
UnknownEMFStoreWorkloadCommand(org.eclipse.core.runtime.IProgressMonitor monitor)
          Constructor.
 
Method Summary
 T execute()
          Executes the command.
 int getWorked()
          Returns how many ticks the command has incremented the monitor.
abstract  T run(org.eclipse.core.runtime.IProgressMonitor monitor)
          The actual behavior of the command that is meant to be implemented by clients.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnknownEMFStoreWorkloadCommand

public UnknownEMFStoreWorkloadCommand(org.eclipse.core.runtime.IProgressMonitor monitor)
Constructor.

Parameters:
monitor - the monitor that will be used to indicate that the command is in progress
Method Detail

execute

public T execute()
          throws ESException
Executes the command.

Returns:
the return value as determined by the run method
Throws:
ESException - in case the command throws an exception

getWorked

public int getWorked()
Returns how many ticks the command has incremented the monitor.

Returns:
amount of ticks that were incremented

run

public abstract T run(org.eclipse.core.runtime.IProgressMonitor monitor)
               throws ESException
The actual behavior of the command that is meant to be implemented by clients.

Parameters:
monitor - a progress monitor that is used to indicate
Returns:
an optional value of type T
Throws:
ESException - in case the command throws an exception


Copyright © 2015. All Rights Reserved.