Source Code Cross Referenced for SuicideService.java in  » Science » Cougaar12_4 » org » cougaar » core » service » 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.core.service 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * <copyright>
03:         *  
04:         *  Copyright 1997-2004 BBNT Solutions, LLC
05:         *  under sponsorship of the Defense Advanced Research Projects
06:         *  Agency (DARPA).
07:         * 
08:         *  You can redistribute this software and/or modify it under the
09:         *  terms of the Cougaar Open Source License as published on the
10:         *  Cougaar Open Source Website (www.cougaar.org).
11:         * 
12:         *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13:         *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14:         *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15:         *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16:         *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17:         *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18:         *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19:         *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20:         *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21:         *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22:         *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23:         *  
24:         * </copyright>
25:         */
26:
27:        package org.cougaar.core.service;
28:
29:        import org.cougaar.bootstrap.SystemProperties;
30:        import org.cougaar.core.component.Service;
31:
32:        /** 
33:         * This service is used to tell the agent (or node) to exit, for
34:         * example due to an {@link java.lang.OutOfMemoryError}.
35:         * <p> 
36:         * The intent is to allow major components to report that they
37:         * have recognised that they have been corrupted by various means and
38:         * so should be restarted.
39:         *
40:         * @property org.cougaar.core.service.SuicideService.enable If true, will enable 
41:         * suicide of Nodes and Agents.  Otherwise, the suicide API exists but only logs
42:         * attempts rather than actually kills anything. The default is false.
43:         * @property org.cougaar.core.service.SuicideService.proactive If true, the SuicideService
44:         * will attempt to kill things proactively when it notices low-memory situations.  Defaults
45:         * to true, but only takes effect if the SuicideService is enabled.
46:         * @property org.cougaar.core.service.SuicideService.proactivePeriod Defines the period
47:         * of proactive suicide checks, in seconds.  By default, this is 1.
48:         * @property org.cougaar.core.service.SuicideService.lowMem Specify a quantity of
49:         * memory to use as the definition of "dangerously low" for proactive kill situations.
50:         * This is interpreted as a factor of Runtime.maxMemory().  The default value is "0.02" meaning
51:         * 2 percent.  If this value is greater than or equal to 1.0, then it is interpreted
52:         * as a number of kilobytes.  Examples: if maxMemory is 100Mb, then "0.005" and "512" are both
53:         * interpreted as one half a megabyte.
54:         */
55:        public interface SuicideService extends Service {
56:            /**
57:             * If the VM exits as a result of a suicide call, it will do so
58:             * using this value.
59:             */
60:            int EXIT_CODE = 5;
61:
62:            String SUICIDE_PROP = (SuicideService.class).getName() + ".enable";
63:            boolean isSuicideEnabled_default = false;
64:            boolean isSuicideEnabled = SystemProperties.getBoolean(
65:                    SUICIDE_PROP, isSuicideEnabled_default);
66:
67:            String PROACTIVE_PROP = (SuicideService.class).getName()
68:                    + ".proactive";
69:            boolean isProactiveEnabled_default = true;
70:            boolean isProactiveEnabled = SystemProperties.getBoolean(
71:                    PROACTIVE_PROP, isProactiveEnabled_default);
72:
73:            String PROPERIOD_PROP = (SuicideService.class).getName()
74:                    + ".proactivePeriod";
75:            double proactivePeriod_default = 1.0;
76:            double proactivePeriod = SystemProperties.getDouble(PROPERIOD_PROP,
77:                    proactivePeriod_default);
78:
79:            String LOWMEM_PROP = (SuicideService.class).getName() + ".lowMem";
80:            double lowMem_default = 0.02;
81:            double lowMem = SystemProperties.getDouble(LOWMEM_PROP,
82:                    lowMem_default);
83:
84:            /**
85:             * Report a fatal error and die.  This call might not return.
86:             *
87:             * @param component Which component should be killed.  May be specified as
88:             * null, implying that the whole node is suspect, or a specific component 
89:             * descriptor (e.g. an agent name).  It is probably illegal to specify a component
90:             * other than yourself or null.
91:             * @param error The error indicating the problem.  An attempt will be made
92:             * to log the error during the component's death throws.  May not be specified
93:             * as null.
94:             */
95:            void die(Object component, Throwable error);
96:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.