pnuts.ext
Class CachedPnutsImpl

java.lang.Object
  |
  +--pnuts.lang.PnutsImpl
        |
        +--pnuts.ext.CachedPnutsImpl

public class CachedPnutsImpl
extends PnutsImpl

PnutsImpl which caches parsed (compiled) scripts and reuse them. This class is useful when same scripts are executed over and over, e.g. servlet scripts.

See Also:
PnutsImpl

Constructor Summary
CachedPnutsImpl()
           
CachedPnutsImpl(boolean useCompiler)
           
 
Method Summary
 void includeLineNo(boolean flag)
           
 java.lang.Object load(java.net.URL scriptURL, Context context)
          Load a script file from a URL
 void reset()
          Reset the cache entries
 
Methods inherited from class pnuts.lang.PnutsImpl
accept, checkException, eval, load, load, loadFile, popFile, pushFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedPnutsImpl

public CachedPnutsImpl()

CachedPnutsImpl

public CachedPnutsImpl(boolean useCompiler)
Parameters:
useCompiler - true if compiler is used (default)
Method Detail

includeLineNo

public void includeLineNo(boolean flag)

reset

public void reset()
Reset the cache entries

load

public java.lang.Object load(java.net.URL scriptURL,
                             Context context)
Load a script file from a URL
Overrides:
load in class PnutsImpl
Parameters:
scriptURL - the URL of the script
context - the context in which the script is executed