Source Code Cross Referenced for ServiceImpl.java in  » EJB-Server-geronimo » plugins » org » apache » geronimo » axis » client » 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 » EJB Server geronimo » plugins » org.apache.geronimo.axis.client 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */package org.apache.geronimo.axis.client;
017:
018:        import java.io.IOException;
019:        import java.io.ObjectInputStream;
020:        import java.io.Serializable;
021:        import java.net.URL;
022:        import java.rmi.Remote;
023:        import java.util.Iterator;
024:        import java.util.Map;
025:        import javax.xml.namespace.QName;
026:        import javax.xml.rpc.Call;
027:        import javax.xml.rpc.ServiceException;
028:        import javax.xml.rpc.encoding.TypeMappingRegistry;
029:        import javax.xml.rpc.handler.HandlerRegistry;
030:
031:        import org.apache.axis.SimpleTargetedChain;
032:        import org.apache.axis.client.Service;
033:        import org.apache.axis.configuration.SimpleProvider;
034:        import org.apache.axis.encoding.TypeMappingRegistryImpl;
035:        import org.apache.axis.transport.http.HTTPSender;
036:
037:        /**
038:         * @version $Revision: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
039:         */
040:        public class ServiceImpl implements  javax.xml.rpc.Service, Serializable {
041:            private static final long serialVersionUID = 8657993237680414470L;
042:
043:            private transient Service delegate;
044:            private final Map seiClassNameToFactoryMap;
045:            private final Map portToImplementationMap;
046:
047:            public ServiceImpl(Map portToImplementationMap,
048:                    Map seiClassNameToFactoryMap) {
049:                this .portToImplementationMap = portToImplementationMap;
050:                this .seiClassNameToFactoryMap = seiClassNameToFactoryMap;
051:                buildDelegateService();
052:            }
053:
054:            private void buildDelegateService() {
055:                TypeMappingRegistryImpl typeMappingRegistry = new TypeMappingRegistryImpl();
056:                typeMappingRegistry.doRegisterFromVersion("1.3");
057:
058:                SimpleProvider engineConfiguration = new SimpleProvider(
059:                        typeMappingRegistry);
060:                engineConfiguration.deployTransport("http",
061:                        new SimpleTargetedChain(new HTTPSender()));
062:
063:                GeronimoAxisClient engine = new GeronimoAxisClient(
064:                        engineConfiguration, portToImplementationMap);
065:
066:                delegate = new Service(engineConfiguration, engine);
067:            }
068:
069:            public Remote getPort(QName qName, Class portClass)
070:                    throws ServiceException {
071:                if (qName != null) {
072:                    String portName = qName.getLocalPart();
073:                    Remote port = internalGetPort(portName);
074:                    return port;
075:                }
076:                return getPort(portClass);
077:            }
078:
079:            public Remote getPort(Class portClass) throws ServiceException {
080:                String fqcn = portClass.getName();
081:                Remote port = internalGetPortFromClassName(fqcn);
082:                return port;
083:            }
084:
085:            public Call[] getCalls(QName portName) throws ServiceException {
086:
087:                if (portName == null)
088:                    throw new ServiceException("Portname cannot be null");
089:
090:                SEIFactory factory = (SEIFactory) portToImplementationMap
091:                        .get(portName.getLocalPart());
092:                if (factory == null)
093:                    throw new ServiceException("No port for portname: "
094:                            + portName);
095:
096:                OperationInfo[] operationInfos = factory.getOperationInfos();
097:                javax.xml.rpc.Call[] array = new javax.xml.rpc.Call[operationInfos.length];
098:                for (int i = 0; i < operationInfos.length; i++) {
099:                    OperationInfo operation = operationInfos[i];
100:                    array[i] = delegate.createCall(factory.getPortQName(),
101:                            operation.getOperationName());
102:                }
103:                return array;
104:            }
105:
106:            public Call createCall(QName qName) throws ServiceException {
107:                return delegate.createCall(qName);
108:            }
109:
110:            public Call createCall(QName qName, QName qName1)
111:                    throws ServiceException {
112:                return delegate.createCall(qName, qName1);
113:            }
114:
115:            public Call createCall(QName qName, String s)
116:                    throws ServiceException {
117:                return delegate.createCall(qName, s);
118:            }
119:
120:            public Call createCall() throws ServiceException {
121:                return delegate.createCall();
122:            }
123:
124:            public QName getServiceName() {
125:                Iterator iterator = portToImplementationMap.values().iterator();
126:                if (!iterator.hasNext())
127:                    return null;
128:                SEIFactory factory = (SEIFactory) iterator.next();
129:                return factory.getServiceName();
130:            }
131:
132:            public Iterator getPorts() throws ServiceException {
133:                return portToImplementationMap.values().iterator();
134:            }
135:
136:            public URL getWSDLDocumentLocation() {
137:                Iterator iterator = portToImplementationMap.values().iterator();
138:                if (!iterator.hasNext())
139:                    return null;
140:                SEIFactory factory = (SEIFactory) iterator.next();
141:                return factory.getWSDLDocumentLocation();
142:            }
143:
144:            public TypeMappingRegistry getTypeMappingRegistry() {
145:                throw new UnsupportedOperationException();
146:                //return delegate.getTypeMappingRegistry();
147:            }
148:
149:            public HandlerRegistry getHandlerRegistry() {
150:                throw new UnsupportedOperationException();
151:            }
152:
153:            Remote internalGetPort(String portName) throws ServiceException {
154:                if (portToImplementationMap.containsKey(portName)) {
155:                    SEIFactory seiFactory = (SEIFactory) portToImplementationMap
156:                            .get(portName);
157:                    Remote port = seiFactory.createServiceEndpoint();
158:                    return port;
159:                }
160:                throw new ServiceException("No port for portname: " + portName);
161:            }
162:
163:            Remote internalGetPortFromClassName(String className)
164:                    throws ServiceException {
165:                if (seiClassNameToFactoryMap.containsKey(className)) {
166:                    SEIFactory seiFactory = (SEIFactory) seiClassNameToFactoryMap
167:                            .get(className);
168:                    Remote port = seiFactory.createServiceEndpoint();
169:                    return port;
170:                }
171:                throw new ServiceException("no port for class " + className);
172:            }
173:
174:            private void readObject(ObjectInputStream in) throws IOException,
175:                    ClassNotFoundException {
176:                in.defaultReadObject();
177:                buildDelegateService();
178:            }
179:
180:            Service getService() {
181:                return delegate;
182:            }
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.