/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jbpm.pvm.internal.repository;
import java.util.HashMap;
import java.util.Map;
/**
* @author Tom Baeyens
*/
public class RepositoryCacheImpl implements RepositoryCache {
Map<String, Map<String, Object>> deployments = new HashMap<String, Map<String,Object>>();
public Object get(String deploymentId, String objectName) {
Map<String, Object> deploymentObjects = deployments.get(deploymentId);
if (deploymentObjects==null) {
return null;
}
return deploymentObjects.get(objectName);
}
public void set(String deploymentId, Map<String, Object> objects) {
if (objects==null) {
deployments.put(deploymentId, null);
} else {
Map<String, Object> deploymentObjects = deployments.get(deploymentId);
if (deploymentObjects==null) {
deploymentObjects = new HashMap<String, Object>();
deployments.put(deploymentId, deploymentObjects);
}
for (String objectName: objects.keySet()) {
Object object = objects.get(objectName);
deploymentObjects.put(objectName, object);
}
}
}
public void remove(String deploymentDbid) {
if (deployments!=null) {
deployments.remove(deploymentDbid);
}
}
public void clear() {
deployments = new HashMap<String, Map<String,Object>>();
}
}
分享到:
相关推荐
关于c++的一些设计技巧,相信能帮到你哦。。C++_缓存设计.doc
java缓存设计代码
06-Redis缓存设计与性能优化最佳实践_ev.rar06-Redis缓存设计与性能优化最佳实践_ev.rar06-Redis缓存设计与性能优化最佳实践_ev.rar06-Redis缓存设计与性能优化最佳实践_ev.rar06-Redis缓存设计与性能优化最佳实践_...
java缓存设计
Discuz!NT 缓存设计简析Discuz!NT 缓存设计简析
分布式系统缓存设计 分享。分布式系统缓存设计 分享。分布式系统缓存设计 分享
一站式学习Redis 从入门到高可用分布式实践(十一) 包含Redis基础,使用经验介绍、Java,Python客户端示范、Redis使用规范,由浅入深讲解并伴有企业中Redis开发的相关项目以及大规模Redis的实战经验,是开发和运维...
#资源达人分享计划#
本文介绍了FC-AL系统中FPGA的弹性缓存设计
基于FPGA与DDR2 SDRAM的大容量异步FIFO缓存设计.pdf
缓存设计详解低成本的高性能Web应用解决方案样本.doc
解析分布式系统的缓存设计.doc
Redis缓存设计[参考].pdf
高并发网站多级缓存设计.docx
企业开发使用效果很好,基于JAVA的,可以接受10万并发
FC-AL系统中FPGA的弹性缓存设计.pdf
企业级SSD缓存设计的思考.pptx
企业级SSD缓存设计的思考.pdf
多处理器共享缓存设计与实现.pdf
接着,针对缓存击穿与雪崩问题,提出过期时间随机化和高可用架构设计的解决方案。特别强调热点Key重建优化,避免并发高峰时的性能问题。另外,详细阐述了缓存与数据库双写一致性问题及解决策略。最后,提供了Redis...