I will be using JDBC Store for Quartz, which will allow me to execute jobs in Cluster environment. In addition, I have also included a Job Listener that will update job execution status in database table, which will help integrate with External Scheduler systems. Many companies have Enterprise Schedulers that control Jobs across various systems. Most of the time, these Enterprise Schedulers would call Shell scripts, and even if they can invoke Web Services, it is better to setup Asynchronous execution to avoid time outs. This approach will also be useful if you don't have an Enterprise Scheduler, in which case Quartz can act as your master scheduler.
1. Install Quart Libraries (1.6.4) in JDeveloper
- Download - "myextensionsV2.zip".
- Unzip downloaded myextensionsV2.zip in c:\temp.
- Using command prompt, go to c:\temp\myextensions.
- First set JDEVELOPER11_INSTALL_HOME environment variable, which should point to your JDeveloper installation. For example, set JDEVELOPER11_INSTALL_HOME=c:\jdeveloper
- You can now run setup.bat file to install Jersey Library in your JDeveloper installation.
2. Create Scheduler tables
- Download quartz-base.sql and quartz-myextension.sql.
- Create SCHEDULER user using welcome1 password.
- Create Database Objects using quartz-base.sql and quartz-myextension.sql.
- This will create necessary tables for Quartz and my extension table for Job Listener.
- Download - Example3.zip
- Unzip Example3.zip and Open using JDeveloper (18.104.22.168.0)
- Perform Make All using Build menu.
- Run MyDummyServlet. This is just to start Embedded WebLogic Server.
- As Server starts, it will also start Quartz Scheduler, which is configured by QuartzInitializerServlet in web.xml.
- When application and scheduler is started, you will see a new row in SCHEDULER.MY_SCHEDULER_STATE table.
- Run ExecuteJob.java. This will schedule a Job in database, which will be picked up by running Quartz Scheduler in Embedded WebLogic Server.
- You will notice output message in console.
- While job is running, monitor SCHEDULER.MY_JOB_LISTENER table, you will notice State column value will change as Job State changes from Executing to Complete.
- You can create proper implementation of ExecuteJob.java. For example,
- supply Input parameters to Job, using JobDataMap.
- Poll MY_JOB_LISTENER for Status of Job - complete or error.
- Create Shell script wrapper, which can be executed by External Scheduler.
- You can create generic implementation of AMInvokeJob, that can take Application Module Definition and Operation Name as input, to invoke any Application Module's method.