Java Code Examples for org.mozilla.javascript.SecurityController#initGlobal()
The following examples show how to use
org.mozilla.javascript.SecurityController#initGlobal() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BirtEngine.java From Knowage-Server with GNU Affero General Public License v3.0 | 5 votes |
/** * Inits the birt config. */ public static synchronized void initBirtConfig() { loadEngineProps(); /** * Needed by Mozilla Javascript lib when Tomcat is started * with a security manager. */ SecurityController.initGlobal(new PolicySecurityController()); }
Example 2
Source File: JavascriptEngineFactory.java From birt with Eclipse Public License 1.0 | 5 votes |
public static void initMyFactory( ) { ContextFactory.initGlobal( new MyFactory( ) ); if ( System.getSecurityManager( ) != null ) { SecurityController.initGlobal( ScriptUtil .createSecurityController( ) ); } }
Example 3
Source File: RhinoAndroidHelper.java From rhino-android with Apache License 2.0 | 4 votes |
/** * call this instead of {@link Context#enter()} * * @return a context prepared for android */ public Context enterContext() { if (!SecurityController.hasGlobal()) SecurityController.initGlobal(new NoSecurityController()); return getContextFactory().enterContext(); }