Norconex JEF API

Getting Started

To make the best use of the JEF API (version 4.x), you have to carefully identify all tasks that makes up your program execution workflow. All these tasks are refered to as "jobs". Jobs are assembled together to obtain the desired workflow, refered to as a "Job Suite".

First wrap your existing jobs, or create new ones implementing the IJob interface to accomplish the required tasks. Whenever you have more than one job, assemble/group them together using one or a combination of AsyncJobGroup and SyncJobGroup.

Create and configure a IJobSuite with your created jobs. It is highly recommended you job suite creation logic is implemented using IJobSuiteFactory. Using this factory is the preferred way to load and initialize your job suites by external processes.

When you are done, you can execute it by calling the "execute" method on your JobSuite instance.

Optionally, you can attach listeners to get notified of every job-related events. Listners and other useful classes can be found in the JEF API.

Code Sample

The creation of a job suite may look like this:
public class MyJobSuiteFactory implements IJobSuiteFactory {
 
    public JobSuite createJobSuite() {
        IJob rootJob = new AsyncJobGroup("asyncGroupSample", new IJob[] {
                new MyJobA(),
                new SyncJobGroup("syncGroupSample", new IJob[] {
                        new MyJobB(),
                        new MyJobC()
                }),    
                new MyJobD(),
                new MyJobE()),
        });
        JobSuite suite = new JobSuite(rootJob);
 
        // add any listners/handlers to the suite
 
        return suite;
    }
}
Then to launch the execution of a the job suite:
IJobSuiteFactory factory = new MyJobSuiteFactory();
JobSuite suite = factory.createJobSuite();
suite.execute();