01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.cxf;
17:
18: import javax.xml.ws.WebServiceException;
19:
20: import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
21: import org.apache.geronimo.jaxws.JAXWSUtils;
22: import org.apache.geronimo.jaxws.PortInfo;
23:
24: public class GeronimoJaxWsImplementorInfo extends JaxWsImplementorInfo {
25:
26: private String bindingURI;
27: private Class seiClass;
28:
29: public GeronimoJaxWsImplementorInfo(Class clazz, PortInfo portInfo,
30: ClassLoader loader) {
31: super (clazz);
32:
33: // overwrite bindingURI
34: if (portInfo.getProtocolBinding() != null) {
35: this .bindingURI = JAXWSUtils.getBindingURI(portInfo
36: .getProtocolBinding());
37: }
38:
39: // overwrite seiClass only if WebService.endpointInterface is not set
40: if (super .getSEIClass() == null) {
41: String sei = portInfo.getServiceEndpointInterfaceName();
42: if (sei != null && sei.trim().length() > 0) {
43: try {
44: this .seiClass = loader.loadClass(sei.trim());
45: } catch (ClassNotFoundException ex) {
46: throw new WebServiceException(
47: "Failed to load SEI class: " + sei);
48: }
49: }
50: }
51: }
52:
53: @Override
54: public String getBindingType() {
55: if (this .bindingURI != null) {
56: return this .bindingURI;
57: } else {
58: return super .getBindingType();
59: }
60: }
61:
62: @Override
63: public Class<?> getSEIClass() {
64: return (this.seiClass != null) ? this.seiClass : super
65: .getSEIClass();
66: }
67:
68: }
|