Source Code Cross Referenced for CompConfigUtils.java in  » ESB » open-esb » com » sun » jbi » jsf » util » 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 » ESB » open esb » com.sun.jbi.jsf.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         *  Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         *  The contents of this file are subject to the terms of either the GNU
007:         *  General Public License Version 2 only ("GPL") or the Common Development
008:         *  and Distribution License("CDDL") (collectively, the "License").  You
009:         *  may not use this file except in compliance with the License. You can obtain
010:         *  a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011:         *  or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
012:         *  language governing permissions and limitations under the License.
013:         *
014:         *  When distributing the software, include this License Header Notice in each
015:         *  file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016:         *  Sun designates this particular file as subject to the "Classpath" exception
017:         *  as provided by Sun in the GPL Version 2 section of the License file that
018:         *  accompanied this code.  If applicable, add the following below the License
019:         *  Header, with the fields enclosed by brackets [] replaced by your own
020:         *  identifying information: "Portions Copyrighted [year]
021:         *  [name of copyright owner]"
022:         *
023:         *  Contributor(s):
024:         *
025:         *  If you wish your version of this file to be governed by only the CDDL or
026:         *  only the GPL Version 2, indicate your decision by adding "[Contributor]
027:         *  elects to include this software in this distribution under the [CDDL or GPL
028:         *  Version 2] license."  If you don't indicate a single choice of license, a
029:         *  recipient has the option to distribute your version of this file under
030:         *  either the CDDL, the GPL Version 2 or to extend the choice of license to
031:         *  its licensees as provided above.  However, if you add GPL Version 2 code
032:         *  and therefore, elected the GPL Version 2 license, then the option applies
033:         *  only if the new code is made subject to such option by the copyright
034:         *  holder.
035:         */
036:        /*
037:         *  CompConfigUtils.java
038:         */
039:        package com.sun.jbi.jsf.util;
040:
041:        import com.sun.jbi.jsf.bean.CompConfigBean;
042:        import com.sun.jbi.jsf.bean.ConfigPropertyGroup;
043:        import com.sun.jbi.ui.common.JBIAdminCommands;
044:        import com.sun.webui.jsf.component.PropertySheet;
045:        import java.util.ArrayList;
046:        import java.util.List;
047:        import java.util.Properties;
048:        import java.util.logging.Level;
049:        import java.util.logging.Logger;
050:        import org.w3c.dom.Document;
051:
052:        /**
053:         * Component Configuration Utilities.
054:         *
055:         * @author   Sun Microsystems Inc.
056:         */
057:
058:        public final class CompConfigUtils {
059:
060:            /**
061:             * Gets the Configuration attribute of the CompConfigUtils class
062:             *
063:             * @param aCompName   Description of Parameter
064:             * @param anInstance  Description of Parameter
065:             * @return            The Configuration value
066:             */
067:            public static Properties getConfiguration(String aCompName,
068:                    String anInstance) {
069:                Properties result = null;
070:                sLog.fine("CompConfigUtils.getConfiguration(" + aCompName
071:                        + ", " + anInstance + ")");
072:
073:                try {
074:                    JBIAdminCommands jac = BeanUtilities.getClient();
075:
076:                    result = jac.getComponentConfiguration(aCompName,
077:                            anInstance);
078:
079:                    sLog.fine("CompConfigUtils.getConfiguration(...), result="
080:                            + result);
081:
082:                } catch (com.sun.jbi.ui.common.JBIRemoteException jrEx) {
083:                    sLog
084:                            .log(
085:                                    Level.FINE,
086:                                    ("CompConfigUtils.getConfiguration(...) caught jrEx=" + jrEx),
087:                                    jrEx);
088:                }
089:                return result;
090:            }
091:
092:            /**
093:             * Gets the ConfigurationData attribute of the CompConfigUtils class
094:             *
095:             * @param aCompName   Description of Parameter
096:             * @param anInstance  Description of Parameter
097:             * @return            The ConfigurationData value
098:             */
099:            public static String getConfigurationData(String aCompName,
100:                    String anInstance) {
101:                String result = null;
102:                sLog.fine("CompConfigUtils.getConfigurationData(" + aCompName
103:                        + ", " + anInstance + ")");
104:
105:                try {
106:                    JBIAdminCommands jac = BeanUtilities.getClient();
107:
108:                    result = jac.retrieveConfigurationDisplayData(aCompName,
109:                            anInstance);
110:
111:                    sLog
112:                            .fine("CompConfigUtils.getConfigurationData(...), result="
113:                                    + result);
114:
115:                } catch (com.sun.jbi.ui.common.JBIRemoteException jrEx) {
116:                    sLog
117:                            .log(
118:                                    Level.FINE,
119:                                    ("CompConfigUtils.getConfigurationData(...) caught jrEx=" + jrEx),
120:                                    jrEx);
121:                }
122:                return result;
123:            }
124:
125:            /**
126:             * Gets the ConfigurationSchema attribute of the CompConfigUtils class
127:             *
128:             * @param aCompName   Description of Parameter
129:             * @param anInstance  Description of Parameter
130:             * @return            The ConfigurationSchema value
131:             */
132:            public static String getConfigurationSchema(String aCompName,
133:                    String anInstance) {
134:                String result = null;
135:                sLog.fine("CompConfigUtils.getConfigurationSchema(" + aCompName
136:                        + ", " + anInstance + ")");
137:
138:                try {
139:                    JBIAdminCommands jac = BeanUtilities.getClient();
140:
141:                    result = jac.retrieveConfigurationDisplaySchema(aCompName,
142:                            anInstance);
143:
144:                    sLog
145:                            .fine("CompConfigUtils.getConfigurationSchema(...), result="
146:                                    + result);
147:
148:                } catch (com.sun.jbi.ui.common.JBIRemoteException jrEx) {
149:                    sLog
150:                            .log(
151:                                    Level.FINE,
152:                                    ("CompConfigUtils.getConfigurationSchema(...) caught jrEx=" + jrEx),
153:                                    jrEx);
154:                }
155:                return result;
156:            }
157:
158:            /**
159:             * Gets the Instances attribute of the CompConfigUtils class
160:             *
161:             * @param aCompName  Description of Parameter
162:             * @param aCompType  Description of Parameter
163:             * @return           The Instances value
164:             */
165:            public static List getInstances(String aCompName, String aCompType) {
166:                if (JBILogger.isLoggableFiner()) {
167:                    Object[] args = { aCompName, aCompType, };
168:                    JBILogger.entering(CN, MN_GET_INSTANCES, args);
169:                }
170:                ArrayList result = new ArrayList();
171:                if (JBILogger.isLoggableFiner()) {
172:                    JBILogger.exiting(CN, MN_GET_INSTANCES, result);
173:                }
174:                return result;
175:            }
176:
177:            /**
178:             * Gets the state of the specified component on the specified instance
179:             *
180:             * @param aCompName   the component to be checked
181:             * @param aCompType   either <code>binding-component</code>, or <code>service-engine</code>
182:             * @param anInstance  the cluster or standalone server name
183:             * @return            the state, one of <code>started</code>, <code>stopped</code>
184:             *      , <code>shutdown</code>, or <code>unknown</code>
185:             */
186:            public static String getCompState(String aCompName,
187:                    String aCompType, String anInstance) {
188:                String result = null;
189:                if (JBILogger.isLoggableFiner()) {
190:                    Object[] args = { aCompName, aCompType, anInstance, };
191:                    JBILogger.entering(CN, MN_GET_COMP_STATE, args);
192:                }
193:
194:                // TBD
195:
196:                if (JBILogger.isLoggableFiner()) {
197:                    JBILogger.exiting(CN, MN_GET_COMP_STATE, result);
198:                }
199:                return result;
200:            }
201:
202:            /**
203:             * Gets the running state of the specified instance
204:             *
205:             * @param anInstance  to be checked
206:             * @return            the state, one of <code>running</code>, <code>stopped</code>
207:             *      , <code>starting</code>, or <code>unknown</code>
208:             */
209:            public static String getInstanceState(String anInstance) {
210:                String result = null;
211:                if (JBILogger.isLoggableFiner()) {
212:                    Object[] args = { anInstance, };
213:                    JBILogger.entering(CN, MN_GET_INSTANCE_STATE, args);
214:                }
215:
216:                // TBD
217:
218:                if (JBILogger.isLoggableFiner()) {
219:                    JBILogger.exiting(CN, MN_GET_INSTANCE_STATE, result);
220:                }
221:                return result;
222:            }
223:
224:            /**
225:             * Determines if the requested type of configuration is supported by the
226:             * specified component on the specified instance.
227:             *
228:             * @param aConfigType   Description of Parameter
229:             * @param aCompName     the component
230:             * @param aCompType     one of: <code>binding-component</code> or <code>service-engine</code>
231:             * @param anInstance    the instance
232:             * @return              true if the specified component (on the specified
233:             *      instance) supports the requested configuration type
234:             */
235:            public static boolean isConfigTypeSupported(String aConfigType,
236:                    String aCompName, String aCompType, String anInstance) {
237:                boolean result = false;
238:                if (JBILogger.isLoggableFiner()) {
239:                    Object[] args = { aConfigType, aCompName, aCompType,
240:                            anInstance, };
241:                    JBILogger.entering(CN, MN_IS_CONFIG_TYPE_SUPPORTED, args);
242:                }
243:
244:                // TBD
245:
246:                if (JBILogger.isLoggableFiner()) {
247:                    JBILogger.exiting(CN, MN_IS_CONFIG_TYPE_SUPPORTED,
248:                            new Boolean(result));
249:                }
250:                return result;
251:            }
252:
253:            /**
254:             * Sets the requested configuration type property sheet on the component
255:             * configuration bean, if possible.
256:             *
257:             * @param aConfigType   The new ConfigPS value
258:             * @param aCompName     the component
259:             * @param aCompType     one of: <code>binding-component</code> or <code>service-engine</code>
260:             * @param anInstance    the instance (or null for configuration type of
261:             *      <code>installation</code>
262:             * @return              true if the specified component (on the specified
263:             *      instance) returns valid data that can be used to initialize the
264:             *      property sheet.
265:             */
266:            public static boolean setConfigPS(String aConfigType,
267:                    String aCompName, String aCompType, String anInstance) {
268:                boolean result = false;
269:                if (JBILogger.isLoggableFiner()) {
270:                    Object[] args = { aConfigType, aCompName, aCompType,
271:                            anInstance, };
272:                    JBILogger.entering(CN, MN_SET_CONFIG_PS, args);
273:                }
274:
275:                // TBD
276:                if (CONFIG_TYPE_APPLICATION.equals(aConfigType)) {
277:                } else if (CONFIG_TYPE_INSTALLATION.equals(aConfigType)) {
278:                    Document jbiDocument = ValidationUtilities
279:                            .getConfigExtensionJbiDocument();
280:
281:                    // this code gets called only after successful
282:                    // archive validation, so there will be
283:                    // a jbi.xml document
284:
285:                    List<ConfigPropertyGroup> configGroups = ValidationUtilities
286:                            .getConfigExtensions(jbiDocument);
287:
288:                    PropertySheet installConfigPS;
289:                    if (null != configGroups) {
290:                        installConfigPS = JSFUtils.getCompInstallationConfigPS(
291:                                aCompName, aCompType, configGroups);
292:                    } else {
293:                        installConfigPS = JSFUtils.getNoConfigPS(aConfigType,
294:                                aCompName, aCompType);
295:                    }
296:
297:                    CompConfigBean compConfigBean = BeanUtilities
298:                            .getCompConfigBean();
299:                    compConfigBean.setCompInstallationConfigPS(installConfigPS);
300:                } else if (CONFIG_TYPE_RUNTIME.equals(aConfigType)) {
301:                } else {
302:                }
303:
304:                if (JBILogger.isLoggableFiner()) {
305:                    JBILogger
306:                            .exiting(CN, MN_SET_CONFIG_PS, new Boolean(result));
307:                }
308:                return result;
309:            }
310:
311:            /**
312:             * Description of the Method
313:             *
314:             * @param aCompName              Description of Parameter
315:             * @param aCompType              Description of Parameter
316:             * @param anInstancesList        Description of Parameter
317:             * @param aPrevSelectedInstance  Description of Parameter
318:             * @return                       Description of the Returned Value
319:             */
320:            public static String selectCurrentInstance(String aCompName,
321:                    String aCompType, List anInstancesList,
322:                    String aPrevSelectedInstance) {
323:                if (JBILogger.isLoggableFiner()) {
324:                    Object[] args = { aCompName, aCompType, anInstancesList,
325:                            aPrevSelectedInstance, };
326:                    JBILogger.entering(CN, MN_SELECT_CURRENT_INSTANCE, args);
327:                }
328:
329:                String result = null;
330:
331:                // TBD
332:
333:                if (JBILogger.isLoggableFiner()) {
334:                    JBILogger.exiting(CN, MN_SELECT_CURRENT_INSTANCE, result);
335:                }
336:                return result;
337:            }
338:
339:            /**
340:             * prevents instantiation
341:             */
342:            private CompConfigUtils() {
343:            }
344:
345:            /**
346:             * used with <code>setConfigPS</code> for a configuration type parameter
347:             * for <code>application</code> type.
348:             */
349:            public static final String CONFIG_TYPE_APPLICATION = "application";
350:
351:            /**
352:             * used with <code>setConfigPS</code> for a configuration type parameter
353:             * for <code>installation</code> type.
354:             */
355:            public static final String CONFIG_TYPE_INSTALLATION = "installation";
356:
357:            /**
358:             * used with <code>setConfigPS</code> for a configuration type parameter
359:             * for <code>runtime</code> type.
360:             */
361:            public static final String CONFIG_TYPE_RUNTIME = "runtime";
362:
363:            /**
364:             * Controls printing of diagnostic messages to the log
365:             */
366:            private static Logger sLog = JBILogger.getInstance();
367:
368:            private static final String CN = CompConfigUtils.class.getName();
369:            private static final String MN_GET_COMP_STATE = "getCompState";
370:            private static final String MN_GET_INSTANCES = "getInstances";
371:            private static final String MN_GET_INSTANCE_STATE = "getInstanceState";
372:            private static final String MN_IS_CONFIG_TYPE_SUPPORTED = "isConfigTypeSupported";
373:            private static final String MN_SELECT_CURRENT_INSTANCE = "selectCurrentInstance";
374:            private static final String MN_SET_CONFIG_PS = "setConfigPS";
375:
376:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.