org.apache.batik.script.rhino
Class BatikSecuritySupport

java.lang.Object
  |
  +--org.apache.batik.script.rhino.BatikSecuritySupport
All Implemented Interfaces:
org.mozilla.javascript.SecuritySupport

public class BatikSecuritySupport
extends java.lang.Object
implements org.mozilla.javascript.SecuritySupport

This implementation of the Rhino SecuritySupport interface is meant for use within the context of Batik only. It is a partial implementation of the interface that does what is needed by Batik and no more.


Constructor Summary
BatikSecuritySupport()
          Default constructor
 
Method Summary
 java.lang.Class defineClass(java.lang.String name, byte[] data, java.lang.Object securityDomain)
          Define and load a Java class
 java.lang.Class[] getClassContext()
          Get the current class Context.
 java.lang.Object getSecurityDomain(java.lang.Class cl)
          Return teh security context associated with the given class.
 boolean visibleToScripts(java.lang.String fullClassName)
          Return true if the Java class with the given name should be exposed to scripts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatikSecuritySupport

public BatikSecuritySupport()
Default constructor
Method Detail

defineClass

public java.lang.Class defineClass(java.lang.String name,
                                   byte[] data,
                                   java.lang.Object securityDomain)
Define and load a Java class
Specified by:
defineClass in interface org.mozilla.javascript.SecuritySupport

getClassContext

public java.lang.Class[] getClassContext()
Get the current class Context. This relies on the BatikSecurityManager class.
Specified by:
getClassContext in interface org.mozilla.javascript.SecuritySupport

getSecurityDomain

public java.lang.Object getSecurityDomain(java.lang.Class cl)
Return teh security context associated with the given class. In this implementation, we return the ClassLoader which created the input class.
Specified by:
getSecurityDomain in interface org.mozilla.javascript.SecuritySupport

visibleToScripts

public boolean visibleToScripts(java.lang.String fullClassName)
Return true if the Java class with the given name should be exposed to scripts. In this implementation, this always return true, as security is enforced by the SecurityManager's policy and the Permissions granted by the URLClassLoader used to load classes.
Specified by:
visibleToScripts in interface org.mozilla.javascript.SecuritySupport


Copyright © 2002 Apache Software Foundation. All Rights Reserved.