Source Code Cross Referenced for AbstractWsdl4jDefinitionBuilder.java in  » Web-Services » spring-ws-1.0.0 » org » springframework » ws » wsdl » wsdl11 » builder » 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 » Web Services » spring ws 1.0.0 » org.springframework.ws.wsdl.wsdl11.builder 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006 the original author or authors.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.springframework.ws.wsdl.wsdl11.builder;
018:
019:        import javax.wsdl.Definition;
020:        import javax.wsdl.WSDLException;
021:        import javax.wsdl.extensions.ExtensibilityElement;
022:        import javax.wsdl.extensions.ExtensionRegistry;
023:        import javax.wsdl.factory.WSDLFactory;
024:        import javax.xml.namespace.QName;
025:
026:        import org.apache.commons.logging.Log;
027:        import org.apache.commons.logging.LogFactory;
028:        import org.springframework.ws.wsdl.WsdlDefinitionException;
029:        import org.springframework.ws.wsdl.wsdl11.Wsdl11Definition;
030:        import org.springframework.ws.wsdl.wsdl11.Wsdl11DefinitionBuilder;
031:        import org.springframework.ws.wsdl.wsdl11.Wsdl4jDefinition;
032:        import org.springframework.ws.wsdl.wsdl11.Wsdl4jDefinitionException;
033:
034:        /**
035:         * Abstract base class for <code>Wsdl11DefinitionBuilder</code> implementations that use WSDL4J. Creates a base {@link
036:         * Definition}, and passes that to subclass template methods.
037:         *
038:         * @author Arjen Poutsma
039:         * @since 1.0.0
040:         */
041:        public abstract class AbstractWsdl4jDefinitionBuilder implements 
042:                Wsdl11DefinitionBuilder {
043:
044:            /** Logger available to subclasses. */
045:            protected final Log logger = LogFactory.getLog(getClass());
046:
047:            /** WSDL4J extension registry. Lazily created in <code>createExtension()</code>. */
048:            private ExtensionRegistry extensionRegistry;
049:
050:            /** The WSDL4J <code>Definition</code> created by <code>buildDefinition()</code>. */
051:            private Definition definition;
052:
053:            public final void buildDefinition() throws WsdlDefinitionException {
054:                try {
055:                    WSDLFactory wsdlFactory = WSDLFactory.newInstance();
056:                    definition = wsdlFactory.newDefinition();
057:                    populateDefinition(definition);
058:                } catch (WSDLException ex) {
059:                    throw new Wsdl4jDefinitionException(ex);
060:                }
061:            }
062:
063:            /**
064:             * Called after the <code>Definition</code> has been created, but before any sub-elements are added. Default
065:             * implementation is empty.
066:             *
067:             * @param definition the WSDL4J <code>Definition</code>
068:             * @throws WSDLException in case of errors
069:             * @see #buildDefinition()
070:             */
071:            protected void populateDefinition(Definition definition)
072:                    throws WSDLException {
073:            }
074:
075:            public final void buildImports() throws WsdlDefinitionException {
076:                try {
077:                    buildImports(definition);
078:                } catch (WSDLException ex) {
079:                    throw new Wsdl4jDefinitionException(ex);
080:                }
081:            }
082:
083:            /**
084:             * Adds imports to the definition.
085:             *
086:             * @param definition the WSDL4J <code>Definition</code>
087:             * @throws WSDLException in case of errors
088:             */
089:            protected abstract void buildImports(Definition definition)
090:                    throws WSDLException;
091:
092:            public final void buildTypes() throws WsdlDefinitionException {
093:                try {
094:                    buildTypes(definition);
095:                } catch (WSDLException ex) {
096:                    throw new Wsdl4jDefinitionException(ex);
097:                }
098:            }
099:
100:            /**
101:             * Adds types to the definition.
102:             *
103:             * @param definition the WSDL4J <code>Definition</code>
104:             * @throws WSDLException in case of errors
105:             */
106:            protected abstract void buildTypes(Definition definition)
107:                    throws WSDLException;
108:
109:            public final void buildMessages() throws WsdlDefinitionException {
110:                try {
111:                    buildMessages(definition);
112:                } catch (WSDLException ex) {
113:                    throw new Wsdl4jDefinitionException(ex);
114:                }
115:            }
116:
117:            /**
118:             * Adds messages to the definition.
119:             *
120:             * @param definition the WSDL4J <code>Definition</code>
121:             * @throws WSDLException in case of errors
122:             */
123:            protected abstract void buildMessages(Definition definition)
124:                    throws WSDLException;
125:
126:            public final void buildPortTypes() throws WsdlDefinitionException {
127:                try {
128:                    buildPortTypes(definition);
129:                } catch (WSDLException ex) {
130:                    throw new Wsdl4jDefinitionException(ex);
131:                }
132:            }
133:
134:            /**
135:             * Adds port types to the definition.
136:             *
137:             * @param definition the WSDL4J <code>Definition</code>
138:             * @throws WSDLException in case of errors
139:             */
140:            protected abstract void buildPortTypes(Definition definition)
141:                    throws WSDLException;
142:
143:            public final void buildBindings() throws WsdlDefinitionException {
144:                try {
145:                    buildBindings(definition);
146:                } catch (WSDLException ex) {
147:                    throw new Wsdl4jDefinitionException(ex);
148:                }
149:            }
150:
151:            /**
152:             * Adds bindings to the definition.
153:             *
154:             * @param definition the WSDL4J <code>Definition</code>
155:             * @throws WSDLException in case of errors
156:             */
157:            protected abstract void buildBindings(Definition definition)
158:                    throws WSDLException;
159:
160:            public final void buildServices() throws WsdlDefinitionException {
161:                try {
162:                    buildServices(definition);
163:                } catch (WSDLException ex) {
164:                    throw new Wsdl4jDefinitionException(ex);
165:                }
166:            }
167:
168:            /**
169:             * Adds services to the definition.
170:             *
171:             * @param definition the WSDL4J <code>Definition</code>
172:             * @throws WSDLException in case of errors
173:             */
174:            protected abstract void buildServices(Definition definition)
175:                    throws WSDLException;
176:
177:            public final Wsdl11Definition getDefinition()
178:                    throws WsdlDefinitionException {
179:                return new Wsdl4jDefinition(definition);
180:            }
181:
182:            /**
183:             * Creates a WSDL4J extensibility element.
184:             *
185:             * @param parentType  a class object indicating where in the WSDL definition this extension will exist
186:             * @param elementType the qname of the extensibility element
187:             * @return the extensibility element
188:             * @throws WSDLException in case of errors
189:             * @see javax.wsdl.extensions.ExtensionRegistry#createExtension(Class,javax.xml.namespace.QName)
190:             */
191:            protected ExtensibilityElement createExtension(Class parentType,
192:                    QName elementType) throws WSDLException {
193:                if (extensionRegistry == null) {
194:                    WSDLFactory wsdlFactory = WSDLFactory.newInstance();
195:                    extensionRegistry = wsdlFactory
196:                            .newPopulatedExtensionRegistry();
197:                }
198:                return extensionRegistry.createExtension(parentType,
199:                        elementType);
200:            }
201:
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.