先贴出Infinispan配置文件说明:
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
xmlns="urn:infinispan:config:5.0">
<!-- 定义全局缓存策略 -->
<global>
<!-- 交通工具,集群通信工具 -->
<transport machineId="computer_01" siteId="site_001"
strictPeerToPeer="true"
transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"
rackId="null" clusterName="infinispan_cluster" nodeName="node_01"
distributedSyncTimeout="240000">
</transport>
<!-- 当JVM关闭的cache instance的时候
hookBehavior:(DEFAULT|REGISTER|DONT_REGISTER)
-->
<shutdown hookBehavior="DEFAULT" />
<!--用户定时刷新复制队列,如果useReplQueue 设置为true的时候用于刷新队列的执行器 -->
<replicationQueueScheduledExecutor
factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
<properties>
<property name="threadNamePrefix"
value="replicationQueueScheduledExecutor_thread" />
<!-- 核心线程数目 -->
<property name="maxThreads" value="10" />
</properties>
</replicationQueueScheduledExecutor>
<!-- 配置全局是否使用JMX配管理统计
cacheManagerName:如果JMX统计被启动,这个属性代表这个缓存管理器名称
jmxDomain:jmx域名
enabled:默认是false,是否被JMX来管理开关
mBeanServerLookup:Fully qualified name of class that will attempt to locate a JMX MBean server to bind to
allowDuplicateDomains:默认是false,如果设置为true,multiple cache manager instances could be configured under the same configured JMX domain. Each cache manager will in practice use a different JMX domain that has been calculated based on the configured one by adding an incrementing index to it
-->
<globalJmxStatistics allowDuplicateDomains="false"
enabled="true" cacheManagerName="infinispan_jmxManage"
jmxDomain="org.infinispan"
mBeanServerLookup="org.infinispan.jmx.PlatformMBeanServerLookup" />
<!-- 异步侦听执行器,用于向异步侦听器发送通知
factory:执行器工厂类名称,重写实现该类必须继承org.infinispan.executors.ExecutorFactory
-->
<asyncListenerExecutor
factory="org.infinispan.executors.DefaultExecutorFactory">
<!-- 异步执行器的属性设置 -->
<properties>
<!-- threadNamePrefix:线程名称前缀。 -->