You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2015/12/21 03:16:54 UTC
cxf git commit: CXF-6622: Enhance Failover Feature to support Circuit
Breakers based implementation. Added OSGi blueprint support.
Repository: cxf
Updated Branches:
refs/heads/master 40dc07cea -> 77c3f51dc
CXF-6622: Enhance Failover Feature to support Circuit Breakers based implementation. Added OSGi blueprint support.
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/77c3f51d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/77c3f51d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/77c3f51d
Branch: refs/heads/master
Commit: 77c3f51dcb1f02c8799f4e09676c0697e76a0756
Parents: 40dc07c
Author: reta <dr...@gmail.com>
Authored: Sun Dec 20 21:16:24 2015 -0500
Committer: reta <dr...@gmail.com>
Committed: Sun Dec 20 21:16:24 2015 -0500
----------------------------------------------------------------------
.../main/release/samples/clustering/README.txt | 87 ++++++++++++++++++++
.../clustering/failover_jaxws_osgi/pom.xml | 83 +++++++++++++++++++
.../resources/OSGI-INF/blueprint/blueprint.xml | 48 +++++++++++
.../samples/clustering/failover_server/pom.xml | 79 ++++++++++++++++++
.../samples/failover/jaxws/SampleService.java | 26 ++++++
.../failover/jaxws/impl/SampleServiceImpl.java | 27 ++++++
.../resources/OSGI-INF/blueprint/blueprint.xml | 50 +++++++++++
distribution/src/main/release/samples/pom.xml | 2 +
.../ClusteringBPBeanDefinitionParser.java | 36 ++++++++
.../blueprint/ClusteringBPNamespaceHandler.java | 8 +-
10 files changed, 443 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/distribution/src/main/release/samples/clustering/README.txt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/clustering/README.txt b/distribution/src/main/release/samples/clustering/README.txt
new file mode 100644
index 0000000..148a5f6
--- /dev/null
+++ b/distribution/src/main/release/samples/clustering/README.txt
@@ -0,0 +1,87 @@
+Apache CXF JAX-WS Failover Demo for OSGi using Blueprint
+=================
+
+The demo shows a basic usage of the clustering failover feature for JAX-WS
+services using OSGi environment.
+
+Building and running the demo
+---------------------------------------
+The demo consists of two parts:
+ - sample JAX-WS server
+ - sample JAX-WS client which uses failover feature
+
+From the base directory of this sample (i.e., where this README file is
+located), build both projects using Maven using either UNIX or Windows:
+
+ cd failover_server
+ mvn install
+
+ cd failover_jaxws_osgi
+ mvn install
+
+Starting Karaf (refer to http://karaf.apache.org/manual/latest/quick-start.html)
+
+ $ bin/karaf
+ __ __ ____
+ / //_/____ __________ _/ __/
+ / ,< / __ `/ ___/ __ `/ /_
+ / /| |/ /_/ / / / /_/ / __/
+ /_/ |_|\__,_/_/ \__,_/_/
+
+ Apache Karaf (4.0.3)
+
+ Hit '<tab>' for a list of available commands
+ and '[cmd] --help' for help on a specific command.
+ Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
+
+ karaf@root()>
+
+In order to install CXF's features, you need to add the CXF's features repo using
+
+ feature:repo-add cxf 3.n.m
+
+ where 3.n.m corresponds to a valid CXF version number (e.g., 3.1.5).
+
+Install CXF's cxf-jaxws and cxf-features-clustering feature that installs
+all the required bundles for this demo bundle.
+
+ feature:install cxf-features-clustering
+
+Install this demo bundles:
+
+ install -s mvn:org.apache.cxf.samples/failover_server
+ install -s mvn:org.apache.cxf.samples/failover_jaxws_osgi
+ install -s wrap:mvn:org.codeartisans/org.json/20130213
+ install -s mvn:joda-time/joda-time/2.8.1
+ install -s mvn:org.qi4j.core/org.qi4j.core.functional/2.1
+ install -s mvn:org.qi4j.core/org.qi4j.core.api/2.1
+ install -s mvn:org.qi4j.core/org.qi4j.core.io/2.1
+ install -s mvn:org.qi4j.core/org.qi4j.core.spi/2.1
+ install -s mvn:org.qi4j.core/org.qi4j.core.bootstrap/2.1
+ install -s mvn:org.qi4j.library/org.qi4j.library.jmx/2.1
+ install -s mvn:org.qi4j.library/org.qi4j.library.circuitbreaker/2.1
+
+
+You can verify if the Apache CXF Blueprint Demo Server and JAX-WS
+Failover client are installed and started.
+
+ karaf@root()> list
+
+ START LEVEL 100 , List Threshold: 50
+ ID | State | Lvl | Version | Name
+ -----------------------------------------------------------------
+ 52 | Active | 80 | 3.2.0.SNAPSHOT | Apache CXF Blueprint Demo Server
+ 53 | Active | 80 | 3.2.0.SNAPSHOT | Apache CXF JAX-WS Failover Blueprint Demo
+
+ karaf@root()>
+
+Now, you will be able to access this CXF JAX-WS demo service on your Karaf instance
+at:
+
+ http://localhost:8181/cxf/sample
+
+The JAX-WS client has been configured to use circuit breaker failover feature and
+sequential strategy with two addresses:
+
+ http://localhost:8181/cxf/sample
+ http://localhost:8282/cxf/sample
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/distribution/src/main/release/samples/clustering/failover_jaxws_osgi/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/clustering/failover_jaxws_osgi/pom.xml b/distribution/src/main/release/samples/clustering/failover_jaxws_osgi/pom.xml
new file mode 100644
index 0000000..5a4bf92
--- /dev/null
+++ b/distribution/src/main/release/samples/clustering/failover_jaxws_osgi/pom.xml
@@ -0,0 +1,83 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>failover_jaxws_osgi</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache CXF JAX-WS Failover Blueprint Demo</name>
+ <description>Failover Basic Demo</description>
+ <parent>
+ <groupId>org.apache.cxf.samples</groupId>
+ <artifactId>cxf-samples</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <properties>
+ <cxf.version>${project.version}</cxf.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.groupId}.${project.artifactId};blueprint.aries.xml-validation:=false</Bundle-SymbolicName>
+ <Import-Package>
+ org.apache.cxf,
+ org.apache.cxf.clustering.circuitbreaker,
+ org.qi4j.library.circuitbreaker,
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-client</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf.samples</groupId>
+ <artifactId>failover_server</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-features-clustering</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.qi4j.library</groupId>
+ <artifactId>org.qi4j.library.circuitbreaker</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/distribution/src/main/release/samples/clustering/failover_jaxws_osgi/src/main/resources/OSGI-INF/blueprint/blueprint.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/clustering/failover_jaxws_osgi/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/distribution/src/main/release/samples/clustering/failover_jaxws_osgi/src/main/resources/OSGI-INF/blueprint/blueprint.xml
new file mode 100644
index 0000000..549697d
--- /dev/null
+++ b/distribution/src/main/release/samples/clustering/failover_jaxws_osgi/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!-- START SNIPPET: blueprint -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
+ xmlns:clustering="http://cxf.apache.org/clustering"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
+ http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd">
+
+ <service ref="sampleServiceProxy"
+ interface="org.apache.cxf.samples.failover.jaxws.SampleService" />
+
+ <jaxws:client id="sampleServiceProxy" serviceClass="org.apache.cxf.samples.failover.jaxws.SampleService">
+ <jaxws:features>
+ <clustering:circuit-breaker-failover>
+ <clustering:strategy>
+ <bean id="strategy" class="org.apache.cxf.clustering.SequentialStrategy">
+ <property name="alternateAddresses">
+ <list id="alternateAddresses" value-type="java.lang.String">
+ <value>http://localhost:8181/cxf/sample</value>
+ <value>http://localhost:8282/cxf/sample</value>
+ </list>
+ </property>
+ </bean>
+ </clustering:strategy>
+ </clustering:circuit-breaker-failover>
+ </jaxws:features>
+ </jaxws:client>
+</blueprint>
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/distribution/src/main/release/samples/clustering/failover_server/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/clustering/failover_server/pom.xml b/distribution/src/main/release/samples/clustering/failover_server/pom.xml
new file mode 100644
index 0000000..c470e3c
--- /dev/null
+++ b/distribution/src/main/release/samples/clustering/failover_server/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>failover_server</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache CXF Blueprint Demo Server</name>
+ <description>Failover Sample Server</description>
+ <parent>
+ <groupId>org.apache.cxf.samples</groupId>
+ <artifactId>cxf-samples</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <properties>
+ <cxf.version>${project.version}</cxf.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.groupId}.${project.artifactId};blueprint.aries.xml-validation:=false</Bundle-SymbolicName>
+ <Import-Package>
+ javax.ws.rs.*;version="[1.1,3)",
+ org.apache.cxf.*;version="[2,4)",
+ </Import-Package>
+ <Export-Package>org.apache.cxf.samples.failover.jaxws</Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http-jetty</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/distribution/src/main/release/samples/clustering/failover_server/src/main/java/org/apache/cxf/samples/failover/jaxws/SampleService.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/clustering/failover_server/src/main/java/org/apache/cxf/samples/failover/jaxws/SampleService.java b/distribution/src/main/release/samples/clustering/failover_server/src/main/java/org/apache/cxf/samples/failover/jaxws/SampleService.java
new file mode 100644
index 0000000..1e379dc
--- /dev/null
+++ b/distribution/src/main/release/samples/clustering/failover_server/src/main/java/org/apache/cxf/samples/failover/jaxws/SampleService.java
@@ -0,0 +1,26 @@
+/**
+ * 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.cxf.samples.failover.jaxws;
+
+import javax.jws.WebService;
+
+@WebService
+public interface SampleService {
+ String call();
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/distribution/src/main/release/samples/clustering/failover_server/src/main/java/org/apache/cxf/samples/failover/jaxws/impl/SampleServiceImpl.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/clustering/failover_server/src/main/java/org/apache/cxf/samples/failover/jaxws/impl/SampleServiceImpl.java b/distribution/src/main/release/samples/clustering/failover_server/src/main/java/org/apache/cxf/samples/failover/jaxws/impl/SampleServiceImpl.java
new file mode 100644
index 0000000..bc4c725
--- /dev/null
+++ b/distribution/src/main/release/samples/clustering/failover_server/src/main/java/org/apache/cxf/samples/failover/jaxws/impl/SampleServiceImpl.java
@@ -0,0 +1,27 @@
+/**
+ * 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.cxf.samples.failover.jaxws.impl;
+
+import org.apache.cxf.samples.failover.jaxws.SampleService;
+
+public class SampleServiceImpl implements SampleService {
+ public String call() {
+ return "Called!";
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/distribution/src/main/release/samples/clustering/failover_server/src/main/resources/OSGI-INF/blueprint/blueprint.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/clustering/failover_server/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/distribution/src/main/release/samples/clustering/failover_server/src/main/resources/OSGI-INF/blueprint/blueprint.xml
new file mode 100644
index 0000000..30ccdc5
--- /dev/null
+++ b/distribution/src/main/release/samples/clustering/failover_server/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!-- START SNIPPET: blueprint -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xmlns:cxf="http://cxf.apache.org/blueprint/core"
+ xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
+ xmlns:authz="http://aries.apache.org/xmlns/authorization/v1.0.0"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ http://www.osgi.org/xmlns/blueprint-ext/v1.1.0 https://svn.apache.org/repos/asf/aries/tags/blueprint-0.3.1/blueprint-core/src/main/resources/org/apache/aries/blueprint/ext/blueprint-ext.xsd
+ http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
+ http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
+ http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
+ http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0 http://aries.apache.org/schemas/blueprint-ext/blueprint-ext-1.1.xsd
+ ">
+ <cxf:bus>
+ <cxf:features>
+ <cxf:logging />
+ </cxf:features>
+ </cxf:bus>
+
+ <bean id="sampleServiceImpl" class="org.apache.cxf.samples.failover.jaxws.impl.SampleServiceImpl"/>
+
+ <jaxws:endpoint
+ implementor="#sampleServiceImpl"
+ address="/sample"
+ implementorClass="org.apache.cxf.samples.failover.jaxws.impl.SampleServiceImpl"/>
+
+</blueprint>
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/distribution/src/main/release/samples/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/pom.xml b/distribution/src/main/release/samples/pom.xml
index a78ac01..393fae2 100644
--- a/distribution/src/main/release/samples/pom.xml
+++ b/distribution/src/main/release/samples/pom.xml
@@ -110,6 +110,8 @@
<module>ws_eventing</module>
<module>throttling</module>
<module>jax_rs/tracing_htrace</module>
+ <module>clustering/failover_jaxws_osgi</module>
+ <module>clustering/failover_server</module>
<!--
These are removed from the build as they currently don't inherit the parent from
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java
new file mode 100644
index 0000000..b5367d1
--- /dev/null
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java
@@ -0,0 +1,36 @@
+/**
+ * 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.cxf.clustering.blueprint;
+
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.cxf.configuration.blueprint.SimpleBPBeanDefinitionParser;
+
+public class ClusteringBPBeanDefinitionParser extends SimpleBPBeanDefinitionParser {
+ public ClusteringBPBeanDefinitionParser(Class<?> cls) {
+ super(cls);
+ }
+
+ @Override
+ protected void mapElement(ParserContext ctx, MutableBeanMetadata bean, Element el, String name) {
+ setFirstChildAsProperty(el, ctx, bean, name);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/77c3f51d/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandler.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandler.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandler.java
index 336d0ff..43e40e2 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandler.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandler.java
@@ -29,7 +29,7 @@ import org.apache.aries.blueprint.Namespaces;
import org.apache.aries.blueprint.ParserContext;
import org.apache.cxf.clustering.FailoverFeature;
import org.apache.cxf.clustering.LoadDistributorFeature;
-import org.apache.cxf.configuration.blueprint.SimpleBPBeanDefinitionParser;
+import org.apache.cxf.clustering.circuitbreaker.CircuitBreakerFailoverFeature;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.Metadata;
@@ -42,9 +42,11 @@ public class ClusteringBPNamespaceHandler implements NamespaceHandler {
public Metadata parse(Element element, ParserContext context) {
String s = element.getLocalName();
if ("failover".equals(s)) {
- return new SimpleBPBeanDefinitionParser(FailoverFeature.class).parse(element, context);
+ return new ClusteringBPBeanDefinitionParser(FailoverFeature.class).parse(element, context);
} else if ("loadDistributor".equals(s)) {
- return new SimpleBPBeanDefinitionParser(LoadDistributorFeature.class).parse(element, context);
+ return new ClusteringBPBeanDefinitionParser(LoadDistributorFeature.class).parse(element, context);
+ } else if ("circuit-breaker-failover".equals(s)) {
+ return new ClusteringBPBeanDefinitionParser(CircuitBreakerFailoverFeature.class).parse(element, context);
}
return null;
}