- 浏览: 187759 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (83)
- J2EE/Core Java (24)
- J2EE/Portal (2)
- J2EE/UI (4)
- J2EE/ATG (1)
- J2EE/Report (1)
- J2EE/Web Service/Rest API (2)
- Design Pattern (2)
- Arithmetic (4)
- Linux (12)
- Ruby&Rails (17)
- Database (5)
- J2EE/Payment (1)
- J2EE/JVM (1)
- Encryption/Decryption (3)
- J2EE/Multi Threading (4)
- SQL (1)
- https://community.teamviewer.com/t5/Knowledge-Base/Where-can-I-download-older-TeamViewer-versions-nbsp/ta-p/7729 (0)
最新评论
引用
本文是ehcache RMI集群的例子,导入附件中的java 项目到eclipse中,依次启动附件中的A.java,B.java,C.java, 就可以在eclipse的console中就可以看到3个cache的内容同步啦
1. ehcache 配置文件
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"> <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" properties="peerDiscovery=manual, rmiUrls=//localhost:40002/UserCache|//localhost:40003/UserCache" /> <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="hostName=localhost,port=40001, socketTimeoutMillis=2000" /> <cache name="UserCache" maxElementsInMemory="10000" > <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=true, replicatePutsViaCopy=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true, asynchronousReplicationIntervalMillis=200" /> <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" /> </cache> </ehcache>
2. A.java
CacheManager manager = new CacheManager("config/ehcache_cluster1.xml"); // 取得Cache Cache cache = manager.getCache("UserCache"); Element element = new Element("Client A", "A"); cache.put(element); while (true) { Thread.sleep(5000); System.out.println("\n"); for (Object key : cache.getKeys()) { System.out.println(key + ":" + cache.get(key)); } cache.put(new Element("client A" + System.currentTimeMillis(), "client1")); }
- EhcacheRMICluster.zip (4 MB)
- 下载次数: 13
发表评论
-
Start tomcat with port 80 without Linux root user-Use iptables mapping
2016-05-25 17:39 835引用In linux system. only root us ... -
Format XML in JAVA
2016-01-11 12:23 605public static String format ... -
HttpURLConnection下载文件
2015-08-07 11:25 797public class HttpDownloadUtilit ... -
Integrete unitils for database(dao) testing
2013-02-01 18:39 1695引用Database testing Unit tests f ... -
JAXB入门
2012-10-16 11:59 791引用jaxb是一个读写xml的工具,还可以提供验证,不需要额外 ... -
Freemarker使用入门
2012-10-16 11:54 1023引用freemarker是一种模板标记工具,可以做页面静态化, ... -
perforce java api使用
2012-10-16 11:43 1258引用perforce是种版本管理软件,提供啦完整的java a ... -
XPath 入门
2012-10-16 11:29 884引用xpath可以快速定位获取XML文件中指定属性和值,jdk ... -
Java File Diff-diffutils
2012-09-27 17:35 74671. Maven Dependency <depende ... -
XSD 入门使用
2012-09-18 23:20 780<?xml version="1.0" ... -
nexus-2.1.1安装及使用入门
2012-08-13 22:52 14501. 安装 地址http://www.sonatype.org ... -
File Demo
2012-06-25 22:55 1313package org.springside.examples ... -
Java 访问sharepoint webservice(NTLM & SSL)
2012-06-12 09:47 3776引用遇到需要使用java访问微软的sharepoint的web ... -
Selenium Web Driver入门
2012-05-27 23:17 58421 What is Selenium? 引用Selenium ... -
HttpClient4.1.2 & HtmlUnit2.9 处理文件下载
2012-01-09 18:18 1030TestCode import java.io.Fi ... -
HttpClient4.1.2 & HtmlUnit2.9 NTLM 验证 和 Httpclient4.1.2 https/SSL
2012-01-09 18:13 15981. HttpClient4.1.2 & HtmlUn ... -
HttpClient4登陆ITeye
2012-01-08 23:33 1901import java.io.IOException; im ... -
Spring2集成测试
2011-08-25 22:21 766Spring2测试类继承层次 集成测试例子 public ... -
Learning EasyMock3.0 By Official Example
2011-08-24 16:48 1378Maven Installation+ add followi ... -
Maven+jetty+jrebel+m2eclipse+eclipse搭建struts2开发环境
2011-08-11 11:18 4129引用Maven:项目构建工具,通过pom.xml可以自动维护j ...
相关推荐
ehcahce通过RMI方式进行集群的demo,myeclipse导入后直接可以运行。
ehcache集群方案
Ehcache集群实例 Ehcache jgroups Ehcache rmi
RMI+EHCACHE可以做基础学习理解
EHCAHCE基于JGROUP的集群配置方案,内含相关配置文件,及配置说明
ehcache集群同步配置实例加说明文档
ehcache提供三种网络连接策略来实现集群,rmi,jgroup还有jms。这里只说rmi方式。同时ehcache可以可以实现多播的方式实现集群。也可以手动指定集群主机序列实现集群,本例应用手动指定。
ehcache jgroups方式集群,根据网上的资料自己摸索修改的,欢迎下载
Ehcache集群环境配置
使用ehcache rmi 手动发现(manual)进行集群同步的示例.
Ehcache通过使用Jgroups做集群配置,更改每一个不同的jgroups.xml文件的端口号和IP,如果一台机器就使用127.0.0.1即可。配置好之后,把每台机器起来,就可以测试了。
此为ehcache的使用以及集群的使用,具体需要两台机子,将ehcache 的hostName替换相应的ip即可
Ehcache使用的小例子,本代码仅供学习和参考,谢谢!
ehcache3集群相关资源,包括ehcache-clustered-3.10.0-kit、ehcache-3.10.0.jar、ehcache-clustered-3.10.0.jar、terracotta-3.7.7.tar.gz、ehcache-transactions-3.10.0.jar
当有数据更新的时候,每个进程中的缓存都是独立维护的,如果这些进程缓存同步机制,那么就存在因缓存没有...所以,本文就来说说当使用EhCache的时候,如果来组建进程内缓存EnCache的集群以及配置配置他们的同步策略。
具有集群支持的 Ehcache 3(ehcache-clustered-3.8.1-kit.zip)
由于 JGroups 的包比较大,有两兆多,因此没有放到这个zip包里,请大家自行下载 JGroups 的jar包(jgroups-all.jar),并放入解压后的 webapp/WEB-INF/lib 目录下即可。 只需要将解压后的 webapp 目录配置到tomcat下做...
NULL 博文链接:https://nassir.iteye.com/blog/1602372
Ehcache集群配置手册帮助你梳理Ehcache集群部署的配置