diff options
author | Henri Sara <henri.sara@itmill.com> | 2009-05-11 09:19:03 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2009-05-11 09:19:03 +0000 |
commit | adc8c0ad3573272c236040c3a76005b9e73a5737 (patch) | |
tree | a3860704dbd5b82dc6af38684b80f8ef79a32722 /src/com/itmill/toolkit/automatedtests/util/StatusServlet.java | |
parent | 5abc870dda584d0c2fc47fd5eec4ae3de3fa240e (diff) | |
download | vaadin-framework-adc8c0ad3573272c236040c3a76005b9e73a5737.tar.gz vaadin-framework-adc8c0ad3573272c236040c3a76005b9e73a5737.zip |
#2904: initial bulk rename "com.itmill.toolkit" -> "com.vaadin"
- com.itmill.toolkit.external not yet fully renamed
svn changeset:7715/svn branch:6.0
Diffstat (limited to 'src/com/itmill/toolkit/automatedtests/util/StatusServlet.java')
-rw-r--r-- | src/com/itmill/toolkit/automatedtests/util/StatusServlet.java | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/src/com/itmill/toolkit/automatedtests/util/StatusServlet.java b/src/com/itmill/toolkit/automatedtests/util/StatusServlet.java deleted file mode 100644 index caf44abc89..0000000000 --- a/src/com/itmill/toolkit/automatedtests/util/StatusServlet.java +++ /dev/null @@ -1,89 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.itmill.toolkit.automatedtests.util; - -import java.io.IOException; -import java.io.Writer; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -public class StatusServlet extends HttpServlet { - - public static DateFormat dfHuman = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss"); - - /** - * Version number of this release. For example "5.0.0". - */ - public static final String VERSION; - - /** - * Major version number. For example 5 in 5.1.0. - */ - public static final int VERSION_MAJOR; - - /** - * Minor version number. For example 1 in 5.1.0. - */ - public static final int VERSION_MINOR; - - /** - * Builds number. For example 0-custom_tag in 5.0.0-custom_tag. - */ - public static final String VERSION_BUILD; - - /* Initialize version numbers from string replaced by build-script. */ - static { - if ("@VERSION@".equals("@" + "VERSION" + "@")) { - VERSION = "5.9.9-INTERNAL-NONVERSIONED-DEBUG-BUILD"; - } else { - VERSION = "@VERSION@"; - } - final String[] digits = VERSION.split("\\."); - VERSION_MAJOR = Integer.parseInt(digits[0]); - VERSION_MINOR = Integer.parseInt(digits[1]); - VERSION_BUILD = digits[2]; - } - - @Override - public void init(javax.servlet.ServletConfig servletConfig) - throws javax.servlet.ServletException { - super.init(servletConfig); - } - - @Override - protected void service(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - Writer w = response.getWriter(); - - // not cacheable - response.setHeader("Cache-Control", "no-cache"); - response.setHeader("Pragma", "no-cache"); - response.setDateHeader("Expires", 0); - response.setContentType("text/html"); - - String p = ""; - p += "<p>StatusServlet " + dfHuman.format(new Date()) + "</p>"; - for (int i = 0; i < 30; i++) { - System.gc(); - } - long inUse = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime() - .freeMemory()); - p += "<p>Memory:<br />\n<memused>" + inUse - + "</memused> (Used)<br />\n" + "<memtotal>" - + Runtime.getRuntime().totalMemory() - + "<memtotal> (Total)<br />\n" + "<memfree>" - + Runtime.getRuntime().freeMemory() + "<memfree> (Free)</p>\n"; - - w.write("<html>\n" + p + "</html>\n"); - } -} |