Class JavaPolicySecurity
java.lang.Object
org.mozilla.javascript.SecurityController
org.mozilla.javascript.tools.shell.SecurityProxy
org.mozilla.javascript.tools.shell.JavaPolicySecurity
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
callProcessFileSecure
(Context cx, Scriptable scope, String filename) callWithDomain
(Object securityDomain, Context cx, Callable callable, Scriptable scope, Scriptable thisObj, Object[] args) CallCallable.call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
of callable under restricted security domain where an action is allowed only if it is allowed according to the Java stack on the moment of the execWithDomain call and securityDomain.createClassLoader
(ClassLoader parentLoader, Object securityDomain) Get class loader-like object that can be used to define classes with the given security context.private ProtectionDomain
getDynamicDomain
(ProtectionDomain staticDomain) getDynamicSecurityDomain
(Object securityDomain) Get dynamic security domain that allows an action only if it is allowed by the current Java stack and securityDomain.Class
<?> private ProtectionDomain
getUrlDomain
(URL url) private URL
Methods inherited from class org.mozilla.javascript.SecurityController
createLoader, execWithDomain, getStaticSecurityDomainClass, hasGlobal, initGlobal
-
Constructor Details
-
JavaPolicySecurity
public JavaPolicySecurity()
-
-
Method Details
-
getStaticSecurityDomainClassInternal
- Overrides:
getStaticSecurityDomainClassInternal
in classSecurityController
-
callProcessFileSecure
- Specified by:
callProcessFileSecure
in classSecurityProxy
-
getUrlObj
-
getUrlDomain
-
createClassLoader
Description copied from class:SecurityController
Get class loader-like object that can be used to define classes with the given security context.- Specified by:
createClassLoader
in classSecurityController
- Parameters:
parentLoader
- parent class loader to delegate search for classes not defined by the class loader itselfsecurityDomain
- some object specifying the security context of the code that is defined by the returned class loader.
-
getDynamicSecurityDomain
Description copied from class:SecurityController
Get dynamic security domain that allows an action only if it is allowed by the current Java stack and securityDomain. If securityDomain is null, return domain representing permissions allowed by the current stack.- Specified by:
getDynamicSecurityDomain
in classSecurityController
-
getDynamicDomain
-
callWithDomain
public Object callWithDomain(Object securityDomain, Context cx, Callable callable, Scriptable scope, Scriptable thisObj, Object[] args) Description copied from class:SecurityController
CallCallable.call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
of callable under restricted security domain where an action is allowed only if it is allowed according to the Java stack on the moment of the execWithDomain call and securityDomain. Any call toSecurityController.getDynamicSecurityDomain(Object)
during execution ofcallable.call(cx, scope, thisObj, args)
should return a domain incorporate restrictions imposed by securityDomain and Java stack on the moment of callWithDomain invocation.The method should always be overridden, it is not declared abstract for compatibility reasons.
- Overrides:
callWithDomain
in classSecurityController
-