Source Code Cross Referenced for CompletionWatcherServlet.java in  » Science » Cougaar12_4 » org » cougaar » glm » servlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.glm.servlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * <copyright>
003:         *  
004:         *  Copyright 1997-2004 BBNT Solutions, LLC
005:         *  under sponsorship of the Defense Advanced Research Projects
006:         *  Agency (DARPA).
007:         * 
008:         *  You can redistribute this software and/or modify it under the
009:         *  terms of the Cougaar Open Source License as published on the
010:         *  Cougaar Open Source Website (www.cougaar.org).
011:         * 
012:         *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013:         *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014:         *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015:         *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016:         *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017:         *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018:         *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019:         *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020:         *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021:         *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022:         *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023:         *  
024:         * </copyright>
025:         */
026:
027:        package org.cougaar.glm.servlet;
028:
029:        import java.io.PrintWriter;
030:
031:        import org.cougaar.core.servlet.SimpleServletSupport;
032:        import org.cougaar.planning.servlet.ServletBase;
033:        import org.cougaar.planning.servlet.ServletWorker;
034:
035:        /**
036:         * <pre>
037:         * A servlet that watches for when a batch of tasks have completed
038:         * and returns the time it took to complete.
039:         * 
040:         * See the documentation in glm/doc.
041:         *
042:         * Gordon Vidaver
043:         * gvidaver@bbn.com
044:         * (617) 873-3558
045:         * </pre>
046:         */
047:        public class CompletionWatcherServlet extends ServletBase {
048:            public void setSimpleServletSupport(SimpleServletSupport support) {
049:                super .setSimpleServletSupport(support);
050:            }
051:
052:            public static final String FIRST_INTERVAL = "firstInterval";
053:            public static final String SECOND_INTERVAL = "secondInterval";
054:            public static final String VERBS_TO_INCLUDE = "verbsToInclude";
055:
056:            public static final boolean DEBUG = false;
057:            public static boolean VERBOSE = false;
058:
059:            static {
060:                VERBOSE = Boolean
061:                        .getBoolean("org.cougaar.glm.servlet.CompletionWatcherServlet.verbose");
062:            }
063:
064:            protected ServletWorker createWorker() {
065:                return new CompletionWatcherWorker();
066:            }
067:
068:            /** initial page presented when the servlet is called with no arguments */
069:            public void getUsage(PrintWriter out, SimpleServletSupport support) {
070:                out
071:                        .print("<HTML><HEAD><TITLE>CompletionWatcherServlet</TITLE></HEAD><BODY>\n"
072:                                + "<H2><CENTER>CompletionWatcherServlet</CENTER></H2><P>\n"
073:                                + "<FORM METHOD=\"GET\" ACTION=\"/$");
074:                out.print(support.getEncodedAgentName());
075:                out.print(support.getPath());
076:                out.print("\">\n");
077:
078:                out.print("<font size=+1>Wait for agent <b>"
079:                        + support.getAgentIdentifier()
080:                        + "</b> to complete.</font><p>\n");
081:                String agentPath = support.getEncodedAgentName()
082:                        + support.getPath();
083:                out.print("<img alt='Watcher Servlet Screen Shot' " + "src='/$"
084:                        + agentPath + "?getImage=true'><br>");
085:                out
086:                        .print("<center><font size=+1>Although typically used to time the period between GLSInit and when the agent is done,<br>");
087:                out
088:                        .print("the servlet measures any busy period between two quiet periods.</font></center><p>");
089:                out
090:                        .print("Note that the servlet may not return if it cannot go through its states.<p>");
091:
092:                out.println("<table>\n");
093:
094:                // get seconds to wait for initial quiet period
095:                out.println("<tr><td>");
096:                out.print("First quiet period duration (in seconds)");
097:                out.print("</td><td>");
098:                out.print("<INPUT TYPE=\"text\" NAME=\"" + FIRST_INTERVAL
099:                        + "\" " + "VALUE=\"10\">");
100:                out.println("</td></tr>");
101:
102:                // get seconds to wait for initial quiet period
103:                out.print("<tr><td>");
104:                out.print("Second quiet period duration (in seconds)");
105:                out.print("</td><td>");
106:                out.print("<INPUT TYPE=\"text\" NAME=\"" + SECOND_INTERVAL
107:                        + "\" " + "VALUE=\"10\">");
108:                out.println("</td></tr>");
109:
110:                // get verbs to include
111:                out.print("<tr><td>");
112:                out
113:                        .print("Verbs of tasks to examine (empty means all).  Comma separated.");
114:                out.print("</td><td>");
115:                out.print("<INPUT TYPE=\"text\" NAME=\"" + VERBS_TO_INCLUDE
116:                        + "\" " + "VALUE=\"\">");
117:                out.println("</td></tr>");
118:
119:                out.println("</table><p>");
120:
121:                // choose data format - html, xml, or java objects 
122:                out.print("<center>Show results as "
123:                        + "&nbsp;&nbsp;<INPUT TYPE=\"radio\" NAME=\"format\" "
124:                        + "VALUE=\"html\" CHECKED>" + "&nbsp;html&nbsp;");
125:                out.print("<INPUT TYPE=\"radio\" NAME=\"format\" "
126:                        + "VALUE=\"xml\">&nbsp;xml&nbsp;");
127:                out.print("<INPUT TYPE=\"radio\" NAME=\"format\" "
128:                        + "VALUE=\"data\">"
129:                        + "&nbsp;serialized Java objects<p>\n");
130:                out.print("<INPUT TYPE=\"submit\" NAME=\"Inject\"></center>\n"
131:                        + "</FORM></BODY></HTML>");
132:            }
133:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.