Source Code Cross Referenced for LifecycleResults.java in  » EJB-Server-geronimo » kernel » org » apache » geronimo » kernel » config » 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 » EJB Server geronimo » kernel » org.apache.geronimo.kernel.config 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */package org.apache.geronimo.kernel.config;
017:
018:        import java.util.LinkedHashSet;
019:        import java.util.LinkedHashMap;
020:        import java.util.Set;
021:        import java.util.Map;
022:        import java.util.Collections;
023:        import java.util.Iterator;
024:        import java.io.Serializable;
025:
026:        import org.apache.geronimo.kernel.repository.Artifact;
027:
028:        /**
029:         * This class contains the results of a lifecycle operation on the configuation manager.
030:         * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
031:         */
032:        public class LifecycleResults implements  Serializable {
033:            private static final long serialVersionUID = 4660197333193740244L;
034:            private final Set loaded = new LinkedHashSet();
035:            private final Set unloaded = new LinkedHashSet();
036:            private final Set started = new LinkedHashSet();
037:            private final Set stopped = new LinkedHashSet();
038:            private final Map failed = new LinkedHashMap();
039:
040:            /**
041:             * Checks whether the specified configuration was loaded.
042:             *
043:             * @param configurationId the configuration identifier, which must be fully
044:             *                        resolved (isResolved() == true)
045:             *
046:             * @return true if the specified configuration was loaded during the lifecycle operation
047:             */
048:            public boolean wasLoaded(Artifact configurationId) {
049:                return loaded.contains(configurationId);
050:            }
051:
052:            /**
053:             * Gets the configuration identifiers (Artifact) of the configurations loaded.
054:             * @return the configuration identifiers (Artifact)
055:             */
056:            public Set getLoaded() {
057:                return Collections.unmodifiableSet(loaded);
058:            }
059:
060:            /**
061:             * Adds a configuration the set of loaded configurations.
062:             * @param configurationId the configuration identifiers (Artifact)
063:             */
064:            public void addLoaded(Artifact configurationId) {
065:                loaded.add(configurationId);
066:            }
067:
068:            /**
069:             * Clears the existing loaded set and add alls the specified configurations to the set
070:             * @param loaded the configuration identifiers (Artifact)
071:             */
072:            public void setLoaded(Set loaded) {
073:                this .loaded.clear();
074:                this .loaded.addAll(loaded);
075:            }
076:
077:            /**
078:             * Checks whether the specified configuration was unloaded.
079:             *
080:             * @param configurationId the configuration identifier, which must be fully
081:             *                        resolved (isResolved() == true)
082:             *
083:             * @return true if the specified configuration was unloaded during the lifecycle operation
084:             */
085:            public boolean wasUnloaded(Artifact configurationId) {
086:                return unloaded.contains(configurationId);
087:            }
088:
089:            /**
090:             * Gets the configuration identifiers (Artifact) of the configurations unloaded.
091:             * @return the configuration identifiers (Artifact)
092:             */
093:            public Set getUnloaded() {
094:                return Collections.unmodifiableSet(unloaded);
095:            }
096:
097:            /**
098:             * Adds a configuration the set of unloaded configurations.
099:             * @param configurationId the configuration identifiers (Artifact)
100:             */
101:            public void addUnloaded(Artifact configurationId) {
102:                unloaded.add(configurationId);
103:            }
104:
105:            /**
106:             * Clears the existing unloaded set and add alls the specified configurations to the set
107:             * @param unloaded the configuration identifiers (Artifact)
108:             */
109:            public void setUnloaded(Set unloaded) {
110:                this .unloaded.clear();
111:                this .unloaded.addAll(unloaded);
112:            }
113:
114:            /**
115:             * Checks whether the specified configuration was started.
116:             *
117:             * @param configurationId the configuration identifier, which must be fully
118:             *                        resolved (isResolved() == true)
119:             *
120:             * @return true if the specified configuration was started during the lifecycle operation
121:             */
122:            public boolean wasStarted(Artifact configurationId) {
123:                return started.contains(configurationId);
124:            }
125:
126:            /**
127:             * Gets the configuration identifiers (Artifact) of the configurations started.
128:             * @return the configuration identifiers (Artifact)
129:             */
130:            public Set getStarted() {
131:                return Collections.unmodifiableSet(started);
132:            }
133:
134:            /**
135:             * Adds a configuration the set of started configurations.
136:             * @param configurationId the configuration identifiers (Artifact)
137:             */
138:            public void addStarted(Artifact configurationId) {
139:                started.add(configurationId);
140:            }
141:
142:            /**
143:             * Clears the existing started set and add alls the specified configurations to the set
144:             * @param started the configuration identifiers (Artifact)
145:             */
146:            public void setStarted(Set started) {
147:                this .started.clear();
148:                this .started.addAll(started);
149:            }
150:
151:            /**
152:             * Checks whether the specified configuration was stopped.
153:             *
154:             * @param configurationId the configuration identifier, which must be fully
155:             *                        resolved (isResolved() == true)
156:             *
157:             * @return true if the specified configuration was stopped during the lifecycle operation
158:             */
159:            public boolean wasStopped(Artifact configurationId) {
160:                return stopped.contains(configurationId);
161:            }
162:
163:            /**
164:             * Gets the configuration identifiers (Artifact) of the configurations stopped.
165:             * @return the configuration identifiers (Artifact)
166:             */
167:            public Set getStopped() {
168:                return Collections.unmodifiableSet(stopped);
169:            }
170:
171:            /**
172:             * Adds a configuration the set of stopped configurations.
173:             * @param configurationId the configuration identifiers (Artifact)
174:             */
175:            public void addStopped(Artifact configurationId) {
176:                stopped.add(configurationId);
177:            }
178:
179:            /**
180:             * Clears the existing stopped set and add alls the specified configurations to the set
181:             * @param stopped the configuration identifiers (Artifact)
182:             */
183:            public void setStopped(Set stopped) {
184:                this .stopped.clear();
185:                this .stopped.addAll(stopped);
186:            }
187:
188:            /**
189:             * Was the specified configuration failed the operation and threw an
190:             * exception.
191:             *
192:             * @param configurationId the configuration identifier.  May be a partial
193:             *                        ID, in which case will check whether any
194:             *                        matching conifguration failed.
195:             *
196:             * @return true if the specified (or any matching) configuration failed
197:             *              the operation and threw an exception during the lifecycle
198:             *              operation
199:             */
200:            public boolean wasFailed(Artifact configurationId) {
201:                for (Iterator it = failed.keySet().iterator(); it.hasNext();) {
202:                    Artifact failID = (Artifact) it.next();
203:                    if (configurationId.matches(failID)) {
204:                        return true;
205:                    }
206:                }
207:                return false;
208:            }
209:
210:            /**
211:             * Gets the exception that caused the operation on the specified configuration to fail.
212:             * @return the configuration identifiers (Artifact)
213:             */
214:            public Throwable getFailedCause(Artifact configurationId) {
215:                return (Throwable) failed.get(configurationId);
216:            }
217:
218:            /**
219:             * Gets the configuration identifiers (Artifact) of the configurations that failed the operation and threw an exception.
220:             * @return the configuration identifiers (Artifact)
221:             */
222:            public Map getFailed() {
223:                return Collections.unmodifiableMap(failed);
224:            }
225:
226:            /**
227:             * Adds a configuration and associated causal exception to this result.
228:             * @param configurationId the configuration identifiers (Artifact)
229:             * @param cause the exception that caused the operation on the specified configuration to fail
230:             */
231:            public void addFailed(Artifact configurationId, Throwable cause) {
232:                failed.put(configurationId, cause);
233:            }
234:
235:            /**
236:             * Clears the existing failed map and add alls the specified configurations to the map
237:             * @param failed a map from configuration identifier (Artifact) to causal exception
238:             */
239:            public void setFailed(Map failed) {
240:                this.failed.clear();
241:                this.failed.putAll(failed);
242:            }
243:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.