1
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
1
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
xsi:noNamespaceSchemaLocation="ehcache.xsd">
4
5
CacheManager Configuration
8
9
See instructions below or the ehcache schema (ehcache.xsd) on how to configure.
11
System property tokens can be specified in this file which are replaced when the configuration is loaded.
12
For example multicastGroupPort=${multicastGroupPort} can be replaced with the System property either
13
from an environment variable or a system property specified with a command line switch such as
14
-DmulticastGroupPort=4446.
10
16
DiskStore configuration
11
17
=======================
13
Sets the path to the directory where cache files are created.
15
If the path is a Java System Property it is replaced by its value in the
19
The diskStore element is optional. To turn off disk store path creation, comment out the diskStore
22
Configure it if you have overflowToDisk or diskPersistent enabled for any cache.
24
If it is not configured, and a cache is created which requires a disk store, a warning will be
25
issued and java.io.tmpdir will automatically be used.
27
diskStore has only one attribute - "path". It is the path to the directory where
28
.data and .index files will be created.
30
If the path is one of the following Java System Property it is replaced by its value in the
31
running VM. For backward compatibility these are not specified without being enclosed in the ${token}
18
34
The following properties are translated:
19
35
* user.home - User's home directory
20
36
* user.dir - User's current working directory
21
37
* java.io.tmpdir - Default temp file path
38
* ehcache.disk.store.dir - A system property you would normally specify on the command line
39
e.g. java -Dehcache.disk.store.dir=/u01/myapp/diskdir ...
23
41
Subdirectories can be specified below the property e.g. java.io.tmpdir/one
108
126
The hostname is the hostname of the remote CacheManager peer. The port is the listening
109
127
port of the RMICacheManagerPeerListener of the remote CacheManager peer.
129
Configuring JGroups replication:
130
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
131
properties="connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;
132
mcast_send_buf_size=150000;mcast_recv_buf_size=80000):
133
PING(timeout=2000;num_initial_members=6):
134
MERGE2(min_interval=5000;max_interval=10000):
135
FD_SOCK:VERIFY_SUSPECT(timeout=1500):
136
pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):
137
UNICAST(timeout=5000):
138
pbcast.STABLE(desired_avg_gossip=20000):
140
pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false)"
141
propertySeparator="::"
143
The only property necessay is the connect String used by jgroups to configure itself. Refer to the Jgroups documentation for explanation
144
of all the protocols. The example above uses UDP multicast. If the connect property is not specified the default JGroups connection will be
112
148
<cacheManagerPeerProviderFactory
147
183
where the host is multihomed and you want to control the interface over which cluster
148
184
messages are received. Defaults to the host name of the default interface if not
150
* port - the port the listener listens on. This defaults to a free port if not specified.
186
* port - the port the RMI Registry listener listens on. This defaults to a free port if not specified.
187
* remoteObjectPort - the port number on which the remote objects bound in the registry receive calls.
188
This defaults to a free port if not specified.
151
189
* socketTimeoutMillis - the number of ms client sockets will stay open when sending
152
190
messages to the listener. This should be long enough for the slowest message.
153
191
If not specified it defaults 120000ms.
273
311
is 10. This property is only applicable if replicateAsynchronously=true
314
For the Jgroups replication this is done with:
315
<cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
316
properties="replicateAsynchronously=true, replicatePuts=true,
317
replicateUpdates=true, replicateUpdatesViaCopy=false,
318
replicateRemovals=true,asynchronousReplicationIntervalMillis=1000"/>
319
This listener supports the same property than the RMICacheReplicationFactory.
276
321
Cluster Bootstrapping
278
323
The RMIBootstrapCacheLoader bootstraps caches in clusters where RMICacheReplicators are