[jboss-svn-commits] JBL Code SVN: r22585 - labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/scripting.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 10 10:55:46 EDT 2008
Author: kevin.conner at jboss.com
Date: 2008-09-10 10:55:46 -0400 (Wed, 10 Sep 2008)
New Revision: 22585
Modified:
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/scripting/ScriptingAction.java
Log:
Add script details to invocation: JBESB-2002
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/scripting/ScriptingAction.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/scripting/ScriptingAction.java 2008-09-10 14:50:28 UTC (rev 22584)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/scripting/ScriptingAction.java 2008-09-10 14:55:46 UTC (rev 22585)
@@ -139,8 +139,9 @@
private ConfigTree config;
private MessagePayloadProxy payloadProxy;
- private String script = null;
- private String language = null;
+ private String script ;
+ private String source ;
+ private String language ;
public ScriptingAction(ConfigTree config)
{
@@ -152,6 +153,7 @@
{
// attempt to get the script
String scriptPath = getAttribute("script");
+ final String source ;
if (scriptPath == null)
{
boolean supportMessageBasedScripting = config.getBooleanAttribute("supportMessageBasedScripting", false);
@@ -162,6 +164,7 @@
logger.debug("No script specified on action config " + config.getAttribute("name")
+ ". Expecting script to be in message.");
}
+ source = "Embedded script in message" ;
}
else
{
@@ -192,7 +195,9 @@
{
try { if (scriptStream != null) scriptStream.close(); } catch (Throwable t) {}
}
+ source = scriptPath ;
}
+ this.source = source ;
// attempt to get the language
language = getAttribute("language");
if (language == null && script != null)
@@ -237,11 +242,16 @@
bsf.declareBean( "payloadProxy", payloadProxy, payloadProxy.getClass() );
bsf.declareBean( "logger", logger, logger.getClass() );
// NOTE: cannot use eval here since it does not work for all engines (jython in particular)
- bsf.exec( language, null, 0, 0, getScript(message) );
+ bsf.exec( language, source, 0, 0, getScript(message) );
}
catch (BSFException bsfe)
{
- throw new ActionProcessingException(bsfe);
+ final String error = "Exception caught while processing script: '" + source + "'" ;
+ if (logger.isDebugEnabled())
+ {
+ logger.debug(error, bsfe) ;
+ }
+ throw new ActionProcessingException(error, bsfe);
}
finally
{
More information about the jboss-svn-commits
mailing list