Source Code Cross Referenced for Environment.java in  » Parser » JTopas » de » susebox » java » lang » 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 » Parser » JTopas » de.susebox.java.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Environment.java: Alternative System interface.
003:         *
004:         * Copyright (C) 2002 Heiko Blau
005:         *
006:         * This file belongs to the Susebox Java Core Library (Susebox JCL).
007:         * The Susebox JCL is free software; you can redistribute it and/or modify it
008:         * under the terms of the GNU Lesser General Public License as published by the
009:         * Free Software Foundation; either version 2.1 of the License, or (at your
010:         * option) any later version.
011:         *
012:         * This software is distributed in the hope that it will be useful, but WITHOUT
013:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
014:         * FITNESS FOR A PARTICULAR PURPOSE.
015:         * See the GNU Lesser General Public License for more details.
016:         *
017:         * You should have received a copy of the GNU Lesser General Public License along
018:         * with the Susebox JCL. If not, write to the
019:         *
020:         *   Free Software Foundation, Inc.
021:         *   59 Temple Place, Suite 330,
022:         *   Boston, MA 02111-1307
023:         *   USA
024:         *
025:         * or check the Internet: http://www.fsf.org
026:         *
027:         * Contact:
028:         *   email: heiko@susebox.de
029:         */
030:
031:        package de.susebox.java.lang;
032:
033:        //-----------------------------------------------------------------------------
034:        // Imports
035:        //
036:        import java.io.InputStream;
037:        import java.io.PrintStream;
038:
039:        //-----------------------------------------------------------------------------
040:        // Interface Environment
041:        //
042:
043:        /**<p>
044:         * A <code>Environment</code> object is a substitute for the usual environment
045:         * as defined in the {@link java.lang.System} class, most important the 
046:         * <code>stdin</code> and <code>stdout</code> channels {@link java.lang.System#in} 
047:         * and {@link java.lang.System#out}.
048:         *</p><p>
049:         * Environments are especially useful in classes that can be used both standalone 
050:         * (having a <code>main</code> method) or in an application where the class is
051:         * only one of many. Another scenario would be a simple class designed for use 
052:         * from the command line that should suddenly be invoked in GUI framework without
053:         * redirecting the default channels {@link java.lang.System#in} and 
054:         * {@link java.lang.System#out}.
055:         *</p><p>
056:         * To obtain an <code>Environment</code> instance or to store such instances 
057:         * use the class {@link EnvironmentProvider}:
058:         *<block><pre>
059:         *    Environment env = EnvironmentProvider.getEnvironment(this);
060:         *</pre></block>
061:         *</p>
062:         *
063:         * @author  Heiko Blau
064:         */
065:        public interface Environment {
066:
067:            /**
068:             * This method returns the substitution for {@link java.lang.System#in}, the
069:             * standard input channel. Instead of a public member like in the <code>System</code>
070:             * class, we prefer the method version since it is more flexible.
071:             *
072:             * @return  the {@link java.io.InputStream} that serves as standard input
073:             * @throws  UnsupportedOperationException if there is no stdin channel available
074:             * @see     java.lang.System#in
075:             */
076:            public InputStream in() throws UnsupportedOperationException;
077:
078:            /*-->
079:            {
080:              throw UnsupportedOperationException;
081:            }
082:            -->*/
083:
084:            /**
085:             * This method returns the substitution for {@link java.lang.System#out}, the
086:             * standard output channel. Instead of a public member like in the <code>System</code>
087:             * class, we prefer the method version since it is more flexible.
088:             *
089:             * @return  the {@link java.io.PrintStream} that serves as standard output
090:             * @throws  UnsupportedOperationException if there is no stdout channel available
091:             * @see     java.lang.System#out
092:             */
093:            public PrintStream out() throws UnsupportedOperationException;
094:
095:            /*-->
096:            {
097:              throw UnsupportedOperationException;
098:            }
099:            -->*/
100:
101:            /**
102:             * This method returns the substitution for {@link java.lang.System#err}, the
103:             * standard error channel. Instead of a public member like in the <code>System</code>
104:             * class, we prefer the method version since it is more flexible.
105:             *
106:             * @return  the {@link java.io.PrintStream} that serves as standard error output
107:             * @throws  UnsupportedOperationException if there is no stderr channel available
108:             * @see     java.lang.System#err
109:             */
110:            public PrintStream err() throws UnsupportedOperationException;
111:
112:            /*-->
113:            {
114:              throw UnsupportedOperationException;
115:            }
116:            -->*/
117:
118:            /**
119:             * During different stages of program execution various exit codes can be set
120:             * using this method. For instance, a program may set the exit code to a positive
121:             * number indicating that it is still running. A negative exit code may stand
122:             * for errors while 0 is the usual OK code.
123:             *
124:             * @param   status  the exit code of an application
125:             * @see     java.lang.System#exit
126:             * @see     #getExitStatus
127:             * @see     #exit
128:             */
129:            public void setExitStatus(int status);
130:
131:            /*-->
132:            {
133:              _exitStatus = status;
134:            }
135:            -->*/
136:
137:            /**
138:             * Retrieving the currently set exit code.
139:             *
140:             * @return the currently set exit code of an application
141:             */
142:            public int getExitStatus();
143:
144:            /*-->
145:            {
146:              return _exitStatus;
147:            }
148:            -->*/
149:
150:            /**
151:             * This method exits the instance of its <code>Environment</code> implementation.
152:             * After calling <code>exit</code> the <code>Environment</code> instance is
153:             * generally not any longer usable. In particular, an implementation can choose
154:             * to call {@link java.lang.System#exit}.
155:             *
156:             * @throws  UnsupportedOperationException if the method is not available
157:             * @see   #setExitStatus
158:             * @see   java.lang.System#exit
159:             */
160:            public void exit() throws UnsupportedOperationException;
161:            /*-->
162:            {
163:              throw UnsupportedOperationException;
164:            }
165:            -->*/
166:
167:            //---------------------------------------------------------------------------
168:            // members
169:            //
170:            /*-->
171:            private int _exitStatus = 0;
172:            -->*/
173:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.