org.pf.tools.cda.core.init
Class WorksetInitializer

java.lang.Object
  extended by org.pf.tools.cda.core.init.WorksetInitializer
All Implemented Interfaces:
IRunnableTerminationListener

public class WorksetInitializer
extends java.lang.Object
implements IRunnableTerminationListener

This is a controller that is responsible to initialize a particular workset.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
WorksetInitializer(Workset ws)
          Initialize the new instance with default values.
 
Method Summary
 void addCallback(AWorksetInitializationEventCallback callback)
          Adds a callback that gets invoked about a specific event during the initialization progress.
 void addListener(IWorksetInitializationListener listener)
          Adds a listener that gets informed about the initialization progress.
 void cancel()
          Cancel all initialization immediately.
 Workset getWorkset()
           
 void initializeWorkset(IProgressMonitor monitor)
          Initializes the underlying workset using background threads.
 void initializeWorksetAndWait(IProgressMonitor monitor)
          Initializes the underlying workset using background threads.
static void initWorksetAndWait(Workset aWorkset)
           
 void release()
           
 void runnableFinished(java.lang.Runnable runnable, boolean aborted)
          Gets called when a runnable ends its run() method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorksetInitializer

public WorksetInitializer(Workset ws)
Initialize the new instance with default values.

Method Detail

getWorkset

public Workset getWorkset()

initWorksetAndWait

public static void initWorksetAndWait(Workset aWorkset)

addListener

public void addListener(IWorksetInitializationListener listener)
Adds a listener that gets informed about the initialization progress. If the given listener is null it will be ignored.


addCallback

public void addCallback(AWorksetInitializationEventCallback callback)
Adds a callback that gets invoked about a specific event during the initialization progress. If the given callback is null it will be ignored.


initializeWorkset

public void initializeWorkset(IProgressMonitor monitor)
Initializes the underlying workset using background threads. That is, this method returns before the initialization has been completed!


initializeWorksetAndWait

public void initializeWorksetAndWait(IProgressMonitor monitor)
Initializes the underlying workset using background threads. That is, this method returns before the initialization has been completed!


cancel

public void cancel()
Cancel all initialization immediately.


release

public void release()

runnableFinished

public void runnableFinished(java.lang.Runnable runnable,
                             boolean aborted)
Gets called when a runnable ends its run() method.

Specified by:
runnableFinished in interface IRunnableTerminationListener
Parameters:
runnable - The runnable that is calling this method
aborted - If true the runnable was stopped somehow before completing its task