CompiledScript.java revision 2362
1472N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 1472N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Extended by classes that store results of compilations. State 0N/A * might be stored in the form of Java classes, Java class files or scripting 0N/A * language opcodes. The script may be executed repeatedly 0N/A * without reparsing. 0N/A * Each <code>CompiledScript</code> is associated with a <code>ScriptEngine</code> -- A call to an <code>eval</code> 0N/A * method of the <code>CompiledScript</code> causes the execution of the script by the 0N/A * <code>ScriptEngine</code>. Changes in the state of the <code>ScriptEngine</code> caused by execution 0N/A * of tne <code>CompiledScript</code> may visible during subsequent executions of scripts by the engine. 0N/A * @author Mike Grogan 0N/A * Executes the program stored in this <code>CompiledScript</code> object. 0N/A * @param context A <code>ScriptContext</code> that is used in the same way as 0N/A * the <code>ScriptContext</code> passed to the <code>eval</code> methods of 0N/A * <code>ScriptEngine</code>. 0N/A * @return The value returned by the script execution, if any. Should return <code>null</code> 0N/A * if no value is returned by the script execution. 0N/A * @throws ScriptException if an error occurs. 0N/A * @throws NullPointerException if context is null. 0N/A * Executes the program stored in the <code>CompiledScript</code> object using 1155N/A * the supplied <code>Bindings</code> of attributes as the <code>ENGINE_SCOPE</code> of the 0N/A * associated <code>ScriptEngine</code> during script execution. If bindings is null, 0N/A * then the effect of calling this method is same as that of eval(getEngine().getContext()). 1612N/A * The <code>GLOBAL_SCOPE</code> <code>Bindings</code>, <code>Reader</code> and <code>Writer</code> 1612N/A * associated with the default <code>ScriptContext</code> of the associated <code>ScriptEngine</code> are used. 1612N/A * @param bindings The bindings of attributes used for the <code>ENGINE_SCOPE</code>. 0N/A * @return The return value from the script execution 0N/A * @throws ScriptException if an error occurs. 0N/A * Executes the program stored in the <code>CompiledScript</code> object. The 0N/A * default <code>ScriptContext</code> of the associated <code>ScriptEngine</code> is used. 0N/A * The effect of calling this method is same as that of eval(getEngine().getContext()). 0N/A * @return The return value from the script execution 0N/A * @throws ScriptException if an error occurs. 0N/A * Returns the <code>ScriptEngine</code> wbose <code>compile</code> method created this <code>CompiledScript</code>. 0N/A * The <code>CompiledScript</code> will execute in this engine. 0N/A * @return The <code>ScriptEngine</code> that created this <code>CompiledScript</code>