Source Code Cross Referenced for EnvironmentMember.java in  » Testing » jacareto » jacareto » system » 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 » Testing » jacareto » jacareto.system 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Jacareto Copyright (c) 2002-2005
003:         * Applied Computer Science Research Group, Darmstadt University of
004:         * Technology, Institute of Mathematics & Computer Science,
005:         * Ludwigsburg University of Education, and Computer Based
006:         * Learning Research Group, Aachen University. All rights reserved.
007:         *
008:         * Jacareto is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU General Public
010:         * License as published by the Free Software Foundation; either
011:         * version 2 of the License, or (at your option) any later version.
012:         *
013:         * Jacareto is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
016:         * General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU General Public
019:         * License along with Jacareto; if not, write to the Free
020:         * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
021:         *
022:         */
023:
024:        package jacareto.system;
025:
026:        import org.apache.log4j.Logger;
027:
028:        /**
029:         * A superclass for all classes which are a members of a Jacareto environment. A member of an
030:         * environment has access to the logger, the customization and the language instances contained in
031:         * that environment. If an environment member wants to access the environment instances like the
032:         * logger or the customization, the environment has to be specified before. There are two ways to
033:         * set the environment for an environment member:
034:         * 
035:         * <ul>
036:         * <li>
037:         * Call the constructor {@link #EnvironmentMember(Environment)} when creating the member.
038:         * </li>
039:         * <li>
040:         * If you have called the constructor without the environment as argument, then call the method
041:         * {@link #setEnvironment(Environment)} before you want to access the environment instances.
042:         * </li>
043:         * </ul>
044:         * 
045:         * You may access the environment instances in a subclass by using one of the following ways:
046:         * 
047:         * <ul>
048:         * <li>
049:         * <code>getEnvironment().getLogger()</code>
050:         * </li>
051:         * <li>
052:         * <code>env.getLogger()</code>
053:         * </li>
054:         * <li>
055:         * <code>getLogger()</code>
056:         * </li>
057:         * <li>
058:         * <code>logger</code>
059:         * </li>
060:         * </ul>
061:         * 
062:         * Just use the way you like most.
063:         *
064:         * @author <a href="mailto:cspannagel@web.de">Christian Spannagel</a>
065:         * @version 1.00
066:         */
067:        public class EnvironmentMember {
068:            /** The env this member belongs to. */
069:            protected Environment env;
070:
071:            /** The logger instance contained in the env. */
072:            protected Logger logger;
073:
074:            /** The customization instance contained in the env. */
075:            protected Customization customization;
076:
077:            /** The language instance contained in the env. */
078:            protected Language language;
079:
080:            /** The files instance contained in the env. */
081:            protected Files files;
082:
083:            /**
084:             * Creates a new env member object with the specified env.
085:             *
086:             * @param env the Jacareto env
087:             */
088:            public EnvironmentMember(Environment env) {
089:                setEnvironment(env);
090:            }
091:
092:            /**
093:             * Creates a new env member of no env.
094:             */
095:            public EnvironmentMember() {
096:                this (null);
097:            }
098:
099:            /**
100:             * Changes the env of this member.
101:             *
102:             * @param env {@link Environment}
103:             */
104:            public void setEnvironment(Environment env) {
105:                this .env = env;
106:
107:                if (env != null) {
108:                    this .logger = env.getLogger();
109:                    this .customization = env.getCustomization();
110:                    this .language = env.getLanguage();
111:                    this .files = env.getFiles();
112:                } else {
113:                    this .logger = null;
114:                    this .customization = null;
115:                    this .language = null;
116:                    this .files = null;
117:                }
118:            }
119:
120:            /**
121:             * Returns the member's env.
122:             *
123:             * @return DOCUMENT ME!
124:             */
125:            public Environment getEnvironment() {
126:                return env;
127:            }
128:
129:            /**
130:             * Returns the logger instance of the member's env.
131:             *
132:             * @return DOCUMENT ME!
133:             */
134:            public Logger getLogger() {
135:                return logger;
136:            }
137:
138:            /**
139:             * Returns the customization instance of the member's env.
140:             *
141:             * @return DOCUMENT ME!
142:             */
143:            public Customization getCustomization() {
144:                return customization;
145:            }
146:
147:            /**
148:             * Returns the language instance of the member's env.
149:             *
150:             * @return DOCUMENT ME!
151:             */
152:            public Language getLanguage() {
153:                return language;
154:            }
155:
156:            /**
157:             * returns the files instance of the member's env.
158:             *
159:             * @return DOCUMENT ME!
160:             */
161:            public Files getFiles() {
162:                return files;
163:            }
164:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.