com.norconex.jef
Class AsyncLimitedJobGroup

java.lang.Object
  extended by com.norconex.jef.AbstractJobGroup
      extended by com.norconex.jef.AsyncJobGroup
          extended by com.norconex.jef.AsyncLimitedJobGroup
All Implemented Interfaces:
IJob, IJobGroup

public class AsyncLimitedJobGroup
extends AsyncJobGroup

Job responsible for running a group of jobs asynchronously with only so many jobs running at the same time. The maximum number of job is started and once one is completed, another is started. The progress of this group reflects the average progress of all its jobs. This job group is considered completed and will only return when all its jobs are done executing. An exception in one job will not stop the other jobs in the group from running. On the other hand, one or more exception will result in this group to fail.

Since:
1.1.1
Author:
David Gaulin (david.gaulin@norconex.com)

Constructor Summary
AsyncLimitedJobGroup(String id, int maxNumberOfRunningJobs, IJob... jobs)
          Constructor.
AsyncLimitedJobGroup(String id, int maxNumberOfRunningJobs, String description, IJob... jobs)
          Constructor.
 
Method Summary
 void execute(JobProgress progress, JobSuite suite)
          Executes this job.
 
Methods inherited from class com.norconex.jef.AbstractJobGroup
createJobContext, getId, getJobs, registerGroupProgressMonitoring, stop, unregisterGroupProgressMonitoring
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncLimitedJobGroup

public AsyncLimitedJobGroup(String id,
                            int maxNumberOfRunningJobs,
                            IJob... jobs)
Constructor.

Parameters:
id - unique identifier for this job group
jobs - jobs making up this group

AsyncLimitedJobGroup

public AsyncLimitedJobGroup(String id,
                            int maxNumberOfRunningJobs,
                            String description,
                            IJob... jobs)
Constructor.

Parameters:
id - unique identifier for this job group
jobs - jobs making up this group
Method Detail

execute

public final void execute(JobProgress progress,
                          JobSuite suite)
Description copied from interface: IJob
Executes this job. Implementors are responsible for updating execution progress on the given JobProgress.

Specified by:
execute in interface IJob
Overrides:
execute in class AsyncJobGroup
Parameters:
progress - current job progress
suite - job suite this job is part of


Copyright © 2007-2013 Norconex Inc.. All Rights Reserved.