Author: ningjiang
Date: Mon Dec 10 04:41:19 2012
New Revision: 1419196
URL: http://svn.apache.org/viewvc?rev=1419196&view=rev
Log:
CAMEL-5853 Added CxfEndpointConfiguer to support configure the CXF endpoint
programmatically
Added:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?rev=1419196&r1=1419195&r2=1419196&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
Mon Dec 10 04:41:19 2012
@@ -156,6 +156,7 @@ public class CxfEndpoint extends Default
private BindingConfiguration bindingConfig;
private DataBinding dataBinding;
private ReflectionServiceFactoryBean serviceFactoryBean;
+ private CxfEndpointConfigurer configurer;
public CxfEndpoint(String remaining, CxfComponent cxfComponent) {
@@ -323,6 +324,9 @@ public class CxfEndpoint extends Default
sfb.setBus(getBus());
sfb.setStart(false);
+ if (getCxfEndpointConfigurer() != null) {
+ getCxfEndpointConfigurer().configure(sfb);
+ }
}
/**
@@ -494,6 +498,9 @@ public class CxfEndpoint extends Default
}
factoryBean.setBus(getBus());
+ if (getCxfEndpointConfigurer() != null) {
+ getCxfEndpointConfigurer().configure(factoryBean);
+ }
}
// Package private methods
@@ -1076,5 +1083,13 @@ public class CxfEndpoint extends Default
this.serviceFactoryBean = serviceFactoryBean;
}
+ public CxfEndpointConfigurer getCxfEndpointConfigurer() {
+ return configurer;
+ }
+
+ public void setCxfEndpointConfigurer(CxfEndpointConfigurer configurer) {
+ this.configurer = configurer;
+ }
+
}
Added:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java?rev=1419196&view=auto
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java
(added)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java
Mon Dec 10 04:41:19 2012
@@ -0,0 +1,28 @@
+/**
+ * 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;
+
+import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
+
+/**
+ * A pluggable strategy for configuring the cxfEndpoint by using java code
+ */
+public interface CxfEndpointConfigurer {
+
+ void configure(AbstractWSDLBasedEndpointFactory factoryBean);
+
+}