org.kohsuke.stapler.jelly
Class DefaultScriptInvoker

java.lang.Object
  extended by org.kohsuke.stapler.jelly.DefaultScriptInvoker
All Implemented Interfaces:
org.apache.commons.jelly.XMLOutputFactory, ScriptInvoker

public class DefaultScriptInvoker
extends Object
implements ScriptInvoker, org.apache.commons.jelly.XMLOutputFactory

Standard implementation of ScriptInvoker.

Author:
Kohsuke Kawaguchi

Field Summary
static boolean COMPRESS_BY_DEFAULT
          Whether gzip compression of the dynamic content is enabled by default or not.
 
Constructor Summary
DefaultScriptInvoker()
           
 
Method Summary
protected  org.apache.commons.jelly.JellyContext createContext(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, org.apache.commons.jelly.Script script, Object it)
           
protected  OutputStream createOutputStream(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, org.apache.commons.jelly.Script script, Object it)
           
protected  org.apache.commons.jelly.XMLOutput createXMLOutput(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, org.apache.commons.jelly.Script script, Object it)
           
 org.apache.commons.jelly.XMLOutput createXMLOutput(Writer writer, boolean escapeText)
           
protected  void exportVariables(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, org.apache.commons.jelly.Script script, Object it, org.apache.commons.jelly.JellyContext context)
           
 void invokeScript(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, org.apache.commons.jelly.Script script, Object it)
          Invokes the script and generates output to ServletResponse.getOutputStream().
 void invokeScript(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, org.apache.commons.jelly.Script script, Object it, org.apache.commons.jelly.XMLOutput out)
          Invokes the script and generates output to the specified output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPRESS_BY_DEFAULT

public static boolean COMPRESS_BY_DEFAULT
Whether gzip compression of the dynamic content is enabled by default or not.

For non-trivial web applications, where the performance matters, it is normally a good trade-off to spend a bit of CPU cycles to compress data. This is because:

Stuff rendered by Jelly is predominantly text, so the compression would work well.

See Also:
http://www.slideshare.net/guest22d4179/latency-trumps-all
Constructor Detail

DefaultScriptInvoker

public DefaultScriptInvoker()
Method Detail

invokeScript

public void invokeScript(org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp,
                         org.apache.commons.jelly.Script script,
                         Object it)
                  throws IOException,
                         org.apache.commons.jelly.JellyTagException
Description copied from interface: ScriptInvoker
Invokes the script and generates output to ServletResponse.getOutputStream().

Specified by:
invokeScript in interface ScriptInvoker
Throws:
IOException
org.apache.commons.jelly.JellyTagException

invokeScript

public void invokeScript(org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp,
                         org.apache.commons.jelly.Script script,
                         Object it,
                         org.apache.commons.jelly.XMLOutput out)
                  throws IOException,
                         org.apache.commons.jelly.JellyTagException
Description copied from interface: ScriptInvoker
Invokes the script and generates output to the specified output

Specified by:
invokeScript in interface ScriptInvoker
Throws:
IOException
org.apache.commons.jelly.JellyTagException

createXMLOutput

protected org.apache.commons.jelly.XMLOutput createXMLOutput(org.kohsuke.stapler.StaplerRequest req,
                                                             org.kohsuke.stapler.StaplerResponse rsp,
                                                             org.apache.commons.jelly.Script script,
                                                             Object it)
                                                      throws IOException
Throws:
IOException

createOutputStream

protected OutputStream createOutputStream(org.kohsuke.stapler.StaplerRequest req,
                                          org.kohsuke.stapler.StaplerResponse rsp,
                                          org.apache.commons.jelly.Script script,
                                          Object it)
                                   throws IOException
Throws:
IOException

exportVariables

protected void exportVariables(org.kohsuke.stapler.StaplerRequest req,
                               org.kohsuke.stapler.StaplerResponse rsp,
                               org.apache.commons.jelly.Script script,
                               Object it,
                               org.apache.commons.jelly.JellyContext context)

createContext

protected org.apache.commons.jelly.JellyContext createContext(org.kohsuke.stapler.StaplerRequest req,
                                                              org.kohsuke.stapler.StaplerResponse rsp,
                                                              org.apache.commons.jelly.Script script,
                                                              Object it)

createXMLOutput

public org.apache.commons.jelly.XMLOutput createXMLOutput(Writer writer,
                                                          boolean escapeText)
Specified by:
createXMLOutput in interface org.apache.commons.jelly.XMLOutputFactory


Copyright © 2012. All Rights Reserved.