*
* @return the trigger script
*/
private Object getTriggerScript(String script, String key, String[] args, int timeout)
{
final Script s = ScriptFactory.createScript(script, key, this, args, getWrapperLogger(), timeout);
if (s == null)
{
this.getWrapperLogger().info("error initializing script " + script);
return null;
}
this.getWrapperLogger().info("found script " + s.getScript());
// final String id = key;
return new TriggerAction()
{
public Object execute(final String line)
{
scriptExecutor.execute(new Runnable()
{
public void run()
{
AbstractWrappedProcess.this.getWrapperLogger().info("start script " + s.getScript());
s.executeWithTimeout(new String(line));
AbstractWrappedProcess.this.getWrapperLogger().info("end script " + s.getScript());
}
});
return null;
}
};