org.figure8.join.services.scripting
Class ScriptLauncherQuartzAdapter

java.lang.Object
  extended by org.figure8.join.services.scripting.ScriptLauncherAdapterSupport
      extended by org.figure8.join.services.scripting.ScriptLauncherQuartzAdapter
All Implemented Interfaces:
Configurable, org.quartz.Job
Direct Known Subclasses:
AntScriptLauncherQuartzAdapter, GroovyScriptLauncherQuartzAdapter, JSR223ScriptLauncherQuartzAdapter, RubyScriptLauncherQuartzAdapter

public abstract class ScriptLauncherQuartzAdapter
extends ScriptLauncherAdapterSupport
implements org.quartz.Job

This is a base class for Quartz jobs that wants to launch script when the time scheduled with cron arrive. It acts as an adapter between the scheduled batch world and the ScriptLauncher facilities.
This class is a Quartz Job that is Configurable.

Version:
$Revision: 1.2 $
Author:
Jerome Evrard
See Also:
Configurable

Field Summary
 
Fields inherited from class org.figure8.join.services.scripting.ScriptLauncherAdapterSupport
name
 
Constructor Summary
ScriptLauncherQuartzAdapter()
           
 
Method Summary
protected  void configureJobFromContext(org.quartz.JobExecutionContext context)
          Configure this job instance using the QuartzCronParameterInfo that may be present into the execution context.
 void execute(org.quartz.JobExecutionContext context)
          This method is executed when scheduled time is reached.
protected  java.lang.Object getParameterFromContext(java.lang.String key, org.quartz.JobExecutionContext context)
          This is a convenient method for retrieving a cron parameter value from context.
 
Methods inherited from class org.figure8.join.services.scripting.ScriptLauncherAdapterSupport
createNewLogFile, getName, getParameterDefinitions, getParameterDefinitionsAsList, getScriptLauncher, saveLogInfoIfAvailable, setName, setParameter, setParameter, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptLauncherQuartzAdapter

public ScriptLauncherQuartzAdapter()
Method Detail

execute

public void execute(org.quartz.JobExecutionContext context)
             throws org.quartz.JobExecutionException
This method is executed when scheduled time is reached.

Specified by:
execute in interface org.quartz.Job
Parameters:
context - The execution context of the job (contains job's user parameters)
Throws:
org.quartz.JobExecutionException

getParameterFromContext

protected java.lang.Object getParameterFromContext(java.lang.String key,
                                                   org.quartz.JobExecutionContext context)
This is a convenient method for retrieving a cron parameter value from context.

Parameters:
key - The key of cron parameter to retrieve.
context - The job context to retrieve parameter from
Returns:
An object representing Quartz Cron parameter value

configureJobFromContext

protected void configureJobFromContext(org.quartz.JobExecutionContext context)
                                throws InvalidParameterException
Configure this job instance using the QuartzCronParameterInfo that may be present into the execution context. This may be necessary because when launched by a scheduler, job instance is not directly available so configuration parameters may be passed using the job details data map.

Parameters:
context -
Throws:
InvalidParameterException


Copyright © 2005-2008 Join. All Rights Reserved.