{
LogUtil.trace(getClass(), "Executing script on node $0 as {1} handler. [{2}]",
currentSocket.getNode().getQualifier().toString(), eventType, context);
// Execute the script associated with this handler
ScriptEngine scriptEngine = getScriptEngineFactory().obtainScriptEngine(hc.getTokenContext());
try
{
scriptEngine.prepareHandlerExecution(hc);
String script = handlerDef.getScript();
scriptEngine.executeScript(script, "handler script", currentSocket.getNode().getQualifier().toString());
scriptEngine.finishHandlerExecution(hc);
}
finally
{
getScriptEngineFactory().releaseScriptEngine(scriptEngine);
}