org.apache.sling.event.impl.jobs
Class BackgroundLoader

java.lang.Object
  extended by org.apache.sling.event.impl.jobs.BackgroundLoader
All Implemented Interfaces:
Runnable

public class BackgroundLoader
extends Object
implements Runnable

Task for loading stored jobs from the resource tree. This component starts a background thread. The thread is only active when a stable topology view is available. Whenever the component gets activated, it loads all jobs from the resource tree. New incoming jobs are handled via a queue.


Constructor Summary
BackgroundLoader(JobManagerImpl jobManagerImpl, JobManagerConfiguration configuration2, org.apache.sling.api.resource.ResourceResolverFactory resourceResolverFactory2)
          Create and activate the loader.
 
Method Summary
 void addJob(JobImpl job)
          Add a job to the load job queue if the instance is running.
 void deactivate()
          Deactivate the loader.
 void loadJob(String path)
          Add a path to the load job queue if the instance is running.
 void restart()
          Restart if the instance is currently running.
 void run()
           
 void start()
          Start the background loader process.
 void stop()
          Stop the background loader process.
 void tryToReloadUnloadedJobs()
          Try to reload unloaded jobs - this method is invoked if bundles have been added etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackgroundLoader

public BackgroundLoader(JobManagerImpl jobManagerImpl,
                        JobManagerConfiguration configuration2,
                        org.apache.sling.api.resource.ResourceResolverFactory resourceResolverFactory2)
Create and activate the loader.

Method Detail

deactivate

public void deactivate()
Deactivate the loader.


start

public void start()
Start the background loader process.


stop

public void stop()
Stop the background loader process.


restart

public void restart()
Restart if the instance is currently running.


run

public void run()
Specified by:
run in interface Runnable

tryToReloadUnloadedJobs

public void tryToReloadUnloadedJobs()
Try to reload unloaded jobs - this method is invoked if bundles have been added etc.


loadJob

public void loadJob(String path)
Add a path to the load job queue if the instance is running.


addJob

public void addJob(JobImpl job)
Add a job to the load job queue if the instance is running.



Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.