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


001:        /*
002:         * BEGIN_HEADER - DO NOT EDIT
003:         *
004:         * The contents of this file are subject to the terms
005:         * of the Common Development and Distribution License
006:         * (the "License").  You may not use this file except
007:         * in compliance with the License.
008:         *
009:         * You can obtain a copy of the license at
010:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011:         * See the License for the specific language governing
012:         * permissions and limitations under the License.
013:         *
014:         * When distributing Covered Code, include this CDDL
015:         * HEADER in each file and include the License file at
016:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017:         * If applicable add the following below this CDDL HEADER,
018:         * with the fields enclosed by brackets "[]" replaced with
019:         * your own identifying information: Portions Copyright
020:         * [year] [name of copyright owner]
021:         */
022:
023:        /*
024:         * @(#)JbiListBindingComponentsTask.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package com.sun.jbi.ui.ant;
030:
031:        import com.sun.jbi.ui.common.JBIComponentInfo;
032:        import java.util.ArrayList;
033:        import org.apache.tools.ant.BuildException;
034:
035:        /** This class is an ant task for displaying binding components information.
036:         *
037:         * @author Sun Microsystems, Inc.
038:         */
039:        public class JbiListBindingComponentsTask extends
040:                JbiQueryTask.JbiComponentQueryTask {
041:
042:            /**
043:             * success msg key
044:             */
045:            private static final String SUCCESS_STATUS_KEY = "jbi.ui.ant.list.bindings.successful";
046:            /**
047:             * failure msg key
048:             */
049:            private static final String FAILED_STATUS_KEY = "jbi.ui.ant.list.bindings.failed";
050:
051:            /**
052:             * Holds value of property binding component name.
053:             */
054:            private String mBindingComponentName;
055:
056:            /**
057:             * Holds value of property descriptor (flag) which indicates whether showing descriptor or nor.
058:             */
059:            private boolean mDescriptor;
060:
061:            /**
062:             * contructor
063:             */
064:            public JbiListBindingComponentsTask() {
065:                super ();
066:            }
067:
068:            /**
069:             * Getter for property binding component name.
070:             * @return Value of property binding component name.
071:             */
072:            public String getBindingComponentName() {
073:                return this .mBindingComponentName;
074:            }
075:
076:            /**
077:             * Setter for property binding component name.
078:             * @param bindingComponentName name of the binding component
079:             */
080:            public void setBindingComponentName(String bindingComponentName) {
081:                this .mBindingComponentName = bindingComponentName;
082:            }
083:
084:            /**
085:             * Getter for property descriptor (flag) which indicates showing descriptor or not.
086:             * @return Value of property descriptor.
087:             */
088:            public boolean getDescriptor() {
089:                return this .mDescriptor;
090:            }
091:
092:            /**
093:             * Setter for property descriptor  (flag) which indicates showing descriptor or not..
094:             * @param descriptor New value of property descriptor.
095:             */
096:            public void setDescriptor(boolean descriptor) {
097:                this .mDescriptor = descriptor;
098:            }
099:
100:            /** executes the list binding component task. Ant Task framework calls this method to
101:             * excute the task.
102:             * @throws BuildException if error or exception occurs.
103:             */
104:            public void executeTask() throws BuildException {
105:                // set a empty component info list if xml output set
106:                initXmlOutput(JBIComponentInfo.writeAsXmlText(new ArrayList()));
107:
108:                validateTaskPropertyForStateValue(getState());
109:                String target = getValidTarget();
110:
111:                try {
112:                    String result;
113:                    String descriptor = null;
114:
115:                    String name = this .getBindingComponentName();
116:
117:                    if (null != name && name.length() > 0) {
118:                        // if binding component name present, execute show to display single object info.
119:                        result = this .getJBIAdminCommands()
120:                                .showBindingComponent(name,
121:                                        toJbiComponentInfoState(getState()),
122:                                        getSharedLibraryName(),
123:                                        getServiceAssemblyName(), target);
124:                        this .setSingleQueryResultType();
125:
126:                        if (mDescriptor == true) {
127:                            descriptor = this .getJBIAdminCommands()
128:                                    .getComponentInstallationDescriptor(name);
129:                            if (descriptor == null) {
130:                                String errMsg = createFailedFormattedJbiAdminResult(
131:                                        "jbi.ui.ant.show.component.descriptor.not.found",
132:                                        new String[] { name });
133:                                throw new Exception(errMsg);
134:                            }
135:                        }
136:                    } else {
137:                        if (mDescriptor == true) {
138:                            String errMsg = createFailedFormattedJbiAdminResult(
139:                                    "jbi.ui.ant.show.component.descriptor.single.only",
140:                                    null);
141:                            throw new Exception(errMsg);
142:                        }
143:
144:                        result = this .getJBIAdminCommands()
145:                                .listBindingComponents(
146:                                        toJbiComponentInfoState(getState()),
147:                                        getSharedLibraryName(),
148:                                        getServiceAssemblyName(), target);
149:                    }
150:
151:                    printComponentQueryResults(result);
152:
153:                    if (descriptor != null) {
154:                        printMessage("");
155:                        printMessage(getI18NBundle().getMessage(
156:                                "jbi.ui.ant.print.comp.descriptor"));
157:                        printMessage(descriptor);
158:                        printMessage("");
159:                    }
160:                } catch (Exception ex) {
161:                    // throwTaskBuildException(ex);
162:                    processTaskException(ex);
163:                }
164:
165:            }
166:
167:            /**
168:             * returns i18n key. tasks implement this method.
169:             * @return i18n key for the success status
170:             */
171:            protected String getTaskFailedStatusI18NKey() {
172:                return FAILED_STATUS_KEY;
173:            }
174:
175:            /**
176:             * returns i18n key. tasks implement this method.
177:             * @return i18n key for the failed status
178:             */
179:            protected String getTaskSuccessStatusI18NKey() {
180:                return SUCCESS_STATUS_KEY;
181:            }
182:
183:            /**
184:             * returns i18n key
185:             * @return the i18n key
186:             */
187:            protected String getEmptyQueryResultI18NKey() {
188:                return "jbi.ui.ant.print.no.bindings";
189:            }
190:
191:            /**
192:             * returns i18n key
193:             * @return the i18n key
194:             */
195:            protected String getQueryResultHeaderI18NKey() {
196:                return "jbi.ui.ant.print.bindings.header";
197:            }
198:
199:            /**
200:             * returns i18n key
201:             * @return the i18n key
202:             */
203:            protected String getQueryResultHeaderSeparatorI18NKey() {
204:                return "jbi.ui.ant.print.comp.info.header.separator";
205:            }
206:
207:            /**
208:             * returns i18n key
209:             * @return the i18n key
210:             */
211:            protected String getQueryResultPageSeparatorI18NKey() {
212:                return "jbi.ui.ant.print.comp.info.separator";
213:            }
214:
215:            /**
216:             * return the i18n message for empty results
217:             * @return string
218:             */
219:            protected String getEmptyQueryResultI18NMessage() {
220:                if (this .getQueryResultType() == this .SINGLE_QUERY_RESULT_TYPE) {
221:                    return getI18NBundle().getMessage(
222:                            "jbi.ui.ant.print.no.binding.with.name",
223:                            this.getBindingComponentName());
224:                } else {
225:                    return getI18NBundle().getMessage(
226:                            getEmptyQueryResultI18NKey());
227:                }
228:            }
229:
230:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.