Skip to content

Instantly share code, notes, and snippets.

@mmarkus
Created July 6, 2012 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmarkus/3059621 to your computer and use it in GitHub Desktop.
Save mmarkus/3059621 to your computer and use it in GitHub Desktop.
<global>
....
<!-- sites are being defined globally. There can be only one local site -->
<sites localSite="${site:LON}">
<site name="LON"/>
<site name="SFO"/>
<site name="NYC"/>
</sites>
....
</global>
<default>
....
<!-- Each cache can configure the sites on which it replicates its state to,
the name of the corresponding cache from the remote site and whether the replication is sync or not.
In future more attibutes will be added here, such as fetchStateOnStartup etc. As this is defined in
the default cache will be inherited in named caches.
-->
<sites>
<!-- it is possible to specify the name of the remote backup cache. If not specified it defaults
to the same cache name. In this case in the named caches you must make sure that you don't use
the same cache name in order to avoid different caches backing up to the same remote cache. -->
<backup name="SFO" cacheName="LONBackup" strategy="sync"/>
<backup name="NYC" strategy="async"/>
</sites>
....
</default>
<namedCache name="other">
<sites>
<!-- this cache only back ups to SFO. It also overrides the strategy. As the cacheName is not
defined, it would default to this cache's name, i.e. 'other' -->
<backup name="SFO" strategy="async"/>
</sites>
</namedCache>
<namedCache name="wrong">
<sites>
<!-- this should throw an configuration exception as the backup cache name is the same as the one
defined in the default cache -->
<backup name="SFO" strategy="async" cacheName="LONBackup"/>
</sites>
</namedCache>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment