Source Code Cross Referenced for ImportImpl.java in  » ESB » open-esb » com » sun » jbi » wsdl2 » impl » 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.wsdl2.impl 
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:         * @(#)ImportImpl.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package com.sun.jbi.wsdl2.impl;
030:
031:        import com.sun.jbi.wsdl2.WsdlException;
032:
033:        import java.io.IOException;
034:
035:        import java.util.Map;
036:
037:        import org.w3.ns.wsdl.ImportType;
038:
039:        /**
040:         * Implementation of WSDL 2.0 Import component.
041:         * 
042:         * @author Sun Microsystems, Inc.
043:         */
044:        final class ImportImpl extends Import {
045:            /** The container for this import component */
046:            private DescriptionImpl mContainer;
047:
048:            /** The result of importing this component */
049:            private DescriptionImpl mImportResult = null;
050:
051:            /**
052:             * Get the container for this component.
053:             * 
054:             * @return The component for this component
055:             */
056:            protected DescriptionImpl getContainer() {
057:                return this .mContainer;
058:            }
059:
060:            /**
061:             * Construct this Import component implementation from the given XML bean.
062:             * @param bean The import XML bean to use to construct this component.
063:             * @param defs The container for this component.
064:             */
065:            private ImportImpl(ImportType bean, DescriptionImpl defs) {
066:                super (bean);
067:                this .mContainer = defs;
068:            }
069:
070:            /** Map of WSDL-defined attribute QNames. Keyed by QName.toString value */
071:            private static java.util.Map sWsdlAttributeQNames = null;
072:
073:            /** 
074:             * Worker class method for {@link #getWsdlAttributeNameMap()}.
075:             * 
076:             * @return Map of WSDL-defined attribute QNames for this component, 
077:             *         indexed by QName.toString()
078:             */
079:            static synchronized java.util.Map getAttributeNameMap() {
080:                if (sWsdlAttributeQNames == null) {
081:                    sWsdlAttributeQNames = XmlBeansUtil
082:                            .getAttributesMap(ImportType.type);
083:                }
084:
085:                return sWsdlAttributeQNames;
086:            }
087:
088:            /**
089:             * Get map of WSDL-defined attribute QNames for this component, indexed by 
090:             * canonical QName string (see {@link javax.xml.namespace.QName#toString()}.
091:             *
092:             * @return Map of WSDL-defined attribute QNames for this component, 
093:             *         indexed by QName.toString()
094:             */
095:            public java.util.Map getWsdlAttributeNameMap() {
096:                return getAttributeNameMap();
097:            }
098:
099:            /**
100:             * Get target namespace of import (must be different that this Description TNS).
101:             *
102:             * @return Target namespace of import (must be different that this Description TNS)
103:             */
104:            public String getNamespace() {
105:                return getBean().getNamespace();
106:            }
107:
108:            /**
109:             * Set target namespace of import (must be different that this Description TNS).
110:             *
111:             * @param theNamespace Target namespace of import (must be different that this 
112:             *                     Description TNS)
113:             */
114:            public void setNamespace(String theNamespace) {
115:                getBean().setNamespace(theNamespace);
116:            }
117:
118:            /**
119:             * Get location hint, if any.
120:             *
121:             * @return Location hint, if any
122:             */
123:            public String getLocation() {
124:                return getBean().getLocation();
125:            }
126:
127:            /**
128:             * Set location hint, if any.
129:             *
130:             * @param theLocation Location hint, if any
131:             */
132:            public void setLocation(String theLocation) {
133:                getBean().setLocation(theLocation);
134:            }
135:
136:            /**
137:             * Get the description from this import component
138:             *
139:             * @return Description from this import component, if any
140:             */
141:            public synchronized com.sun.jbi.wsdl2.Description getDescription() {
142:                if (this .mImportResult == null) {
143:                    mImportResult = importTarget();
144:                }
145:
146:                return this .mImportResult;
147:            }
148:
149:            /**
150:             * Get the definitions from this import component.
151:             *
152:             * @deprecated - replaced by getDescription
153:             * @return Definitions n from this import component, if any
154:             */
155:            public com.sun.jbi.wsdl2.Definitions getDefinitions() {
156:                return (com.sun.jbi.wsdl2.Definitions) getDescription();
157:            }
158:
159:            /**
160:             * Import the target of this import component, if possible.
161:             * 
162:             * @return The definitions component imported by this component, if any.
163:             */
164:            private DescriptionImpl importTarget() {
165:                WsdlReader reader = new WsdlReader();
166:                com.sun.jbi.wsdl2.Description defs = null;
167:
168:                try {
169:                    defs = reader.readDescription(mContainer
170:                            .getDocumentBaseUri(), getLocation());
171:                } catch (IOException ex) {
172:                    System.err.println("WSDL import IO error reading "
173:                            + getLocation() + " (relative to) "
174:                            + mContainer.getDocumentBaseUri() + ":");
175:
176:                    if (ex.getMessage() != null) {
177:                        System.err.println(ex.getMessage());
178:                    }
179:
180:                    ex.printStackTrace(System.err);
181:                } catch (WsdlException ex) {
182:                    System.err.println("WSDL import error reading "
183:                            + getLocation() + " (relative to) "
184:                            + mContainer.getDocumentBaseUri() + ":");
185:
186:                    if (ex.getMessage() != null) {
187:                        System.err.println(ex.getMessage());
188:                    }
189:
190:                    ex.printStackTrace(System.err);
191:                }
192:
193:                return defs != null ? (DescriptionImpl) defs : null;
194:            }
195:
196:            /**
197:             * A factory class for creating / finding components for given XML beans.
198:             * <p>
199:             * This factory guarantees that there will only be one component for each
200:             * XML bean instance.
201:             */
202:            static class Factory {
203:                /**
204:                 * Find the WSDL import component associated with the given XML
205:                 * bean, creating a new component if necessary.
206:                 * <p>
207:                 * This is thread-safe.<p>
208:                 * 
209:                 * @param bean The XML bean to find the component for.
210:                 * @param defs The container for the component.
211:                 * @return The WSDL import component for the given <code>bean</code>
212:                 *         (null if the <code>bean</code> is null).
213:                 */
214:                static ImportImpl getInstance(ImportType bean,
215:                        DescriptionImpl defs) {
216:                    ImportImpl result;
217:
218:                    if (bean != null) {
219:                        Map map = defs.getImportMap();
220:
221:                        synchronized (map) {
222:                            result = (ImportImpl) map.get(bean);
223:
224:                            if (result == null) {
225:                                result = new ImportImpl(bean, defs);
226:                                map.put(bean, result);
227:                            }
228:                        }
229:                    } else {
230:                        result = null;
231:                    }
232:
233:                    return result;
234:                }
235:            }
236:        }
237:
238:        // End-of-file: ImportImpl.java
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.