@@ -0,0 +1,1532 @@
+package org.infinispan.demo;%0A%0Aimport org.infinispan.client.hotrod.RemoteCache;%0Aimport org.infinispan.client.hotrod.RemoteCacheManager;%0Aimport org.infinispan.client.hotrod.configuration.ConfigurationBuilder;%0Aimport org.infinispan.client.hotrod.impl.ConfigurationProperties;%0A%0Apublic class HotRodClientRepl %7B%0A%0A    public static final String ISPN_IP = %22127.0.0.1%22;%0A    public static final String CACHE_NAME = %22replicated%22;%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        %0A        // run cluster of two servers with replicated cache using predefined replicated confing%0A        // ./standalone.sh -c clustered.xml%0A        // ./standalone.sh -c clustered.xml -Djboss.socket.binding.port-offset=100%0A        // later on kill the first server, listening on default HR port 11222%0A        %0A        ConfigurationBuilder builder = new ConfigurationBuilder();%0A        builder.addServer().host(ISPN_IP).port(ConfigurationProperties.DEFAULT_HOTROD_PORT);%0A        RemoteCacheManager cacheManager = new RemoteCacheManager(builder.build());%0A        %0A        RemoteCache%3CObject, Object%3E cache = cacheManager.getCache();%0A        cache.put(%22key%22, %22value%22);%0A        %0A        System.out.println(%22key pushed into cluter, kill server 1 listening on 127.0.0.1:11222%22);%0A        System.out.println(%22sleeping for 15s%22);%0A        %0A        Thread.sleep(15_000);%0A        %0A        System.out.println(%22getting key from cluster%22);%0A        System.out.printf(%22got value '%25s'%5Cn%22, cache.get(%22key%22));%0A        %0A        cacheManager.stop();%0A    %7D%0A    %0A%7D%0A

Add HR client example, which fails over to another ISPN server