Source Code Cross Referenced for MarshalServiceRuntimeDescriptionBuilder.java in  » Web-Services-AXIS2 » jax-ws » org » apache » axis2 » jaxws » runtime » description » marshal » 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 » Web Services AXIS2 » jax ws » org.apache.axis2.jaxws.runtime.description.marshal.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements. See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership. The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License. You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied. See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:        package org.apache.axis2.jaxws.runtime.description.marshal.impl;
020:
021:        import org.apache.axis2.jaxws.ExceptionFactory;
022:        import org.apache.axis2.jaxws.description.ServiceDescription;
023:        import org.apache.axis2.jaxws.runtime.description.marshal.AnnotationDesc;
024:        import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription;
025:        import org.apache.axis2.jaxws.utility.PropertyDescriptorPlus;
026:        import org.apache.commons.logging.Log;
027:        import org.apache.commons.logging.LogFactory;
028:
029:        import java.util.HashMap;
030:        import java.util.Map;
031:        import java.util.TreeSet;
032:
033:        public class MarshalServiceRuntimeDescriptionBuilder {
034:
035:            private static Log log = LogFactory
036:                    .getLog(MarshalServiceRuntimeDescriptionBuilder.class);
037:
038:            /** Intentionally Private */
039:            private MarshalServiceRuntimeDescriptionBuilder() {
040:            }
041:
042:            /**
043:             * create
044:             *
045:             * @param opDesc
046:             * @param implClassName
047:             * @return
048:             */
049:            static public MarshalServiceRuntimeDescription create(
050:                    ServiceDescription serviceDesc) {
051:                MarshalServiceRuntimeDescriptionImpl desc = new MarshalServiceRuntimeDescriptionImpl(
052:                        getKey(), serviceDesc);
053:                init(desc, serviceDesc);
054:                return desc;
055:            }
056:
057:            static public String getKey() {
058:                return "JAXWS-MARSHAL";
059:            }
060:
061:            /**
062:             * @param implClass
063:             * @return true if Field or Method has a @Resource annotation
064:             */
065:            static private void init(
066:                    MarshalServiceRuntimeDescriptionImpl marshalDesc,
067:                    ServiceDescription serviceDesc) {
068:
069:                // Artifact class discovery/builder
070:                ArtifactProcessor artifactProcessor = new ArtifactProcessor(
071:                        serviceDesc);
072:                try {
073:                    artifactProcessor.build();
074:                } catch (Throwable t) {
075:                    ExceptionFactory.makeWebServiceException(t);
076:                }
077:                marshalDesc.setRequestWrapperMap(artifactProcessor
078:                        .getRequestWrapperMap());
079:                marshalDesc.setResponseWrapperMap(artifactProcessor
080:                        .getResponseWrapperMap());
081:                marshalDesc.setFaultBeanDescMap(artifactProcessor
082:                        .getFaultBeanDescMap());
083:
084:                // Build the annotation map
085:                Map<String, AnnotationDesc> map;
086:                try {
087:                    map = AnnotationBuilder.getAnnotationDescs(serviceDesc,
088:                            artifactProcessor);
089:                } catch (Throwable t) {
090:                    // Since we are building a cache, proceed without exception
091:                    if (log.isDebugEnabled()) {
092:                        log
093:                                .debug("Exception occurred during cache processing.  This will impact performance:"
094:                                        + t);
095:                    }
096:                    map = new HashMap<String, AnnotationDesc>();
097:                }
098:                marshalDesc.setAnnotationMap(map);
099:
100:                // Build the property descriptor map
101:                Map<Class, Map<String, PropertyDescriptorPlus>> cache;
102:                try {
103:                    cache = PropertyDescriptorMapBuilder.getPropertyDescMaps(
104:                            serviceDesc, artifactProcessor);
105:                } catch (Throwable t) {
106:                    // Since we are building a cache, proceed without exception
107:                    if (log.isDebugEnabled()) {
108:                        log
109:                                .debug("Exception occurred during cache processing.  This will impact performance:"
110:                                        + t);
111:                    }
112:                    cache = new HashMap<Class, Map<String, PropertyDescriptorPlus>>();
113:                }
114:                marshalDesc.setPropertyDescriptorMapCache(cache);
115:
116:                // @TODO There are two ways to get the packages.
117:                // Schema Walk (prefered) and Annotation Walk.
118:                // The Schema walk requires an existing or generated schema.
119:                // 
120:                // There are some limitations in the current schema walk
121:                // And there are problems in the annotation walk.
122:                // So for now we will do both.
123:                TreeSet<String> packages = new TreeSet<String>();
124:                boolean doSchemaWalk = true;
125:                boolean doAnnotationWalk = true;
126:                packages = new TreeSet<String>();
127:                if (doSchemaWalk) {
128:                    packages.addAll(PackageSetBuilder
129:                            .getPackagesFromSchema(serviceDesc));
130:                }
131:                if (doAnnotationWalk) {
132:                    // Get the package names from the annotations.  Use the annotation map to reduce Annotation introspection
133:                    packages.addAll(PackageSetBuilder
134:                            .getPackagesFromAnnotations(serviceDesc,
135:                                    marshalDesc));
136:                }
137:                marshalDesc.setPackages(packages);
138:            }
139:        }
w___w___w_.___j___av__a__2__s___.__com_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.