mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merge from head.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3314 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -35,6 +35,7 @@ import org.alfresco.service.cmr.repository.ScriptException;
|
||||
import org.alfresco.service.cmr.repository.ScriptService;
|
||||
import org.alfresco.service.cmr.repository.TemplateImageResolver;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mozilla.javascript.Context;
|
||||
import org.mozilla.javascript.ImporterTopLevel;
|
||||
import org.mozilla.javascript.Scriptable;
|
||||
@@ -47,6 +48,8 @@ import org.mozilla.javascript.ScriptableObject;
|
||||
*/
|
||||
public class RhinoScriptService implements ScriptService
|
||||
{
|
||||
private static final Logger logger = Logger.getLogger(RhinoScriptService.class);
|
||||
|
||||
/** The permission-safe node service */
|
||||
private NodeService nodeService;
|
||||
|
||||
@@ -191,7 +194,13 @@ public class RhinoScriptService implements ScriptService
|
||||
*/
|
||||
private Object executeScriptImpl(Reader reader, Map<String, Object> model)
|
||||
throws AlfrescoRuntimeException
|
||||
{
|
||||
{
|
||||
long startTime = 0;
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
startTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
// check that rhino script engine is available
|
||||
Context cx = Context.enter();
|
||||
try
|
||||
@@ -226,6 +235,12 @@ public class RhinoScriptService implements ScriptService
|
||||
finally
|
||||
{
|
||||
cx.exit();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
long endTime = System.currentTimeMillis();
|
||||
logger.debug("Time to execute script: " + (endTime - startTime) + "ms");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user