Package de.innovationgate.wgpublisher.expressions.tmlscript

Examples of de.innovationgate.wgpublisher.expressions.tmlscript.ThreadLocalPreserver


       
        // Use Context Redirector as scope, so the objects implicit context always directs to the current script's context
        ContextRedirector redirector = new ContextRedirector();
       
        // Preserve thread locals
        ThreadLocalPreserver preserver = new ThreadLocalPreserver((RhinoContext) cx);
        preserver.preserve(RhinoExpressionEngine.TL_ACTIONDEFINITION, action);
        preserver.preserve(RhinoExpressionEngine.TL_SCRIPTNAME, "TMLScript-Object " + action.getModuleDatabase() + "/" + action.getModuleName());;
        try {
            Function func = runtime.getCompiledFunction(action.getCode(), (RhinoContext) cx, redirector);
            func.put(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, func, action);
            return func;
        }
        finally {
            preserver.restore();
        }
       
       
    }
View Full Code Here


       
        // Use Context Redirector as scope, so the objects implicit context always directs to the current script's context
        ContextRedirector redirector = new ContextRedirector();
       
        // Preserve thread locals
        ThreadLocalPreserver preserver = new ThreadLocalPreserver((RhinoContext) cx);
        preserver.preserve(RhinoExpressionEngine.TL_ACTIONDEFINITION, action);
        preserver.preserve(RhinoExpressionEngine.TL_SCRIPTNAME, "TMLScript-Object " + action.getModuleDatabase() + "/" + action.getModuleName());;
        try {
            Function func = runtime.getCompiledFunction(action.getCode(), (RhinoContext) cx, redirector);
            func.put(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, func, action);
            return func;
        }
        finally {
            preserver.restore();
        }
       
       
    }
View Full Code Here

TOP

Related Classes of de.innovationgate.wgpublisher.expressions.tmlscript.ThreadLocalPreserver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.