You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dk...@apache.org on 2014/01/06 19:54:34 UTC
[2/9] git commit: Remove some unused code
Remove some unused code
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/aaee670b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/aaee670b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/aaee670b
Branch: refs/heads/master
Commit: aaee670b6e5779577985feb2563479c62aeb0b78
Parents: f00524d
Author: Daniel Kulp <dk...@apache.org>
Authored: Fri Jan 3 17:22:18 2014 -0500
Committer: Daniel Kulp <dk...@apache.org>
Committed: Mon Jan 6 10:14:15 2014 -0500
----------------------------------------------------------------------
.../camel/component/cxf/CxfEndpointUtils.java | 41 -------
.../cxf/util/WSDLSoapServiceFactoryBean.java | 123 -------------------
2 files changed, 164 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/aaee670b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java
index 8fd7536..f476a69 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java
@@ -26,16 +26,11 @@ import org.apache.camel.CamelContext;
import org.apache.camel.CamelException;
import org.apache.camel.Exchange;
import org.apache.camel.component.cxf.common.message.CxfConstants;
-import org.apache.camel.component.cxf.util.WSDLSoapServiceFactoryBean;
import org.apache.camel.spring.SpringCamelContext;
import org.apache.camel.util.ObjectHelper;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.frontend.ClientProxyFactoryBean;
-import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
-import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
@@ -109,42 +104,6 @@ public final class CxfEndpointUtils {
}
return hasAnnotation(cls.getSuperclass(), annotation);
}
-
- public static ServerFactoryBean getServerFactoryBean(Class<?> cls) throws CamelException {
- ServerFactoryBean serverFactory = null;
- try {
- if (cls == null) {
- serverFactory = new ServerFactoryBean();
- serverFactory.setServiceFactory(new WSDLSoapServiceFactoryBean());
-
- } else {
- boolean isJSR181SEnabled = CxfEndpointUtils.hasWebServiceAnnotation(cls);
- serverFactory = isJSR181SEnabled ? new JaxWsServerFactoryBean()
- : new ServerFactoryBean();
- }
- return serverFactory;
- } catch (Exception e) {
- throw new CamelException(e);
- }
-
- }
-
- public static ClientProxyFactoryBean getClientFactoryBean(Class<?> cls) throws CamelException {
- ClientProxyFactoryBean clientFactory = null;
- try {
- if (cls == null) {
- clientFactory = new ClientProxyFactoryBean();
- clientFactory.setServiceFactory(new WSDLSoapServiceFactoryBean());
- } else {
- boolean isJSR181SEnabled = CxfEndpointUtils.hasWebServiceAnnotation(cls);
- clientFactory = isJSR181SEnabled ? new JaxWsProxyFactoryBean()
- : new ClientProxyFactoryBean();
- }
- return clientFactory;
- } catch (Exception e) {
- throw new CamelException(e);
- }
- }
// only used by test currently
public static void checkServiceClassName(String className) throws CamelException {
http://git-wip-us.apache.org/repos/asf/camel/blob/aaee670b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java
deleted file mode 100644
index 0ec6349..0000000
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.cxf.util;
-
-import javax.xml.namespace.QName;
-
-import org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor;
-import org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor;
-import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
-import org.apache.cxf.interceptor.AttachmentInInterceptor;
-import org.apache.cxf.interceptor.AttachmentOutInterceptor;
-import org.apache.cxf.interceptor.StaxInInterceptor;
-import org.apache.cxf.interceptor.StaxOutInterceptor;
-import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.wsdl11.WSDLServiceFactory;
-
-/**
- * The service factory bean which is used for the service without SEI
- */
-public class WSDLSoapServiceFactoryBean extends ReflectionServiceFactoryBean {
- private QName serviceName;
- private QName endpointName;
-
- @Override
- public Service create() {
- WSDLServiceFactory factory = new WSDLServiceFactory(getBus(), getWsdlURL(), getServiceQName());
-
- setService(factory.create());
- initializeSoapInterceptors();
- //disable the date interceptors
- updateEndpointInfors();
- createEndpoints();
-
- return getService();
- }
-
-
- private void updateEndpointInfors() {
- Service service = getService();
-
- for (ServiceInfo inf : service.getServiceInfos()) {
- for (EndpointInfo ei : inf.getEndpoints()) {
- //setup the endpoint address
- ei.setAddress("local://" + ei.getService().getName().toString() + "/" + ei.getName().getLocalPart());
- // working as the dispatch mode, the binding factory will not add interceptor
- //ei.getBinding().setProperty(AbstractBindingFactory.DATABINDING_DISABLED, Boolean.TRUE);
- }
- }
- }
-
- protected void checkServiceClassAnnotations(Class<?> sc) {
- // do nothing here
- }
-
- // do not handle any payload information here
- private void initializeSoapInterceptors() {
- getService().getInInterceptors().add(new DataInInterceptor());
- getService().getInInterceptors().add(new ReadHeadersInterceptor(getBus()));
- getService().getInInterceptors().add(new MustUnderstandInterceptor());
- getService().getInInterceptors().add(new AttachmentInInterceptor());
- getService().getInInterceptors().add(new SoapHeaderInterceptor());
- getService().getInInterceptors().add(new CheckFaultInterceptor());
-
- getService().getInInterceptors().add(new StaxInInterceptor());
- getService().getInInterceptors().add(new SoapActionInInterceptor());
-
- getService().getOutInterceptors().add(new DataOutInterceptor());
- getService().getOutInterceptors().add(new AttachmentOutInterceptor());
- getService().getOutInterceptors().add(new StaxOutInterceptor());
- getService().getOutInterceptors().add(new SoapHeaderOutFilterInterceptor());
-
- getService().getOutInterceptors().add(new SoapPreProtocolOutInterceptor());
- getService().getOutInterceptors().add(new SoapOutInterceptor(getBus()));
- getService().getOutFaultInterceptors().add(new SoapOutInterceptor(getBus()));
- }
-
- public void setServiceName(QName name) {
- serviceName = name;
- }
-
- public String getServiceName() {
- return serviceName.toString();
- }
-
- public QName getServiceQName() {
- return serviceName;
- }
-
- public QName getEndpointName() {
- // get the endpoint name if it is not set
- if (endpointName == null) {
- endpointName = getService().getEndpoints().keySet().iterator().next();
- }
- return endpointName;
- }
-
- public void setEndpointName(QName name) {
- endpointName = name;
- }
-
-}