|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpnuts.lang.Runtime
pnuts.lang.PnutsImpl
pnuts.ext.ImplementationAdapter
pnuts.security.SecurePnutsImpl
public class SecurePnutsImpl
A PnutsImpl subclass that execute scripts in an access control context in Java2 Security.
e.g. context.setImplementation(new SecurePnutsImpl(new CompilerPnutsImpl(), codesource))
Nested Class Summary |
---|
Nested classes/interfaces inherited from class pnuts.lang.Runtime |
---|
Runtime.Accessor, Runtime.Break, Runtime.Continue, Runtime.FunctionSerializer, Runtime.TypeMap |
Field Summary |
---|
Fields inherited from class pnuts.lang.PnutsImpl |
---|
properties |
Fields inherited from class pnuts.lang.Runtime |
---|
BOOLEAN_SYMBOL, BYTE_SYMBOL, CHAR_SYMBOL, CLONE, DOUBLE_SYMBOL, EXCEPTOIN_FIELD_SYMBOL, FLOAT_SYMBOL, INT_SYMBOL, LONG_SYMBOL, SHORT_SYMBOL, VOID_SYMBOL |
Constructor Summary | |
---|---|
SecurePnutsImpl(Implementation impl)
A Constructor |
|
SecurePnutsImpl(Implementation impl,
java.security.CodeSource codeSource)
A Constructor |
|
SecurePnutsImpl(PnutsImpl impl)
Deprecated. replaced by SecurePnutsImpl(Implementation) |
|
SecurePnutsImpl(PnutsImpl impl,
java.security.CodeSource codeSource)
Deprecated. replaced by SecurePnutsImpl(Implementation, CodeSource) |
Method Summary | |
---|---|
java.lang.Object |
accept(SimpleNode node,
Context context)
Evaluate a parsed script |
protected void |
addSandBoxPermissions(java.net.URL codebase,
java.security.PermissionCollection perms)
Add Applet sand-box permissions to the specified PermissionCollection. |
java.lang.Object |
eval(java.lang.String expr,
Context context)
Evaluate an expreesion |
protected java.security.PermissionCollection |
getPermissions(java.security.CodeSource codesource)
Returns permissions from policy file, plus Applet's sand-box permissions. |
protected java.security.PermissionCollection |
getPolicyPermissions(java.security.CodeSource codesource)
Gets permission declared in the policy file |
java.lang.Object |
load(java.lang.String file,
Context context)
Load a script file using classloader |
java.lang.Object |
load(java.net.URL scriptURL,
Context context)
Load a script file from a URL |
java.lang.Object |
loadFile(java.lang.String filename,
Context context)
Load a script file from local file system |
java.lang.String |
toString()
|
Methods inherited from class pnuts.ext.ImplementationAdapter |
---|
getBaseImpl |
Methods inherited from class pnuts.lang.PnutsImpl |
---|
getDefault, popFile, provide, pushFile, queryProperty, revoke, setProperties, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SecurePnutsImpl(PnutsImpl impl)
impl
- a PnutsImpl objectpublic SecurePnutsImpl(Implementation impl)
impl
- a PnutsImpl objectpublic SecurePnutsImpl(PnutsImpl impl, java.security.CodeSource codeSource)
impl
- the base implementationcodeSource
- a CodeSource object which indicates the source of the expression
execute by eval(String, Context).public SecurePnutsImpl(Implementation impl, java.security.CodeSource codeSource)
impl
- the base implementationcodeSource
- a CodeSource object which indicates the source of the expression
execute by eval(String, Context).Method Detail |
---|
public java.lang.Object eval(java.lang.String expr, Context context)
eval
in interface Implementation
eval
in class ImplementationAdapter
expr
- the expression to be evaluatedcontext
- the context in which the expression is evaluated
public java.lang.Object accept(SimpleNode node, Context context)
accept
in interface Implementation
accept
in class ImplementationAdapter
node
- the parsed scriptcontext
- the context in which the script is evaluated
public java.lang.Object load(java.lang.String file, Context context) throws java.io.FileNotFoundException
load
in interface Implementation
load
in class ImplementationAdapter
file
- the name of the scriptcontext
- the context in which the script is executed
java.io.FileNotFoundException
public java.lang.Object loadFile(java.lang.String filename, Context context) throws java.io.FileNotFoundException
loadFile
in interface Implementation
loadFile
in class ImplementationAdapter
filename
- the file name of the scriptcontext
- the context in which the expression is evaluated
java.io.FileNotFoundException
public java.lang.Object load(java.net.URL scriptURL, Context context)
load
in interface Implementation
load
in class ImplementationAdapter
scriptURL
- the URL of the scriptcontext
- the context in which the script is executed
protected java.security.PermissionCollection getPolicyPermissions(java.security.CodeSource codesource)
codesource
- the CodeSource of the script
protected void addSandBoxPermissions(java.net.URL codebase, java.security.PermissionCollection perms)
codebase
- the codebase of the scriptperms
- the base PermissionCollectionprotected java.security.PermissionCollection getPermissions(java.security.CodeSource codesource)
codesource
- the CodeSource of the script
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |