author | mkos |
Fri, 30 Oct 2015 10:34:46 +0100 | |
changeset 33547 | e4c76ac38b12 |
parent 25871 | b80b84e87032 |
permissions | -rw-r--r-- |
12009 | 1 |
/* |
16791 | 2 |
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
12009 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package com.sun.xml.internal.ws.db; |
|
27 |
||
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import java.io.OutputStream; |
|
31 |
import java.lang.reflect.Method; |
|
32 |
import java.util.HashMap; |
|
33 |
import java.util.Map; |
|
34 |
||
35 |
import javax.xml.ws.WebServiceFeature; |
|
36 |
||
16791 | 37 |
import com.oracle.webservices.internal.api.databinding.JavaCallInfo; |
38 |
import com.oracle.webservices.internal.api.message.MessageContext; |
|
12009 | 39 |
import com.sun.xml.internal.ws.api.databinding.EndpointCallBridge; |
40 |
import com.sun.xml.internal.ws.api.databinding.WSDLGenInfo; |
|
41 |
import com.sun.xml.internal.ws.api.databinding.Databinding; |
|
42 |
import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; |
|
43 |
import com.sun.xml.internal.ws.api.databinding.ClientCallBridge; |
|
44 |
import com.sun.xml.internal.ws.api.message.Message; |
|
16791 | 45 |
import com.sun.xml.internal.ws.api.message.MessageContextFactory; |
12009 | 46 |
import com.sun.xml.internal.ws.api.message.Packet; |
47 |
import com.sun.xml.internal.ws.api.model.MEP; |
|
48 |
import com.sun.xml.internal.ws.api.model.SEIModel; |
|
16791 | 49 |
import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; |
12009 | 50 |
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; |
51 |
import com.sun.xml.internal.ws.api.pipe.Codec; |
|
52 |
import com.sun.xml.internal.ws.api.pipe.ContentType; |
|
53 |
import com.sun.xml.internal.ws.binding.BindingImpl; |
|
54 |
import com.sun.xml.internal.ws.client.sei.StubAsyncHandler; |
|
55 |
import com.sun.xml.internal.ws.client.sei.StubHandler; |
|
56 |
import com.sun.xml.internal.ws.model.AbstractSEIModelImpl; |
|
57 |
import com.sun.xml.internal.ws.model.JavaMethodImpl; |
|
58 |
import com.sun.xml.internal.ws.model.RuntimeModeler; |
|
59 |
import com.sun.xml.internal.ws.server.sei.TieHandler; |
|
60 |
import com.sun.xml.internal.ws.wsdl.ActionBasedOperationSignature; |
|
61 |
import com.sun.xml.internal.ws.wsdl.DispatchException; |
|
62 |
import com.sun.xml.internal.ws.wsdl.OperationDispatcher; |
|
63 |
||
64 |
/** |
|
65 |
* WsRuntimeImpl is the databinding processor built on SEIModel |
|
66 |
* |
|
67 |
* @author shih-chang.chen@oracle.com |
|
68 |
*/ |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
69 |
public final class DatabindingImpl implements Databinding { |
12009 | 70 |
|
71 |
AbstractSEIModelImpl seiModel; |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
72 |
Map<Method, StubHandler> stubHandlers; |
16791 | 73 |
// QNameMap<TieHandler> wsdlOpMap = new QNameMap<TieHandler>(); |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
74 |
Map<JavaMethodImpl, TieHandler> wsdlOpMap = new HashMap<JavaMethodImpl, TieHandler>(); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
75 |
Map<Method, TieHandler> tieHandlers = new HashMap<Method, TieHandler>(); |
12009 | 76 |
OperationDispatcher operationDispatcher; |
77 |
OperationDispatcher operationDispatcherNoWsdl; |
|
78 |
boolean clientConfig = false; |
|
79 |
Codec codec; |
|
16791 | 80 |
MessageContextFactory packetFactory = null; |
12009 | 81 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
82 |
public DatabindingImpl(DatabindingProviderImpl p, DatabindingConfig config) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
83 |
RuntimeModeler modeler = new RuntimeModeler(config); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
84 |
modeler.setClassLoader(config.getClassLoader()); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
85 |
seiModel = modeler.buildRuntimeModel(); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
86 |
WSDLPort wsdlport = config.getWsdlPort(); |
33547
e4c76ac38b12
8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents:
25871
diff
changeset
|
87 |
Object facProp = config.properties().get("com.sun.xml.internal.ws.api.message.MessageContextFactory"); |
e4c76ac38b12
8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents:
25871
diff
changeset
|
88 |
packetFactory = (facProp != null && facProp instanceof MessageContextFactory)? (MessageContextFactory)facProp : |
e4c76ac38b12
8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents:
25871
diff
changeset
|
89 |
new MessageContextFactory(seiModel.getWSBinding().getFeatures()); |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
90 |
clientConfig = isClientConfig(config); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
91 |
if (clientConfig) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
92 |
initStubHandlers(); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
93 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
94 |
seiModel.setDatabinding(this); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
95 |
if (wsdlport != null) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
96 |
freeze(wsdlport); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
97 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
98 |
if (operationDispatcher == null) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
99 |
operationDispatcherNoWsdl = new OperationDispatcher(null, seiModel.getWSBinding(), seiModel); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
100 |
} |
12009 | 101 |
// if(!clientConfig) { |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
102 |
for (JavaMethodImpl jm : seiModel.getJavaMethods()) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
103 |
if (!jm.isAsync()) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
104 |
TieHandler th = new TieHandler(jm, seiModel.getWSBinding(), packetFactory); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
105 |
wsdlOpMap.put(jm, th); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
106 |
tieHandlers.put(th.getMethod(), th); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
107 |
} |
12009 | 108 |
} |
109 |
// } |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
110 |
} |
12009 | 111 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
112 |
//TODO isClientConfig |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
113 |
private boolean isClientConfig(DatabindingConfig config) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
114 |
if (config.getContractClass() == null) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
115 |
return false; |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
116 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
117 |
if (!config.getContractClass().isInterface()) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
118 |
return false; |
12009 | 119 |
} |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
120 |
return (config.getEndpointClass() == null || config.getEndpointClass().isInterface()); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
121 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
122 |
//TODO fix freeze |
12009 | 123 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
124 |
public void freeze(WSDLPort port) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
125 |
if (clientConfig) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
126 |
return; |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
127 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
128 |
synchronized(this) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
129 |
if (operationDispatcher == null) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
130 |
operationDispatcher = (port == null) ? null : new OperationDispatcher(port, seiModel.getWSBinding(), seiModel); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
131 |
} |
12009 | 132 |
} |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
133 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
134 |
|
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
135 |
public SEIModel getModel() { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
136 |
return seiModel; |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
137 |
} |
12009 | 138 |
//Refactored from SEIStub |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
139 |
|
12009 | 140 |
private void initStubHandlers() { |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
141 |
stubHandlers = new HashMap<Method, StubHandler>(); |
12009 | 142 |
Map<ActionBasedOperationSignature, JavaMethodImpl> syncs = new HashMap<ActionBasedOperationSignature, JavaMethodImpl>(); |
143 |
// fill in methodHandlers. |
|
144 |
// first fill in sychronized versions |
|
145 |
for (JavaMethodImpl m : seiModel.getJavaMethods()) { |
|
146 |
if (!m.getMEP().isAsync) { |
|
16791 | 147 |
StubHandler handler = new StubHandler(m, packetFactory); |
12009 | 148 |
syncs.put(m.getOperationSignature(), m); |
149 |
stubHandlers.put(m.getMethod(), handler); |
|
150 |
} |
|
151 |
} |
|
152 |
for (JavaMethodImpl jm : seiModel.getJavaMethods()) { |
|
153 |
JavaMethodImpl sync = syncs.get(jm.getOperationSignature()); |
|
154 |
if (jm.getMEP() == MEP.ASYNC_CALLBACK || jm.getMEP() == MEP.ASYNC_POLL) { |
|
155 |
Method m = jm.getMethod(); |
|
16791 | 156 |
StubAsyncHandler handler = new StubAsyncHandler(jm, sync, packetFactory); |
12009 | 157 |
stubHandlers.put(m, handler); |
158 |
} |
|
159 |
} |
|
160 |
} |
|
161 |
||
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
162 |
JavaMethodImpl resolveJavaMethod(Packet req) throws DispatchException { |
16791 | 163 |
WSDLOperationMapping m = req.getWSDLOperationMapping(); |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
164 |
if (m == null) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
165 |
synchronized (this) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
166 |
m = (operationDispatcher != null) |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
167 |
? operationDispatcher.getWSDLOperationMapping(req) |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
168 |
: operationDispatcherNoWsdl.getWSDLOperationMapping(req); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
169 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
170 |
} |
16791 | 171 |
return (JavaMethodImpl) m.getJavaMethod(); |
12009 | 172 |
} |
173 |
||
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
174 |
public JavaCallInfo deserializeRequest(Packet req) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
175 |
com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo(); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
176 |
try { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
177 |
JavaMethodImpl wsdlOp = resolveJavaMethod(req); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
178 |
TieHandler tie = wsdlOpMap.get(wsdlOp); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
179 |
call.setMethod(tie.getMethod()); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
180 |
Object[] args = tie.readRequest(req.getMessage()); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
181 |
call.setParameters(args); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
182 |
} catch (DispatchException e) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
183 |
call.setException(e); |
12009 | 184 |
} |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
185 |
return call; |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
186 |
} |
12009 | 187 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
188 |
public JavaCallInfo deserializeResponse(Packet res, JavaCallInfo call) { |
12009 | 189 |
StubHandler stubHandler = stubHandlers.get(call.getMethod()); |
190 |
try { |
|
191 |
return stubHandler.readResponse(res, call); |
|
192 |
} catch (Throwable e) { |
|
193 |
call.setException(e); |
|
194 |
return call; |
|
195 |
} |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
196 |
} |
12009 | 197 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
198 |
public WebServiceFeature[] getFeatures() { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
199 |
// TODO Auto-generated method stub |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
200 |
return null; |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
201 |
} |
12009 | 202 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
203 |
@Override |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
204 |
public Packet serializeRequest(JavaCallInfo call) { |
12009 | 205 |
StubHandler stubHandler = stubHandlers.get(call.getMethod()); |
16791 | 206 |
Packet p = stubHandler.createRequestPacket(call); |
207 |
p.setState(Packet.State.ClientRequest); |
|
208 |
return p; |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
209 |
} |
12009 | 210 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
211 |
@Override |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
212 |
public Packet serializeResponse(JavaCallInfo call) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
213 |
Method method = call.getMethod(); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
214 |
Message message = null; |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
215 |
if (method != null) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
216 |
TieHandler th = tieHandlers.get(method); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
217 |
if (th != null) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
218 |
return th.serializeResponse(call); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
219 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
220 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
221 |
if (call.getException() instanceof DispatchException) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
222 |
message = ((DispatchException) call.getException()).fault; |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
223 |
} |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
224 |
Packet p = (Packet) packetFactory.createContext(message); |
16791 | 225 |
p.setState(Packet.State.ServerResponse); |
226 |
return p; |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
227 |
} |
12009 | 228 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
229 |
@Override |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
230 |
public ClientCallBridge getClientBridge(Method method) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
231 |
return stubHandlers.get(method); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
232 |
} |
12009 | 233 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
234 |
@Override |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
235 |
public void generateWSDL(WSDLGenInfo info) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
236 |
com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator wsdlGen = new com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator( |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
237 |
seiModel, |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
238 |
info.getWsdlResolver(), |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
239 |
seiModel.getWSBinding(), |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
240 |
info.getContainer(), seiModel.getEndpointClass(), |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
241 |
info.isInlineSchemas(), |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
242 |
info.isSecureXmlProcessingDisabled(), |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
243 |
info.getExtensions()); |
12009 | 244 |
wsdlGen.doGeneration(); |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
245 |
} |
12009 | 246 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
247 |
@Override |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
248 |
public EndpointCallBridge getEndpointBridge(Packet req) throws DispatchException { |
16791 | 249 |
JavaMethodImpl wsdlOp = resolveJavaMethod(req); |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
250 |
return wsdlOpMap.get(wsdlOp); |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
251 |
} |
12009 | 252 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
253 |
Codec getCodec() { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
254 |
if (codec == null) { |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
255 |
codec = ((BindingImpl) seiModel.getWSBinding()).createCodec(); |
12009 | 256 |
} |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
257 |
return codec; |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
258 |
} |
12009 | 259 |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
260 |
@Override |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
261 |
public ContentType encode(Packet packet, OutputStream out) throws IOException { |
12009 | 262 |
return getCodec().encode(packet, out); |
263 |
} |
|
264 |
||
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
265 |
@Override |
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
266 |
public void decode(InputStream in, String ct, Packet p) throws IOException { |
12009 | 267 |
getCodec().decode(in, ct, p); |
268 |
} |
|
269 |
||
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
270 |
@Override |
16791 | 271 |
public com.oracle.webservices.internal.api.databinding.JavaCallInfo createJavaCallInfo(Method method, Object[] args) { |
272 |
return new com.sun.xml.internal.ws.api.databinding.JavaCallInfo(method, args); |
|
12009 | 273 |
} |
274 |
||
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
275 |
@Override |
16791 | 276 |
public com.oracle.webservices.internal.api.databinding.JavaCallInfo deserializeResponse( |
277 |
MessageContext message, com.oracle.webservices.internal.api.databinding.JavaCallInfo call) { |
|
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
278 |
return deserializeResponse((Packet) message, (JavaCallInfo) call); |
12009 | 279 |
} |
280 |
||
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
281 |
@Override |
16791 | 282 |
public com.oracle.webservices.internal.api.databinding.JavaCallInfo deserializeRequest(MessageContext message) { |
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
283 |
return deserializeRequest((Packet) message); |
12009 | 284 |
} |
285 |
||
18372
4d90cbb0d70a
8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents:
16791
diff
changeset
|
286 |
@Override |
16791 | 287 |
public MessageContextFactory getMessageContextFactory() { |
288 |
return packetFactory; |
|
12009 | 289 |
} |
290 |
} |