亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? contextfactory.java

?? 主要的怎么樣結合java 和 javascript!
?? JAVA
字號:
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * The contents of this file are subject to the Netscape Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/NPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is Rhino code, released * May 6, 1999. * * The Initial Developer of the Original Code is Netscape * Communications Corporation.  Portions created by Netscape are * Copyright (C) 1997-1999 Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): * Igor Bukanov, igor@fastmail.fm * * Alternatively, the contents of this file may be used under the * terms of the GNU Public License (the "GPL"), in which case the * provisions of the GPL are applicable instead of those above. * If you wish to allow use of your version of this file only * under the terms of the GPL and not to allow others to use your * version of this file under the NPL, indicate your decision by * deleting the provisions above and replace them with the notice * and other provisions required by the GPL.  If you do not delete * the provisions above, a recipient may use your version of this * file under either the NPL or the GPL. */// API classpackage org.mozilla.javascript;/** * Factory class that Rhino runtime use to create new {@link Context} * instances or to notify about Context execution. * <p> * When Rhino runtime needs to create new {@link Context} instance during * execution of {@link Context#enter()} or {@link Context}, it will call * {@link #makeContext()} of the current global ContextFactory. * See {@link #getGlobal()} and {@link #initGlobal(ContextFactory)}. * <p> * It is also possible to use explicit ContextFactory instances for Context * creation. This is useful to have a set of independent Rhino runtime * instances under single JVM. See {@link #call(ContextAction)}. * <p> * The following example demonstrates Context customization to terminate * scripts running more then 10 seconds and to provide better compatibility * with JavaScript code using MSIE-specific features. * <pre> * import org.mozilla.javascript.*; * * class MyFactory extends ContextFactory * { * *     // Custom {@link Context} to store execution time. *     private static class MyContext extends Context *     { *         long startTime; *     } * *     static { *         // Initialize GlobalFactory with custom factory *         ContextFactory.initGlobal(new MyFactory()); *     } * *     // Override {@link #makeContext()} *     protected Context makeContext() *     { *         MyContext cx = new MyContext(); *         // Use pure interpreter mode to allow for *         // {@link #observeInstructionCount(Context, int)} to work *         cx.setOptimizationLevel(-1); *         // Make Rhino runtime to call observeInstructionCount *         // each 10000 bytecode instructions *         cx.setInstructionObserverThreshold(10000); *         return cx; *     } * *     // Override {@link #hasFeature(Context, int)} *     public boolean hasFeature(Context cx, int featureIndex) *     { *         // Turn on maximum compatibility with MSIE scripts *         switch (featureIndex) { *             case {@link Context#FEATURE_NON_ECMA_GET_YEAR}: *                 return true; * *             case {@link Context#FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME}: *                 return true; * *             case {@link Context#FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER}: *                 return true; * *             case {@link Context#FEATURE_PARENT_PROTO_PROPRTIES}: *                 return false; *         } *         return super.hasFeature(cx, featureIndex); *     } * *     // Override {@link #observeInstructionCount(Context, int)} *     protected void observeInstructionCount(Context cx, int instructionCount) *     { *         MyContext mcx = (MyContext)cx; *         long currentTime = System.currentTimeMillis(); *         if (currentTime - mcx.startTime > 10*1000) { *             // More then 10 seconds from Context creation time: *             // it is time to stop the script. *             // Throw Error instance to ensure that script will never *             // get control back through catch or finally. *             throw new Error(); *         } *     } * *     // Override {@link #doTopCall(Callable, Context, Scriptable scope, Scriptable thisObj, Object[] args)} *     protected Object doTopCall(Callable callable, *                                Context cx, Scriptable scope, *                                Scriptable thisObj, Object[] args) *     { *         MyContext mcx = (MyContext)cx; *         mcx.startTime = System.currentTimeMillis(); * *         return super.doTopCall(callable, cx, scope, thisObj, args); *     } * * } * * </pre> */public class ContextFactory{    private static volatile boolean hasCustomGlobal;    private static ContextFactory global = new ContextFactory();    private volatile boolean sealed;    private final Object listenersLock = new Object();    private volatile Object listeners;    private boolean disabledListening;    private ClassLoader applicationClassLoader;    /**     * Listener of {@link Context} creation and release events.     */    public interface Listener    {        /**         * Notify about newly created {@link Context} object.         */        public void contextCreated(Context cx);        /**         * Notify that the specified {@link Context} instance is no longer         * associated with the current thread.         */        public void contextReleased(Context cx);    }    /**     * Get global ContextFactory.     *     * @see #hasExplicitGlobal()     * @see #initGlobal(ContextFactory)     */    public static ContextFactory getGlobal()    {        return global;    }    /**     * Check if global factory was set.     * Return true to indicate that {@link #initGlobal(ContextFactory)} was     * already called and false to indicate that the global factory was not     * explicitly set.     *     * @see #getGlobal()     * @see #initGlobal(ContextFactory)     */    public static boolean hasExplicitGlobal()    {        return hasCustomGlobal;    }    /**     * Set global ContextFactory.     * The method can only be called once.     *     * @see #getGlobal()     * @see #hasExplicitGlobal()     */    public static void initGlobal(ContextFactory factory)    {        if (factory == null) {            throw new IllegalArgumentException();        }        if (hasCustomGlobal) {            throw new IllegalStateException();        }        hasCustomGlobal = true;        global = factory;    }    /**     * Create new {@link Context} instance to be associated with the current     * thread.     * This is a callback method used by Rhino to create {@link Context}     * instance when it is necessary to associate one with the current     * execution thread. <tt>makeContext()</tt> is allowed to call     * {@link Context#seal(Object)} on the result to prevent     * {@link Context} changes by hostile scripts or applets.     */    protected Context makeContext()    {        return new Context();    }    /**     * Implementation of {@link Context#hasFeature(int featureIndex)}.     * This can be used to customize {@link Context} without introducing     * additional subclasses.     */    protected boolean hasFeature(Context cx, int featureIndex)    {        int version;        switch (featureIndex) {          case Context.FEATURE_NON_ECMA_GET_YEAR:           /*            * During the great date rewrite of 1.3, we tried to track the            * evolving ECMA standard, which then had a definition of            * getYear which always subtracted 1900.  Which we            * implemented, not realizing that it was incompatible with            * the old behavior...  now, rather than thrash the behavior            * yet again, we've decided to leave it with the - 1900            * behavior and point people to the getFullYear method.  But            * we try to protect existing scripts that have specified a            * version...            */            version = cx.getLanguageVersion();            return (version == Context.VERSION_1_0                    || version == Context.VERSION_1_1                    || version == Context.VERSION_1_2);          case Context.FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME:            return false;          case Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER:            return false;          case Context.FEATURE_TO_STRING_AS_SOURCE:            version = cx.getLanguageVersion();            return version == Context.VERSION_1_2;          case Context.FEATURE_PARENT_PROTO_PROPRTIES:            return true;          case Context.FEATURE_E4X:            version = cx.getLanguageVersion();            return (version == Context.VERSION_DEFAULT                    || version >= Context.VERSION_1_6);          case Context.FEATURE_DYNAMIC_SCOPE:            return false;          case Context.FEATURE_STRICT_VARS:            return false;          case Context.FEATURE_STRICT_EVAL:            return false;        }        // It is a bug to call the method with unknown featureIndex        throw new IllegalArgumentException(String.valueOf(featureIndex));    }    /**     * Create class loader for generated classes.     * This method creates an instance of the default implementation     * of {@link GeneratedClassLoader}. Rhino uses this interface to load     * generated JVM classes when no {@link SecurityController}     * is installed.     * Application can override the method to provide custom class loading.     */    protected GeneratedClassLoader createClassLoader(ClassLoader parent)    {        return new DefiningClassLoader(parent);    }    /**     * Get ClassLoader to use when searching for Java classes.     * Unless it was explicitly initialized with     * {@link #initApplicationClassLoader(ClassLoader)} the method returns     * null to indicate that Thread.getContextClassLoader() should be used.     */    public final ClassLoader getApplicationClassLoader()    {        return applicationClassLoader;    }    /**     * Set explicit class loader to use when searching for Java classes.     *     * @see #getApplicationClassLoader()     */    public final void initApplicationClassLoader(ClassLoader loader)    {        if (loader == null)            throw new IllegalArgumentException("loader is null");        if (!Kit.testIfCanLoadRhinoClasses(loader))            throw new IllegalArgumentException(                "Loader can not resolve Rhino classes");        if (this.applicationClassLoader != null)            throw new IllegalStateException(                "applicationClassLoader can only be set once");        checkNotSealed();        this.applicationClassLoader = loader;    }    /**     * Execute top call to script or function.     * When the runtime is about to execute a script or function that will     * create the first stack frame with scriptable code, it calls this method     * to perform the real call. In this way execution of any script     * happens inside this function.     */    protected Object doTopCall(Callable callable,                               Context cx, Scriptable scope,                               Scriptable thisObj, Object[] args)    {        return callable.call(cx, scope, thisObj, args);    }    /**     * Implementation of     * {@link Context#observeInstructionCount(int instructionCount)}.     * This can be used to customize {@link Context} without introducing     * additional subclasses.     */    protected void observeInstructionCount(Context cx, int instructionCount)    {    }    protected void onContextCreated(Context cx)    {        Object listeners = this.listeners;        for (int i = 0; ; ++i) {            Listener l = (Listener)Kit.getListener(listeners, i);            if (l == null)                break;            l.contextCreated(cx);        }    }    protected void onContextReleased(Context cx)    {        Object listeners = this.listeners;        for (int i = 0; ; ++i) {            Listener l = (Listener)Kit.getListener(listeners, i);            if (l == null)                break;            l.contextReleased(cx);        }    }    public final void addListener(Listener listener)    {        checkNotSealed();        synchronized (listenersLock) {            if (disabledListening) {                throw new IllegalStateException();            }            listeners = Kit.addListener(listeners, listener);        }    }    public final void removeListener(Listener listener)    {        checkNotSealed();        synchronized (listenersLock) {            if (disabledListening) {                throw new IllegalStateException();            }            listeners = Kit.removeListener(listeners, listener);        }    }    /**     * The method is used only to imlement     * Context.disableStaticContextListening()     */    final void disableContextListening()    {        checkNotSealed();        synchronized (listenersLock) {            disabledListening = true;            listeners = null;        }    }    /**     * Checks if this is a sealed ContextFactory.     * @see #seal()     */    public final boolean isSealed()    {        return sealed;    }    /**     * Seal this ContextFactory so any attempt to modify it like to add or     * remove its listeners will throw an exception.     * @see #isSealed()     */    public final void seal()    {        checkNotSealed();        sealed = true;    }    protected final void checkNotSealed()    {        if (sealed) throw new IllegalStateException();    }    /**     * Call {@link ContextAction#run(Context cx)}     * using the {@link Context} instance associated with the current thread.     * If no Context is associated with the thread, then     * {@link #makeContext()} will be called to construct     * new Context instance. The instance will be temporary associated     * with the thread during call to {@link ContextAction#run(Context)}.     *     * @see ContextFactory#call(ContextAction)     * @see Context#call(ContextFactory factory, Callable callable,     *                   Scriptable scope, Scriptable thisObj,     *                   Object[] args)     */    public final Object call(ContextAction action)    {        return Context.call(this, action);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品亚洲一区二区三区在线| 在线视频综合导航| 国产乱码精品1区2区3区| 另类小说欧美激情| 久久er精品视频| 久久aⅴ国产欧美74aaa| 国产美女av一区二区三区| 国产v综合v亚洲欧| 成人动漫在线一区| 91麻豆免费看| 在线精品亚洲一区二区不卡| 欧美性色综合网| 日韩午夜精品视频| 2020国产精品自拍| 中文字幕视频一区| 亚洲精品久久久蜜桃| 亚洲综合激情另类小说区| 亚洲一区二区3| 久久黄色级2电影| 风间由美性色一区二区三区| 99久久精品久久久久久清纯| 欧美在线观看视频一区二区三区| 欧美精品久久99久久在免费线 | 久久成人av少妇免费| 蜜臀久久99精品久久久久宅男| 日韩亚洲欧美一区| 欧美综合在线视频| 9191国产精品| 精品成人佐山爱一区二区| 国产精品久久久一本精品| 一区二区三区 在线观看视频| 视频一区二区三区中文字幕| 久久精品国产网站| 99久久免费视频.com| 欧美精品亚洲一区二区在线播放| 精品成人a区在线观看| 中文字幕一区二区三区四区不卡 | 日韩一区欧美小说| 亚洲国产日韩在线一区模特| 蜜桃免费网站一区二区三区| 成人永久免费视频| 欧美无乱码久久久免费午夜一区| 精品久久久久久无| 亚洲精品福利视频网站| 久久99久久久久久久久久久| 99热精品国产| 日韩精品一区二区三区老鸭窝 | 成人a免费在线看| 欧美久久久久免费| 国产精品久久久99| 美女一区二区三区在线观看| 91亚洲精华国产精华精华液| 欧美不卡一区二区三区四区| 亚洲精选一二三| 久久99精品久久只有精品| 在线观看日韩av先锋影音电影院| 精品欧美乱码久久久久久| 一区二区三区中文免费| 国产一区二区三区日韩| 91福利国产成人精品照片| 国产日韩一级二级三级| 丝袜美腿亚洲综合| 91亚洲国产成人精品一区二区三 | 91精品久久久久久久久99蜜臂| 中文字幕第一页久久| 日韩国产高清影视| 91蜜桃网址入口| xfplay精品久久| 日本欧美韩国一区三区| 一本大道久久a久久综合婷婷| 精品国产乱码久久久久久老虎| 亚洲一区在线观看视频| 成人app在线| 国产拍揄自揄精品视频麻豆| 日本va欧美va精品| 欧美丝袜丝nylons| 《视频一区视频二区| 国产成人在线视频网址| 日韩免费看网站| 欧美a级一区二区| 欧美日韩一区二区在线观看视频| 91美女精品福利| 一区二区三区日韩欧美| 亚洲国产精品久久艾草纯爱| 国产aⅴ精品一区二区三区色成熟| 91精品欧美一区二区三区综合在| 一区二区三区国产| 91在线观看美女| 国产精品网友自拍| 国产成人在线网站| 国产日韩欧美综合一区| 国产伦精品一区二区三区视频青涩 | 亚洲综合图片区| 91高清在线观看| 亚洲欧美日韩国产手机在线 | 91精品国产一区二区三区蜜臀| 一区二区免费视频| 色av一区二区| 一片黄亚洲嫩模| 欧美伊人久久久久久午夜久久久久| 亚洲欧洲成人精品av97| 波多野结衣中文一区| 国产精品污www在线观看| 成人激情小说网站| 久久你懂得1024| 久久久久久**毛片大全| 亚洲国产精品高清| 日本视频中文字幕一区二区三区| 欧美日韩国产综合久久| 日韩在线一区二区| 日韩欧美一级二级三级久久久| 久久99精品一区二区三区| 精品对白一区国产伦| 国产乱码精品1区2区3区| 欧美激情自拍偷拍| 色综合天天综合在线视频| 亚洲综合久久久久| 337p亚洲精品色噜噜噜| 激情欧美一区二区| 国产女人水真多18毛片18精品视频| 成人一级片在线观看| 亚洲免费在线看| 欧美日韩国产免费一区二区| 久久99精品久久只有精品| 日本一区二区三区高清不卡| av在线综合网| 亚洲第一成人在线| 日韩三级伦理片妻子的秘密按摩| 国产一区二区三区久久久| 国产精品日韩成人| 欧美在线视频全部完| 青青草97国产精品免费观看无弹窗版| 亚洲精品一线二线三线无人区| 成人毛片老司机大片| 亚洲午夜久久久久久久久久久| 欧美一级精品在线| 成a人片国产精品| 亚洲高清不卡在线| 久久久久久免费毛片精品| 91天堂素人约啪| 久久99精品国产.久久久久久| 国产精品美日韩| 欧美日韩成人综合| 国产乱码精品一区二区三| 亚洲欧美成人一区二区三区| 91精品国产色综合久久不卡蜜臀| 国产精品一卡二卡在线观看| 亚洲影院在线观看| 久久看人人爽人人| 欧美性猛片xxxx免费看久爱| 激情六月婷婷久久| 尤物在线观看一区| 2024国产精品| 欧美撒尿777hd撒尿| 国产一区二区三区视频在线播放| 亚洲美女电影在线| 精品国产伦一区二区三区观看方式| 色综合天天性综合| 精品一区二区三区在线观看国产| 一区二区三区国产| 亚洲国产精品av| 欧美一区二区在线播放| 91社区在线播放| 国产一区二区三区国产| 亚州成人在线电影| 国产精品不卡在线观看| 精品88久久久久88久久久| 在线观看国产精品网站| 国产91精品露脸国语对白| 日韩精品成人一区二区在线| 中文字幕一区二区日韩精品绯色| 日韩女优毛片在线| 欧美日韩你懂的| 91在线国产观看| 国产乱对白刺激视频不卡| 日韩成人午夜精品| 亚洲精品第1页| 中文字幕色av一区二区三区| 久久久国际精品| 日韩精品一区二区三区视频在线观看| 欧美午夜理伦三级在线观看| 成人av电影免费在线播放| 国产精品18久久久久久久久| 奇米影视7777精品一区二区| 亚洲va欧美va国产va天堂影院| 亚洲精品中文字幕乱码三区| 欧美激情一区二区三区蜜桃视频 | 一区二区三区在线播| 国产精品色在线观看| 亚洲精品一区二区精华| 欧美xxxxx裸体时装秀| 91精品国产综合久久福利| 欧美日韩高清在线播放| 欧美在线免费视屏| 欧美自拍丝袜亚洲| 色狠狠一区二区三区香蕉| 91丨九色丨尤物| 一本久久综合亚洲鲁鲁五月天 | 国产亚洲欧美一级| 久久亚洲综合色|