Made response compression switchable via appname.responseEncoding = true
Added stopAll() method which cleans up at system shutdown.
This commit is contained in:
parent
3472ea06c1
commit
a080342079
1 changed files with 11 additions and 2 deletions
|
@ -85,11 +85,12 @@ public class ApplicationManager implements XmlRpcHandler {
|
||||||
app.setBaseURI (mountpoint);
|
app.setBaseURI (mountpoint);
|
||||||
ServletHttpContext context = new ServletHttpContext ();
|
ServletHttpContext context = new ServletHttpContext ();
|
||||||
context.setContextPath(pattern);
|
context.setContextPath(pattern);
|
||||||
context.addHandler(new ContentEncodingHandler());
|
|
||||||
server.http.addContext (context);
|
server.http.addContext (context);
|
||||||
ServletHolder holder = context.addServlet (appName, "/*", "helma.servlet.EmbeddedServletClient");
|
ServletHolder holder = context.addServlet (appName, "/*", "helma.servlet.EmbeddedServletClient");
|
||||||
holder.setInitParameter ("application", appName);
|
holder.setInitParameter ("application", appName);
|
||||||
holder.setInitParameter ("mountpoint", mountpoint);
|
holder.setInitParameter ("mountpoint", mountpoint);
|
||||||
|
if ("true".equalsIgnoreCase (props.getProperty (appName+".responseEncoding")))
|
||||||
|
context.addHandler(new ContentEncodingHandler());
|
||||||
String cookieDomain = props.getProperty (appName+".cookieDomain");
|
String cookieDomain = props.getProperty (appName+".cookieDomain");
|
||||||
if (cookieDomain != null)
|
if (cookieDomain != null)
|
||||||
holder.setInitParameter ("cookieDomain", cookieDomain);
|
holder.setInitParameter ("cookieDomain", cookieDomain);
|
||||||
|
@ -174,11 +175,12 @@ public class ApplicationManager implements XmlRpcHandler {
|
||||||
String pattern = getPathPattern (mountpoint);
|
String pattern = getPathPattern (mountpoint);
|
||||||
ServletHttpContext context = new ServletHttpContext ();
|
ServletHttpContext context = new ServletHttpContext ();
|
||||||
context.setContextPath(pattern);
|
context.setContextPath(pattern);
|
||||||
context.addHandler(new ContentEncodingHandler());
|
|
||||||
server.http.addContext (context);
|
server.http.addContext (context);
|
||||||
ServletHolder holder = context.addServlet (appName, "/*", "helma.servlet.EmbeddedServletClient");
|
ServletHolder holder = context.addServlet (appName, "/*", "helma.servlet.EmbeddedServletClient");
|
||||||
holder.setInitParameter ("application", appName);
|
holder.setInitParameter ("application", appName);
|
||||||
holder.setInitParameter ("mountpoint", mountpoint);
|
holder.setInitParameter ("mountpoint", mountpoint);
|
||||||
|
if ("true".equalsIgnoreCase (props.getProperty (appName+".responseEncoding")))
|
||||||
|
context.addHandler(new ContentEncodingHandler());
|
||||||
String cookieDomain = props.getProperty (appName+".cookieDomain");
|
String cookieDomain = props.getProperty (appName+".cookieDomain");
|
||||||
if (cookieDomain != null)
|
if (cookieDomain != null)
|
||||||
holder.setInitParameter ("cookieDomain", cookieDomain);
|
holder.setInitParameter ("cookieDomain", cookieDomain);
|
||||||
|
@ -230,6 +232,13 @@ public class ApplicationManager implements XmlRpcHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void stopAll () {
|
||||||
|
for (Enumeration en=applications.keys(); en.hasMoreElements(); ) {
|
||||||
|
String appName = (String) en.nextElement();
|
||||||
|
stop (appName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an array containing all currently running applications.
|
* Get an array containing all currently running applications.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue