org.kohsuke.stapler.jelly
Class DefaultScriptInvoker
java.lang.Object
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. |
Method Summary |
protected org.apache.commons.jelly.JellyContext |
createContext(StaplerRequest req,
StaplerResponse rsp,
org.apache.commons.jelly.Script script,
Object it)
|
protected OutputStream |
createOutputStream(StaplerRequest req,
StaplerResponse rsp,
org.apache.commons.jelly.Script script,
Object it)
|
protected org.apache.commons.jelly.XMLOutput |
createXMLOutput(StaplerRequest req,
StaplerResponse rsp,
org.apache.commons.jelly.Script script,
Object it)
|
org.apache.commons.jelly.XMLOutput |
createXMLOutput(Writer writer,
boolean escapeText)
|
protected void |
exportVariables(StaplerRequest req,
StaplerResponse rsp,
org.apache.commons.jelly.Script script,
Object it,
org.apache.commons.jelly.JellyContext context)
|
void |
invokeScript(StaplerRequest req,
StaplerResponse rsp,
org.apache.commons.jelly.Script script,
Object it)
Invokes the script and generates output to ServletResponse.getOutputStream() . |
void |
invokeScript(StaplerRequest req,
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 |
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:
- CPU is already 1 or 2 order of magnitude faster than RAM and network.
- CPU is getting faster than any other components, such as RAM and network.
- Because of the TCP window slow start, on a large latency network, compression makes difference in
the order of 100ms to 1sec to the completion of a request by saving multiple roundtrips.
Stuff rendered by Jelly is predominantly text, so the compression would work well.
- See Also:
http://www.slideshare.net/guest22d4179/latency-trumps-all
DefaultScriptInvoker
public DefaultScriptInvoker()
invokeScript
public void invokeScript(StaplerRequest req,
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(StaplerRequest req,
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(StaplerRequest req,
StaplerResponse rsp,
org.apache.commons.jelly.Script script,
Object it)
throws IOException
- Throws:
IOException
createOutputStream
protected OutputStream createOutputStream(StaplerRequest req,
StaplerResponse rsp,
org.apache.commons.jelly.Script script,
Object it)
throws IOException
- Throws:
IOException
exportVariables
protected void exportVariables(StaplerRequest req,
StaplerResponse rsp,
org.apache.commons.jelly.Script script,
Object it,
org.apache.commons.jelly.JellyContext context)
createContext
protected org.apache.commons.jelly.JellyContext createContext(StaplerRequest req,
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.