public class WorksetInitializer extends java.lang.Object implements IRunnableTerminationListener
Constructor and Description |
---|
WorksetInitializer(Workset ws)
Initialize the new instance with a workset.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected org.pfsw.tools.cda.core.init.DependencyResolverTask |
getClassFileLoading() |
protected org.pfsw.tools.cda.core.init.ReleasableThread |
getCurrentInitThread() |
protected java.util.List<AWorksetInitializationEventCallback> |
getEventCallbacks() |
protected java.util.List<IWorksetInitializationListener> |
getInitListeners() |
protected IProgressMonitor |
getProgressMonitor() |
Workset |
getWorkset() |
void |
initializeWorkset(IProgressMonitor monitor)
Initializes the underlying workset using background threads.
|
boolean |
initializeWorksetAndWait(IProgressMonitor monitor)
Initializes the underlying workset using background threads, but
then waits until the initialization has been completed or cancelled.
|
static boolean |
initWorksetAndWait(Workset aWorkset)
This convenience method allows to initialize the given workset using
background threads, but waiting until the initialization has been completed
or cancelled.
|
protected void |
notifyCallbacksAndListeners(IWorksetInitializationListener.EventType type)
Notifies all registered callbacks and listeners about the given event.
|
void |
release() |
void |
runnableFinished(java.lang.Runnable runnable,
boolean aborted)
Gets called when a runnable ends its run() method.
|
protected void |
setClassFileLoading(org.pfsw.tools.cda.core.init.DependencyResolverTask newValue) |
protected void |
setCurrentInitThread(org.pfsw.tools.cda.core.init.ReleasableThread currentInitThread) |
protected void |
setProgressMonitor(IProgressMonitor newValue) |
protected void |
startBackgroundContainerLookup()
Resolves all containers from the specified workset "classpath" definitions.
|
protected void |
startBackgroundContainersScanner()
Collects all packages and classes for each found container.
|
protected void |
startClassFileLoadingAndAnalyzingThread()
Loads each detected class file (i.e.
|
protected void |
startSpringBeansAnalyzingThread()
Loads each detected class file (i.e.
|
protected void |
stopAllBackgroundTasks() |
protected void |
waitUntilDone(java.util.concurrent.atomic.AtomicBoolean done) |
public WorksetInitializer(Workset ws)
public static boolean initWorksetAndWait(Workset aWorkset)
aWorkset
- The workset to be initialized (must not be null).public Workset getWorkset()
public void addListener(IWorksetInitializationListener listener)
public void addCallback(AWorksetInitializationEventCallback callback)
public void initializeWorkset(IProgressMonitor monitor)
public boolean initializeWorksetAndWait(IProgressMonitor monitor)
public void cancel()
public void release()
public void runnableFinished(java.lang.Runnable runnable, boolean aborted)
runnableFinished
in interface IRunnableTerminationListener
runnable
- The runnable that is calling this method.aborted
- If true the runnable was stopped somehow before completing its task.protected void startBackgroundContainerLookup()
The actual contents of the containers will be processed by a later initialization step.
protected void startBackgroundContainersScanner()
So, after this step, all ClassPackage and ClassInformation objects are in the underlying ClassSpace.
protected void startClassFileLoadingAndAnalyzingThread()
protected void startSpringBeansAnalyzingThread()
protected void notifyCallbacksAndListeners(IWorksetInitializationListener.EventType type)
protected void stopAllBackgroundTasks()
protected void waitUntilDone(java.util.concurrent.atomic.AtomicBoolean done)
protected IProgressMonitor getProgressMonitor()
protected void setProgressMonitor(IProgressMonitor newValue)
protected org.pfsw.tools.cda.core.init.DependencyResolverTask getClassFileLoading()
protected void setClassFileLoading(org.pfsw.tools.cda.core.init.DependencyResolverTask newValue)
protected org.pfsw.tools.cda.core.init.ReleasableThread getCurrentInitThread()
protected void setCurrentInitThread(org.pfsw.tools.cda.core.init.ReleasableThread currentInitThread)
protected java.util.List<IWorksetInitializationListener> getInitListeners()
protected java.util.List<AWorksetInitializationEventCallback> getEventCallbacks()