Source Code Cross Referenced for ListBean.java in  » ESB » open-esb » com » sun » jbi » jsf » bean » 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.bean 
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-2007 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:        /*
038:         *  ListBean.java
039:         */
040:
041:        package com.sun.jbi.jsf.bean;
042:
043:        import com.sun.data.provider.TableDataProvider;
044:        import com.sun.data.provider.impl.ObjectListDataProvider;
045:        import com.sun.enterprise.tools.admingui.util.GuiUtil;
046:        import com.sun.jbi.jsf.util.BeanUtilities;
047:        import com.sun.jbi.jsf.util.ClusterUtilities;
048:        import com.sun.jbi.jsf.util.I18nUtilities;
049:        import com.sun.jbi.jsf.util.JBIConstants;
050:        import com.sun.jbi.jsf.util.JBILogger;
051:        import com.sun.jbi.jsf.util.SharedConstants;
052:        import com.sun.jbi.ui.common.JBIAdminCommands;
053:        import com.sun.jbi.ui.common.JBIComponentInfo;
054:        import com.sun.jbi.ui.common.ServiceAssemblyInfo;
055:        import com.sun.webui.jsf.model.Option;
056:        import java.util.ArrayList;
057:        import java.util.Arrays;
058:        import java.util.Iterator;
059:        import java.util.List;
060:        import java.util.logging.Logger;
061:
062:        /**
063:         * Provides properties used to populate JBI List/Show view tables
064:         */
065:        public class ListBean {
066:
067:            private final static boolean IS_CLUSTER_PROFILE = ClusterUtilities
068:                    .isClusterProfile();
069:            private final static String LIST_TARGET = JBIAdminCommands.DOMAIN_TARGET_KEY;
070:            private final static String NO_STATE_CHECK = null;
071:            private final static String NO_LIBRARY_CHECK = null;
072:            private final static String NO_COMPONENT_CHECK = null;
073:            private final static String NO_DEPLOYMENT_CHECK = null;
074:            /**
075:             * Controls printing of diagnostic messages to the log
076:             */
077:            private static Logger sLog = JBILogger.getInstance();
078:
079:            /**
080:             *
081:             */
082:            public static String findDescription(final String aName,
083:                    List aComponentOrServiceAssemblyInfoList) {
084:                String result = "";
085:                sLog.fine("ListBean.findDescription(" + aName
086:                        + ", (List)) size="
087:                        + aComponentOrServiceAssemblyInfoList.size());
088:
089:                if ((null != aName)
090:                        && (null != aComponentOrServiceAssemblyInfoList)) {
091:                    String nextDescription = "";
092:                    String nextName = "";
093:
094:                    for (int i = 0; i < aComponentOrServiceAssemblyInfoList
095:                            .size(); ++i) {
096:                        Object listItem = aComponentOrServiceAssemblyInfoList
097:                                .get(i);
098:
099:                        sLog.fine("ListBean.findDescription(...), listItem="
100:                                + listItem);
101:
102:                        if (listItem instanceof  SelectableJBIComponentInfo) {
103:                            SelectableJBIComponentInfo nextCompInfo = (SelectableJBIComponentInfo) listItem;
104:
105:                            nextDescription = nextCompInfo.getDescription();
106:                            nextName = nextCompInfo.getName();
107:                        } else if (listItem instanceof  SelectableJBIServiceAssemblyInfo) {
108:                            SelectableJBIServiceAssemblyInfo nextDepInfo = (SelectableJBIServiceAssemblyInfo) listItem;
109:
110:                            nextDescription = nextDepInfo.getDescription();
111:                            nextName = nextDepInfo.getName();
112:                        }
113:
114:                        if (aName.equals(nextName)) {
115:                            result = nextDescription;
116:                            break;
117:                        }
118:                    }
119:                }
120:
121:                sLog.fine("ListBean.findDescription(" + aName + ", "
122:                        + aComponentOrServiceAssemblyInfoList + "), result="
123:                        + result);
124:
125:                return result;
126:            }
127:
128:            /**
129:             *
130:             */
131:            List<SelectableJBIComponentInfo> getBindingComponentsInfoList() {
132:                sLog.fine("ListBean.getBindingComponentsInfoList()");
133:                return getBindingComponentsInfoList(mFilterComponentState,
134:                        mFilterComponentStates);
135:            }
136:
137:            /**
138:             *
139:             */
140:            List<SelectableJBIComponentInfo> getBindingComponentsInfoList(
141:                    String aFilterState, ArrayList aFilterStates) {
142:                sLog.fine("ListBean.getBindingComponentsInfoList("
143:                        + aFilterState + ", " + aFilterStates + ")");
144:
145:                ArrayList<SelectableJBIComponentInfo> resultList = new ArrayList<SelectableJBIComponentInfo>();
146:
147:                SelectableJBIComponentInfo[] bcInfoListArray = getCompStatus(JBIConstants.JBI_BINDING_COMPONENT_TYPE);
148:
149:                for (int i = 0; i < bcInfoListArray.length; ++i) {
150:                    if (BeanUtilities.checkFilterOptions(bcInfoListArray[i]
151:                            .getSummaryStatus(), aFilterState, aFilterStates)) {
152:                        sLog
153:                                .fine("ListBean.getBindingComponentsInfoList() adding "
154:                                        + bcInfoListArray[i]);
155:                        resultList.add(bcInfoListArray[i]);
156:                    }
157:                }
158:
159:                return resultList;
160:            }
161:
162:            List<SelectableJBIServiceAssemblyInfo> getServiceAssembliesInfoList() {
163:                sLog.fine("ListBean.getServiceAssembliesInfoList()");
164:                return getServiceAssembliesInfoList(mFilterAssemblyState,
165:                        mFilterAssemblyStates);
166:
167:            }
168:
169:            List<SelectableJBIServiceAssemblyInfo> getServiceAssembliesInfoList(
170:                    String aFilterState, ArrayList aFilterStates) {
171:                sLog.fine("ListBean.getServiceAssmembliesInfoList("
172:                        + aFilterState + ", " + aFilterStates + ")");
173:                ArrayList<SelectableJBIServiceAssemblyInfo> resultList = new ArrayList<SelectableJBIServiceAssemblyInfo>();
174:
175:                SelectableJBIServiceAssemblyInfo[] saInfoListArray = getSaStatus();
176:
177:                for (int i = 0; i < saInfoListArray.length; ++i) {
178:                    if (BeanUtilities.checkFilterOptions(saInfoListArray[i]
179:                            .getSummaryStatus(), aFilterState, aFilterStates)) {
180:                        sLog
181:                                .fine("ListBean.getServiceAssembliesInfoList() adding "
182:                                        + saInfoListArray[i]);
183:                        resultList.add(saInfoListArray[i]);
184:                    }
185:                }
186:
187:                return resultList;
188:            }
189:
190:            /**
191:             *
192:             */
193:            List<SelectableJBIComponentInfo> getServiceEnginesInfoList() {
194:                sLog.fine("ListBean.getServiceEnginesInfoList()");
195:                return getServiceEnginesInfoList(mFilterComponentState,
196:                        mFilterComponentStates);
197:            }
198:
199:            List<SelectableJBIComponentInfo> getServiceEnginesInfoList(
200:                    String aFilterState, ArrayList aFilterStates) {
201:                sLog.fine("ListBean.getServiceEnginesInfoList(" + aFilterState
202:                        + ", " + aFilterStates + ")");
203:                ArrayList<SelectableJBIComponentInfo> resultList = new ArrayList<SelectableJBIComponentInfo>();
204:
205:                SelectableJBIComponentInfo[] seInfoListArray = getCompStatus(JBIConstants.JBI_SERVICE_ENGINE_TYPE);
206:
207:                for (int i = 0; i < seInfoListArray.length; ++i) {
208:                    if (BeanUtilities.checkFilterOptions(seInfoListArray[i]
209:                            .getSummaryStatus(), aFilterState, aFilterStates)) {
210:                        sLog
211:                                .fine("ListBean.getServiceEnginesInfoList() adding "
212:                                        + seInfoListArray[i]);
213:                        resultList.add(seInfoListArray[i]);
214:                    }
215:                }
216:
217:                return resultList;
218:            }
219:
220:            List<SelectableJBIComponentInfo> getSharedLibrariesInfoList() {
221:                String xmlQueryResults = getListSharedLibraries();
222:
223:                ArrayList<SelectableJBIComponentInfo> result = new ArrayList<SelectableJBIComponentInfo>();
224:
225:                List sharedLibrariesComponentInfoList = JBIComponentInfo
226:                        .readFromXmlText(xmlQueryResults);
227:                for (Iterator it = sharedLibrariesComponentInfoList.iterator(); it
228:                        .hasNext();) {
229:                    SelectableJBIComponentInfo next = new SelectableJBIComponentInfo(
230:                            (JBIComponentInfo) it.next());
231:                    // shared libraries have no state to summarize
232:                    result.add(next);
233:                }
234:                sLog.fine("ListBean.getSharedLibrariesInfoList(), result="
235:                        + result);
236:                return result;
237:            }
238:
239:            public String getListBindingComponents() {
240:                String result = "";
241:                try {
242:                    if (null != mJac) {
243:                        if (mJac.isJBIRuntimeEnabled()) {
244:                            result = mJac.listBindingComponents(LIST_TARGET);
245:                        } else {
246:                            sLog
247:                                    .fine("ListBean.getListBindingComponents() scaffolding false");
248:                        }
249:                    }
250:                } catch (com.sun.jbi.ui.common.JBIRemoteException jbiRemoteEx) {
251:                    sLog
252:                            .fine("ListBean.getListBindingComponents(): caught jbiRemoteEx="
253:                                    + jbiRemoteEx);
254:                } catch (Exception unexpectedEx) {
255:                    logSevereI18n(unexpectedEx);
256:                }
257:                return result;
258:            }
259:
260:            public String getListServiceAssemblies() {
261:                String result = "";
262:                try {
263:                    if (null != mJac) {
264:                        if (mJac.isJBIRuntimeEnabled()) {
265:                            result = mJac.listServiceAssemblies(LIST_TARGET);
266:                        } else {
267:                            sLog
268:                                    .fine("ListBean.getListServiceAssemblies() scaffolding false");
269:                        }
270:                    }
271:                } catch (com.sun.jbi.ui.common.JBIRemoteException jbiRemoteEx) {
272:                    sLog
273:                            .fine("ListBean.getListServiceAssemblies(): caught jbiRemoteEx="
274:                                    + jbiRemoteEx);
275:                } catch (Exception unexpectedEx) {
276:                    logSevereI18n(unexpectedEx);
277:                }
278:                return result;
279:            }
280:
281:            public String getListServiceEngines() {
282:                String result = "";
283:                try {
284:                    if (null != mJac) {
285:                        if (mJac.isJBIRuntimeEnabled()) {
286:                            result = mJac.listServiceEngines(LIST_TARGET);
287:                        } else {
288:                            sLog
289:                                    .fine("ListBean.getListServiceEngines() scaffolding false");
290:                        }
291:                    }
292:                } catch (com.sun.jbi.ui.common.JBIRemoteException jbiRemoteEx) {
293:                    sLog
294:                            .fine("ListBean.getListServiceEngines(): caught jbiRemoteEx="
295:                                    + jbiRemoteEx);
296:                } catch (Exception unexpectedEx) {
297:                    logSevereI18n(unexpectedEx);
298:                }
299:                return result;
300:            }
301:
302:            public String getListSharedLibraries() {
303:                String result = "";
304:                try {
305:                    if (null != mJac) {
306:                        if (mJac.isJBIRuntimeEnabled()) {
307:                            result = mJac.listSharedLibraries(LIST_TARGET);
308:                        } else {
309:                            sLog
310:                                    .fine("ListBean.getListSharedLibraries() scaffolding false");
311:                        }
312:                    }
313:                } catch (com.sun.jbi.ui.common.JBIRemoteException jbiRemoteEx) {
314:                    sLog
315:                            .fine("ListBean.getListSharedLibraries(): caught jbiRemoteEx="
316:                                    + jbiRemoteEx);
317:                } catch (Exception unexpectedEx) {
318:                    logSevereI18n(unexpectedEx);
319:                }
320:
321:                sLog
322:                        .fine("ListBean.getListShaerdLibraries(), result="
323:                                + result);
324:                return result;
325:            }
326:
327:            public TableDataProvider getSharedTableData() {
328:                sLog.fine("ListBean.getSharedTableData()");
329:                TableDataProvider result = mCachedTableData;
330:
331:                sLog.fine("ListBean.getSharedTableData(): result=" + result);
332:                return result;
333:            }
334:
335:            public void setBindingsEnginesTableData() {
336:                List<SelectableJBIComponentInfo> combinedList = null;
337:
338:                sLog.fine("ListBean.setBindingsEnginesTableData()");
339:
340:                if (SharedConstants.DROP_DOWN_TYPE_SHOW_ALL.equals(mFilterType)) {
341:                    combinedList = getBindingComponentsInfoList();
342:                    combinedList.addAll(getServiceEnginesInfoList());
343:                } else if (SharedConstants.DROP_DOWN_TYPE_BINDING
344:                        .equals(mFilterType)) {
345:                    combinedList = getBindingComponentsInfoList();
346:                } else if (SharedConstants.DROP_DOWN_TYPE_ENGINE
347:                        .equals(mFilterType))//not i18n
348:                {
349:                    combinedList = getServiceEnginesInfoList();
350:                }
351:
352:                TableDataProvider result = new ObjectListDataProvider(
353:                        combinedList);
354:                mCachedTableData = result;
355:                sLog.fine("ListBean.setBindingsEnginesTableData(): result="
356:                        + result);
357:            }
358:
359:            public void setDeploymentsTableData() {
360:                sLog.fine("ListBean.setDeploymentsTableData()");
361:                TableDataProvider result = new ObjectListDataProvider(
362:                        getServiceAssembliesInfoList());
363:                mCachedTableData = result;
364:                sLog.fine("ListBean.setDeploymentsTableData(): result="
365:                        + result);
366:            }
367:
368:            public void setLibrariesTableData() {
369:                sLog.fine("ListBean.setLibrariesTableData()");
370:                TableDataProvider result = new ObjectListDataProvider(
371:                        getSharedLibrariesInfoList());
372:                mCachedTableData = result;
373:                sLog.fine("ListBean.setLibrariesTableData(): result=" + result);
374:            }
375:
376:            public void setFilterType(String filterType) {
377:                mFilterType = filterType;
378:            }
379:
380:            public String getFilterType() {
381:                return mFilterType;
382:            }
383:
384:            public void setFilterComponentState(String filterState) {
385:                mFilterComponentState = filterState;
386:            }
387:
388:            public void setFilterComponentState(String filterState,
389:                    String filterStates) {
390:                mFilterComponentState = filterState;
391:                filterStates = filterStates.replace('[', ' ');
392:                filterStates = filterStates.replace(']', ' ');
393:                String[] states = filterStates.split("\\,");
394:                for (int i = 0; i < states.length; i++) {
395:                    states[i] = states[i].trim();
396:                }
397:                mFilterComponentStates = new ArrayList(Arrays.asList(states));
398:            }
399:
400:            public String getFilterComponentState() {
401:                return mFilterComponentState;
402:            }
403:
404:            public void setFilterAssemblyState(String filterState) {
405:                mFilterAssemblyState = filterState;
406:            }
407:
408:            public void setFilterAssemblyState(String filterState,
409:                    String filterStates) {
410:                mFilterAssemblyState = filterState;
411:                filterStates = filterStates.replace('[', ' ');
412:                filterStates = filterStates.replace(']', ' ');
413:                String[] states = filterStates.split("\\,");
414:                for (int i = 0; i < states.length; i++) {
415:                    states[i] = states[i].trim();
416:                }
417:                mFilterAssemblyStates = new ArrayList(Arrays.asList(states));
418:            }
419:
420:            public String getFilterAssemblyState() {
421:                return mFilterAssemblyState;
422:            }
423:
424:            /**
425:             * determines the summary status for either all binding components or all service engines
426:             * using the server target for developer-profile, or using all targets for cluster-profile
427:             * @param a type
428:             * @returns an array of selectable component infos (for the requested type)
429:             * with updated summary status for each component
430:             */
431:            private SelectableJBIComponentInfo[] getCompStatus(String aType) {
432:                SelectableJBIComponentInfo[] result = new SelectableJBIComponentInfo[0];
433:
434:                if (IS_CLUSTER_PROFILE) {
435:                    sLog.fine("ListBean.getCompStatus(" + aType
436:                            + ") cluster-profile");
437:                    result = ClusterUtilities.getCompStatus(aType); // summarize across all targets
438:                } else // developer-profile
439:                {
440:                    sLog.fine("ListBean.getCompStatus(" + aType
441:                            + ") developer-profile");
442:
443:                    List compInfoList = null;
444:
445:                    if (JBIConstants.JBI_BINDING_COMPONENT_TYPE.equals(aType)) // binding components
446:                    {
447:                        String listBcXmlQueryResults = getListBindingComponents();
448:                        compInfoList = JBIComponentInfo
449:                                .readFromXmlText(listBcXmlQueryResults);
450:                    } else // service engines
451:                    {
452:                        String listSeXmlQueryResults = getListServiceEngines();
453:                        compInfoList = JBIComponentInfo
454:                                .readFromXmlText(listSeXmlQueryResults);
455:                    }
456:
457:                    result = new SelectableJBIComponentInfo[compInfoList.size()];
458:
459:                    int index = 0;
460:                    for (Iterator it = compInfoList.iterator(); it.hasNext();) {
461:                        SelectableJBIComponentInfo next = new SelectableJBIComponentInfo(
462:                                (JBIComponentInfo) it.next());
463:                        sLog.fine("ListBean.getCompStatus(" + aType + ") next="
464:                                + next);
465:                        result[index] = next;
466:                        result[index]
467:                                .setSummaryStatus(result[index].getState());
468:                        sLog.fine("ListBean.getCompStatus(" + aType
469:                                + "), result[" + index + "].getState()="
470:                                + result[index].getState() + ")");
471:                        ++index;
472:                    }
473:                }
474:
475:                sLog.fine("ListBean.getCompStatus(" + aType
476:                        + "), result.length=" + result.length);
477:                return result;
478:            }
479:
480:            /**
481:             * determines the summary status for all service assemblies
482:             * using the server target for developer-profile, or using all targets for cluster-profile
483:             * @returns an array of selectable service assembly infos
484:             * with updated summary status for each deployment
485:             */
486:            private SelectableJBIServiceAssemblyInfo[] getSaStatus() {
487:                SelectableJBIServiceAssemblyInfo[] result = new SelectableJBIServiceAssemblyInfo[0];
488:
489:                if (IS_CLUSTER_PROFILE) {
490:                    sLog.fine("ListBean.getSaStatus() cluster-profile");
491:                    result = ClusterUtilities.getSaStatus(); // summarize across all targets
492:                } else // developer-profile
493:                {
494:                    sLog.fine("ListBean.getSaStatus() developer-profile");
495:
496:                    List saInfoList = null;
497:
498:                    String listSaXmlQueryResults = getListServiceAssemblies();
499:                    saInfoList = ServiceAssemblyInfo
500:                            .readFromXmlTextWithProlog(listSaXmlQueryResults);
501:
502:                    result = new SelectableJBIServiceAssemblyInfo[saInfoList
503:                            .size()];
504:
505:                    int index = 0;
506:                    for (Iterator it = saInfoList.iterator(); it.hasNext();) {
507:                        SelectableJBIServiceAssemblyInfo next = new SelectableJBIServiceAssemblyInfo(
508:                                (ServiceAssemblyInfo) it.next());
509:                        sLog.fine("ListBean.getSaStatus() next=" + next);
510:                        result[index] = next;
511:                        result[index]
512:                                .setSummaryStatus(result[index].getState());
513:                        sLog.fine("ListBean.getSaStatus(), result[" + index
514:                                + "].getState()=" + result[index].getState()
515:                                + ")");
516:                        ++index;
517:                    }
518:                }
519:
520:                sLog.fine("ListBean.getSaStatus(), result.length="
521:                        + result.length);
522:
523:                return result;
524:            }
525:
526:            public void setUpdateInstancesList(String[] list) {
527:                mUpdateList = list;
528:            }
529:
530:            public String[] getUpdateInstancesList() {
531:                return mUpdateList;
532:            }
533:
534:            private void logSevereI18n(Exception anUnexpectedException) {
535:                sLog.fine("ListBean.logSevereI18n anUnexpectedException="
536:                        + anUnexpectedException);
537:
538:                // use localized message, if available (may get nonlocalized msg)
539:                String exMsg = anUnexpectedException.getLocalizedMessage();
540:                sLog
541:                        .fine("ListBean.logSevereI18n getLocalizedMessage="
542:                                + exMsg);
543:
544:                // log type of exception if messages are not available
545:                if (null == exMsg) {
546:                    exMsg = anUnexpectedException.getClass().getName();
547:                    sLog.fine("ListBean.logSevereI18n exMsg=" + exMsg);
548:                }
549:
550:                Object[] args = { exMsg };
551:
552:                String msg = null;
553:                try {
554:                    // log localized common client exception with insert
555:                    msg = GuiUtil
556:                            .getMessage(
557:                                    I18nUtilities
558:                                            .getResourceString("jbi.common.client.unexpected.exception"),
559:                                    args);
560:                } catch (Exception unexpectedI18nEx) {
561:                    sLog.fine("ListBean.logSevereI18n caught unexpectedI18nEx="
562:                            + unexpectedI18nEx);
563:
564:                    // log localized i18n exception (if insert fails)
565:                    msg = I18nUtilities
566:                            .getResourceString("jbi.internal.i18n.error");
567:                }
568:
569:                sLog.severe(msg);
570:
571:                // in all cases log the original stack trace
572:                // (this is a common client or JBI runtime escaped exception
573:                // and prevents the console from displaying information correctly)
574:                anUnexpectedException.printStackTrace(System.err);
575:            }
576:
577:            public TableDataProvider getSharedDepsTableData() {
578:                sLog.fine("ListBean.getSharedDepsTableData()");
579:                TableDataProvider result = mCachedDepsTableData;
580:
581:                sLog
582:                        .fine("ListBean.getSharedDepsTableData(): result="
583:                                + result);
584:                return result;
585:            }
586:
587:            public void setSharedDepsTableData(String aType, String aName) {
588:                sLog.fine("ListBean.setSharedDepsTableData(" + aType + ", "
589:                        + aName + ")");
590:                List compInfoList = null;
591:                try {
592:                    if (null != mJac) {
593:                        if (mJac.isJBIRuntimeEnabled()) {
594:                            if ("shared-library".equals(aType)) {
595:                                if (false) {
596:                                    String dependentBindings = mJac
597:                                            .listBindingComponents(null, aName,
598:                                                    null, LIST_TARGET);
599:                                    sLog
600:                                            .fine("ListBean.setSharedDepsTableData() dependentBindings="
601:                                                    + dependentBindings);
602:                                    String dependentEngines = mJac
603:                                            .listServiceEngines(null, aName,
604:                                                    null, LIST_TARGET);
605:                                    sLog
606:                                            .fine("ListBean.setSharedDepsTableData() dependentEngines="
607:                                                    + dependentEngines);
608:                                }
609:
610:                                String dependentComponents = mJac
611:                                        .listSharedLibraryDependents(aName,
612:                                                LIST_TARGET);
613:                                sLog
614:                                        .fine("ListBean.setSharedDepsTableData() dependentComponents="
615:                                                + dependentComponents);
616:                                compInfoList = JBIComponentInfo
617:                                        .readFromXmlText(dependentComponents);
618:                            } else // type = binding or engine
619:                            {
620:                                String requiredLibraries = mJac
621:                                        .listSharedLibraries(aName, LIST_TARGET);
622:                                sLog
623:                                        .fine("ListBean.setSharedDepsTableData() requiredLibraries="
624:                                                + requiredLibraries);
625:                                compInfoList = JBIComponentInfo
626:                                        .readFromXmlText(requiredLibraries);
627:
628:                            }
629:                        } else {
630:                            sLog
631:                                    .fine("ListBean.setSharedDepsTableData() scaffolding false");
632:                        }
633:                    }
634:                    mCachedDepsTableData = new ObjectListDataProvider(
635:                            compInfoList);
636:                } catch (com.sun.jbi.ui.common.JBIRemoteException jbiRemoteEx) {
637:                    sLog
638:                            .fine("ListBean.setSharedDepsTableData(): caught jbiRemoteEx="
639:                                    + jbiRemoteEx);
640:                } catch (Exception unexpectedEx) {
641:                    logSevereI18n(unexpectedEx);
642:                }
643:
644:            }
645:
646:            private String[] mUpdateList;
647:
648:            /**
649:             * cached data for table row group
650:             */
651:            private TableDataProvider mCachedTableData = null;
652:
653:            /**
654:             * cached data for dependencies table row group
655:             */
656:            private TableDataProvider mCachedDepsTableData = null;
657:
658:            /**
659:             * provides JBI common client administration interface.
660:             */
661:            private JBIAdminCommands mJac = BeanUtilities.getClient();
662:
663:            /** Holds value of property testCaseOptions. */
664:            private Option[] testCaseOptions = null;
665:
666:            /**
667:             * Holds the filter type for the components table
668:             */
669:            private String mFilterType = SharedConstants.DROP_DOWN_TYPE_SHOW_ALL;
670:
671:            /**
672:             * Holds the filter type for the components table
673:             */
674:            private String mFilterComponentState = SharedConstants.DROP_DOWN_TYPE_SHOW_ALL;
675:            private ArrayList mFilterComponentStates = null;
676:
677:            /**
678:             * Holds the filter type for the components table
679:             */
680:            private String mFilterAssemblyState = SharedConstants.DROP_DOWN_TYPE_SHOW_ALL;
681:            private ArrayList mFilterAssemblyStates = null;
682:
683:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.