org.figure8.join.services.scripting
Class ScriptLauncherAdapterSupport

java.lang.Object
  extended by org.figure8.join.services.scripting.ScriptLauncherAdapterSupport
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
ScriptLauncherJMSAdapter, ScriptLauncherQuartzAdapter

public abstract class ScriptLauncherAdapterSupport
extends java.lang.Object
implements Configurable

This is a support class to extend for classes wanting to launch scripts.

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux

Field Summary
protected  java.lang.String name
          The name identifying this script adapter.
 
Constructor Summary
ScriptLauncherAdapterSupport()
           
 
Method Summary
protected  java.io.File createNewLogFile()
           
 java.lang.String getName()
          Retrieve the name of this consumer.
 ParameterDefinition[] getParameterDefinitions()
          Get this object parameters definitions as an array
 java.util.List getParameterDefinitionsAsList()
          Get this object parameters definitions as a list
abstract  ScriptLauncher getScriptLauncher()
          Subclasses must implement this method in order to specify the ScriptLauncher implementation to use (and thus the scripting language).
protected  boolean saveLogInfoIfAvailable(ScriptLogInfo logInfo)
          Save a ScriptLogInfo into datastore if a DAO if available
 void setName(java.lang.String name)
          Set the name identifying this consumer.
 void setParameter(ParameterDefinition parameter, java.lang.String parameterValue)
          Set the value of a parameter using its definition.
 void setParameter(java.lang.String parameterName, java.lang.String parameterValue)
          Set the value of a parameter using its name
 void setParameters(java.util.Properties parameters)
          Convenient methods for setting all attributes values using a single method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The name identifying this script adapter.

Constructor Detail

ScriptLauncherAdapterSupport

public ScriptLauncherAdapterSupport()
Method Detail

getName

public java.lang.String getName()
Retrieve the name of this consumer.

Returns:
The name identifying this consumer

setName

public void setName(java.lang.String name)
Set the name identifying this consumer.

Parameters:
name - The name of this consumer

getScriptLauncher

public abstract ScriptLauncher getScriptLauncher()
Subclasses must implement this method in order to specify the ScriptLauncher implementation to use (and thus the scripting language).

Returns:
The script launcher implementation

getParameterDefinitionsAsList

public java.util.List getParameterDefinitionsAsList()
Get this object parameters definitions as a list

Specified by:
getParameterDefinitionsAsList in interface Configurable
Returns:
A list of ParameterDefinition objects

getParameterDefinitions

public ParameterDefinition[] getParameterDefinitions()
Get this object parameters definitions as an array

Specified by:
getParameterDefinitions in interface Configurable
Returns:
An array of ParameterDefinition objects

setParameter

public void setParameter(java.lang.String parameterName,
                         java.lang.String parameterValue)
                  throws InvalidParameterException
Set the value of a parameter using its name

Specified by:
setParameter in interface Configurable
Parameters:
parameterName - The name of parameter so set value for
parameterValue - The value of the paramater
Throws:
InvalidParameterException - if this parameter is not supported by this object

setParameter

public void setParameter(ParameterDefinition parameter,
                         java.lang.String parameterValue)
                  throws InvalidParameterException
Set the value of a parameter using its definition. Implementation delegates the setting of parameter to setParameter(String, String) so that subclasses may not ovveride this implementation.

Specified by:
setParameter in interface Configurable
Parameters:
parameter - The definitino of the paramater to set
parameterValue - The value of the parameter
Throws:
InvalidParameterException - if this parameter is not supported by this object

setParameters

public void setParameters(java.util.Properties parameters)
                   throws InvalidParameterException
Convenient methods for setting all attributes values using a single method.

Specified by:
setParameters in interface Configurable
Parameters:
parameters - Properties where keys are parameter names
Throws:
InvalidParameterException - if one of these parameters is not supported by this object

createNewLogFile

protected java.io.File createNewLogFile()

saveLogInfoIfAvailable

protected boolean saveLogInfoIfAvailable(ScriptLogInfo logInfo)
Save a ScriptLogInfo into datastore if a DAO if available

Parameters:
logInfo - The bean representing log info to save
Returns:
true if save has been done, false otherwise


Copyright © 2005-2008 Join. All Rights Reserved.