Expresso Job ControlThe Job Handler component is a server-side thread (can also be run in a seperate VM if desired) that runs tasks according to entries in a job queue. These jobs may be run sequentially (single threaded) or in parallel (multi threaded), depending on the nature of the job.
Expresso Components Listing |
|||||||||||||||||
IntroductionAs a server side process, a job can be queued by means of a user request (by a servlet) or by means of a simple batch file, which can be triggered by an operating system scheduler to provide scheduled jobs - for example a certain job to run a report might be triggered every night at 10PM. Jobs typically send notice of their results via the event mechanism, and system error events are automatically triggered if a problem occurs. Jobs are submitted to the queue either by:
|
|
|
|||||||||||||||
Job QueueThe basic mechanism involved is a "job queue". A job is queued by creating a new entry in the job queue and marking it as "available". A job can also have parameters associated with it to control it's functions, much like arguments to a method. Job HandlerThere are one or more "job handler" objects running on the server side, waiting for jobs to enter the queue - when they do, a job handler picks up the job & begins to process it - which job handler does this can be controller so that different jobs run on different systems, for performance reasons if so desired. Each job handler may process either a single job or can run a set number of jobs in parallel, and each job can be designated as "single-threaded" (e.g. should not be run in parallel with other jobs) or "multi-threaded". The job-handler objects can also be implemented as either stateful or stateless
Session EJB's, allowing business logic to be developed with all of the
advantages of Enterprise JavaBeans. Starting the Job HandlerNormally the JobHandler is run as a separate thread in your application server's JVM by adding the 'startJobHandler=y' property to your default.properties (or other property) file. In order to start the Job Handler in a seperate JVM, you must issue a command line on your server system. It is almost always convenient to package up this command line into a batch or shell script file (depending on your operating system), so that it can be run again easily. An example Job Handler shell script is shown here (the text is all one line in the shell script, but broken into multiple lines here for readability): /usr/java/jdk1.2.2/bin/java -classpath /usr/orion/orion/orion.jar:/usr/java/lib/mail.jar:/usr/java/lib/activation.jar:/usr/java/lib:/usr/java/jdk1.2.2/lib/tools.jar com.jcorporate.expresso.core.utility.JobHandler configDir=/usr/expresso/config webAppDir=/usr/web-apps/expresso This example uses the JDK1.2.2 runtime and the servlet API libraries in the Orion Application Server, assumes that "default.properties" is in the specified configDir directory. Running this script produces output to the standard output, so it is recommended that it be run with the nohup command, or that it's output be redirected. This script can of course be altered for the specific directories and libraries that you are using, and broken into multiple lines if desired. The Job Handler is ordinarily left running whenever the server is up, so that Jobs receive immediate consideration based on their priorities. Please see the Operation page for information about queueing a test job to verify that the Job Handler is fully operational. You can now continue with the Setup page. Job OrderJobs are handled in priority order, and a job can be suspended and it's priority changed even once it has begun running. Certain jobs can be set to process at only specified times, deferring process-intensive tasks until off-peak hours if so desired. Jobs frequently trigger event notifications when they are complete or when problems occur. Job Scheduling FeaturesSubmit new job
Controlling jobs
Job Scheduling ParametersThe setJobCronParams method can accept the following values for it's
parameters:
ConclusionFor technical information about how to use Job Control, please refer to
the Expresso Developers Guide (EDG) or the Javadocs. |
|||||||||||||
|
Home | Products | Services | Partners | Customers | About Us | Login | Forums | Contact Us |
Copyright © 2001-2002 Jcorporate Ltd. All rights reserved. Copyright Privacy
Last Modified: 07-Oct-02 9:43:59 PM