Repository: cxf
Updated Branches:
  refs/heads/master aa0de494b -> 1cf17867a


Using spring-hazelcast to configure explicit ports for the Hazelcast instances 
+ avoid multicast


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1cf17867
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1cf17867
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1cf17867

Branch: refs/heads/master
Commit: 1cf17867a2e8a30ad061a038895e0b801331d028
Parents: aa0de49
Author: Colm O hEigeartaigh <[email protected]>
Authored: Thu Mar 30 17:48:38 2017 +0100
Committer: Colm O hEigeartaigh <[email protected]>
Committed: Thu Mar 30 17:50:18 2017 +0100

----------------------------------------------------------------------
 services/sts/systests/advanced/pom.xml             |  5 +++++
 .../DistributedCachingTest.java                    |  2 ++
 .../systest/sts/distributed_caching/cxf-sts-1.xml  | 17 ++++++++++++++++-
 .../systest/sts/distributed_caching/cxf-sts-2.xml  | 17 ++++++++++++++++-
 4 files changed, 39 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1cf17867/services/sts/systests/advanced/pom.xml
----------------------------------------------------------------------
diff --git a/services/sts/systests/advanced/pom.xml 
b/services/sts/systests/advanced/pom.xml
index 0cade9f..e2bb566 100644
--- a/services/sts/systests/advanced/pom.xml
+++ b/services/sts/systests/advanced/pom.xml
@@ -133,6 +133,11 @@
             <artifactId>hazelcast</artifactId>
             <version>${cxf.hazelcast.version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.hazelcast</groupId>
+            <artifactId>hazelcast-spring</artifactId>
+            <version>${cxf.hazelcast.version}</version>
+        </dependency>
     </dependencies>
     <build>
         <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>

http://git-wip-us.apache.org/repos/asf/cxf/blob/1cf17867/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/distributed_caching/DistributedCachingTest.java
----------------------------------------------------------------------
diff --git 
a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/distributed_caching/DistributedCachingTest.java
 
b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/distributed_caching/DistributedCachingTest.java
index f26e98c..d76ae46 100644
--- 
a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/distributed_caching/DistributedCachingTest.java
+++ 
b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/distributed_caching/DistributedCachingTest.java
@@ -43,6 +43,8 @@ public class DistributedCachingTest extends 
AbstractBusClientServerTestBase {
 
     static final String STSPORT = allocatePort(STSServer.class);
     static final String STSPORT2 = allocatePort(STSServer.class, 2);
+    static final String HZ_CAST_PORT1 = allocatePort(STSServer.class, 3);
+    static final String HZ_CAST_PORT2 = allocatePort(STSServer.class, 4);
 
     private static final String NAMESPACE = 
"http://www.example.org/contract/DoubleIt";;
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, 
"DoubleItService");

http://git-wip-us.apache.org/repos/asf/cxf/blob/1cf17867/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-1.xml
----------------------------------------------------------------------
diff --git 
a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-1.xml
 
b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-1.xml
index 8907141..55b5b8d 100644
--- 
a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-1.xml
+++ 
b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-1.xml
@@ -17,7 +17,7 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<beans xmlns="http://www.springframework.org/schema/beans"; 
xmlns:cxf="http://cxf.apache.org/core"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:sec="http://cxf.apache.org/configuration/security"; 
xmlns:http="http://cxf.apache.org/transports/http/configuration"; 
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"; 
xmlns:jaxws="http://cxf.apache.org/jaxws"; 
xmlns:util="http://www.springframework.org/schema/util"; xsi:schemaLocation="    
         http://cxf.apache.org/core             
http://cxf.apache.org/schemas/core.xsd             
http://cxf.apache.org/configuration/security             
http://cxf.apache.org/schemas/configuration/security.xsd             
http://cxf.apache.org/jaxws             http://cxf.apache.org/schemas/jaxws.xsd 
            http://cxf.apache.org/transports/http/configuration             
http://cxf.apache.org/schemas/configuration/http-conf.xsd             
http://cxf.apache.org/transports/http-jetty/configuration             http://c
 xf.apache.org/schemas/configuration/http-jetty.xsd             
http://www.springframework.org/schema/beans             
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd             
http://www.springframework.org/schema/util             
http://www.springframework.org/schema/util/spring-util-4.2.xsd";>
+<beans xmlns="http://www.springframework.org/schema/beans"; 
xmlns:hz="http://www.hazelcast.com/schema/spring"; 
xmlns:cxf="http://cxf.apache.org/core"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:sec="http://cxf.apache.org/configuration/security"; 
xmlns:http="http://cxf.apache.org/transports/http/configuration"; 
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"; 
xmlns:jaxws="http://cxf.apache.org/jaxws"; 
xmlns:util="http://www.springframework.org/schema/util"; xsi:schemaLocation="    
         http://cxf.apache.org/core             
http://cxf.apache.org/schemas/core.xsd             
http://cxf.apache.org/configuration/security             
http://cxf.apache.org/schemas/configuration/security.xsd             
http://cxf.apache.org/jaxws             http://cxf.apache.org/schemas/jaxws.xsd 
            http://cxf.apache.org/transports/http/configuration             
http://cxf.apache.org/schemas/configuration/http-conf.xsd             
http://cxf.apache.org/transp
 orts/http-jetty/configuration             
http://cxf.apache.org/schemas/configuration/http-jetty.xsd             
http://www.springframework.org/schema/beans             
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd             
http://www.springframework.org/schema/util             
http://www.springframework.org/schema/util/spring-util-4.2.xsd 
http://www.hazelcast.com/schema/spring 
https://www.hazelcast.com/schema/spring/hazelcast-spring-3.7.xsd";>
     <bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
     <cxf:bus>
         <cxf:features>
@@ -41,8 +41,23 @@
         <property name="stsProperties" ref="transportSTSProperties"/>
         <property name="tokenStore" ref="defaultTokenStore"/>
     </bean>
+    
+    <hz:hazelcast id="hazelcast-instance">
+        <hz:config>
+            <hz:network 
port="${testutil.ports.distributed_caching.STSServer.3}" 
port-auto-increment="false">
+                <hz:join>
+                    <hz:multicast enabled="false" />
+                    <hz:tcp-ip enabled="true">
+                        
<hz:members>localhost:${testutil.ports.distributed_caching.STSServer.4}</hz:members>
+                    </hz:tcp-ip>
+                </hz:join>
+            </hz:network>
+        </hz:config>
+    </hz:hazelcast>
+    
     <bean id="defaultTokenStore" 
class="org.apache.cxf.sts.cache.HazelCastTokenStore">
         <constructor-arg value="default"/>
+        <property name="hazelcastInstance" ref="hazelcast-instance"/>
     </bean>
     <util:list id="transportTokenProviders">
         <ref bean="transportSamlTokenProvider"/>

http://git-wip-us.apache.org/repos/asf/cxf/blob/1cf17867/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-2.xml
----------------------------------------------------------------------
diff --git 
a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-2.xml
 
b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-2.xml
index 945295e..9b3d6d0 100644
--- 
a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-2.xml
+++ 
b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/distributed_caching/cxf-sts-2.xml
@@ -17,7 +17,7 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<beans xmlns="http://www.springframework.org/schema/beans"; 
xmlns:cxf="http://cxf.apache.org/core"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:sec="http://cxf.apache.org/configuration/security"; 
xmlns:http="http://cxf.apache.org/transports/http/configuration"; 
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"; 
xmlns:jaxws="http://cxf.apache.org/jaxws"; 
xmlns:util="http://www.springframework.org/schema/util"; xsi:schemaLocation="    
         http://cxf.apache.org/core             
http://cxf.apache.org/schemas/core.xsd             
http://cxf.apache.org/configuration/security             
http://cxf.apache.org/schemas/configuration/security.xsd             
http://cxf.apache.org/jaxws             http://cxf.apache.org/schemas/jaxws.xsd 
            http://cxf.apache.org/transports/http/configuration             
http://cxf.apache.org/schemas/configuration/http-conf.xsd             
http://cxf.apache.org/transports/http-jetty/configuration             http://c
 xf.apache.org/schemas/configuration/http-jetty.xsd             
http://www.springframework.org/schema/beans             
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd             
http://www.springframework.org/schema/util             
http://www.springframework.org/schema/util/spring-util-4.2.xsd";>
+<beans xmlns="http://www.springframework.org/schema/beans"; 
xmlns:hz="http://www.hazelcast.com/schema/spring"; 
xmlns:cxf="http://cxf.apache.org/core"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:sec="http://cxf.apache.org/configuration/security"; 
xmlns:http="http://cxf.apache.org/transports/http/configuration"; 
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"; 
xmlns:jaxws="http://cxf.apache.org/jaxws"; 
xmlns:util="http://www.springframework.org/schema/util"; xsi:schemaLocation="    
         http://cxf.apache.org/core             
http://cxf.apache.org/schemas/core.xsd             
http://cxf.apache.org/configuration/security             
http://cxf.apache.org/schemas/configuration/security.xsd             
http://cxf.apache.org/jaxws             http://cxf.apache.org/schemas/jaxws.xsd 
            http://cxf.apache.org/transports/http/configuration             
http://cxf.apache.org/schemas/configuration/http-conf.xsd             
http://cxf.apache.org/transp
 orts/http-jetty/configuration             
http://cxf.apache.org/schemas/configuration/http-jetty.xsd             
http://www.springframework.org/schema/beans             
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd             
http://www.springframework.org/schema/util             
http://www.springframework.org/schema/util/spring-util-4.2.xsd 
http://www.hazelcast.com/schema/spring 
https://www.hazelcast.com/schema/spring/hazelcast-spring-3.7.xsd";>
     <bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
     <cxf:bus>
         <cxf:features>
@@ -41,8 +41,23 @@
         <property name="stsProperties" ref="transportSTSProperties"/>
         <property name="tokenStore" ref="defaultTokenStore"/>
     </bean>
+    
+    <hz:hazelcast id="hazelcast-instance">
+        <hz:config>
+            <hz:network 
port="${testutil.ports.distributed_caching.STSServer.4}" 
port-auto-increment="false">
+                <hz:join>
+                    <hz:multicast enabled="false" />
+                    <hz:tcp-ip enabled="true">
+                        
<hz:members>localhost:${testutil.ports.distributed_caching.STSServer.3}</hz:members>
+                    </hz:tcp-ip>
+                </hz:join>
+            </hz:network>
+        </hz:config>
+    </hz:hazelcast>
+    
     <bean id="defaultTokenStore" 
class="org.apache.cxf.sts.cache.HazelCastTokenStore">
         <constructor-arg value="default"/>
+         <property name="hazelcastInstance" ref="hazelcast-instance"/>
     </bean>
     <util:list id="transportTokenProviders">
         <ref bean="transportSamlTokenProvider"/>

Reply via email to