2017-07-12 5 views

答えて

0

公式ユーザーガイドで達成しようとしているものの具体例は、具体的にはClient/Server Example Configurationsです。下のミニマリストの例

サーバーcache.xml

<cache> 
    <cache-server/> 
    <region name="TEST"> 
     <region-attributes refid="REPLICATE"/> 
    </region> 
</cache> 

クライアントcache.xml

<client-cache> 
    <pool name="default"> 
     <locator host="localhost" port="10334"/> 
    </pool> 
    <region name="TEST" refid="PROXY"/> 
</client-cache> 

ClientApp.java

public static void main(String[] args) throws Exception { 
    ClientCache cache = new ClientCacheFactory().set("cache-xml-file", "client-cache.xml").set("log-level", "config").create(); 
    Region region = cache.getRegion("TEST"); 
    region.put("key1", new MyPojo("attribute1", "attribute2")); 
    cache.close(); 
    System.exit(0); 
} 

Y ouはspring-data-gemfireプロジェクトをチェックし、すべての定型文を削除することができます:-)。 乾杯。

関連する問題