Terracotta3.1.1とEHCache1.7の統合ぶりがすごい

Terracotta3.1.1がリリースされたので試してみたら、EHCacheとの統合っぷりがすごい。

http://www.terracotta.org/web/display/orgsite/Get%20Started%20With%20Ehcache%20Distributed%20Cache に書いてる手順だけど、

  1. Terracottaサーバー立ち上げ /bin/start-tc-server.bat
  2. Tomcat(インストーラを使わずにzipかtar.gzを解凍してポートをずらしたやつ)を二つ立ち上げ /bin/startup.bat, /bin/startup.bat
  3. distributed-cache-sample.warを両方のTomcatのwebappsに配置
  4. http://localhost:8080/distributed-cache-sample/にアクセス

しただけでキャッシュが共有されてる!
tim-tomcatも入れてないし、dso-env.batを全然つかっとらんのに。すげー

設定はどこかと思ったら、 webapps/distributed-cache-sample/WEB-INF/classes/ehcache.xml

  <cache name="account-cache"
         maxElementsInMemory="10000"
         maxElementsOnDisk="1000"
         eternal="false"
         overflowToDisk="false"
         diskSpoolBufferSizeMB="20"
         timeToIdleSeconds="300"
         timeToLiveSeconds="600"
         memoryStoreEvictionPolicy="LFU">
    <terracotta />
  </cache>
  <terracottaConfig url="localhost:9510"/>

って書かれてるだけだった。
なんか思い切ってるなあ。びっくりした。