- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.commons.jcs.engine.ZombieCacheServiceNonLocal.<init>()
方法的一些代码示例,展示了ZombieCacheServiceNonLocal.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZombieCacheServiceNonLocal.<init>()
方法的具体详情如下:
包路径:org.apache.commons.jcs.engine.ZombieCacheServiceNonLocal
类名称:ZombieCacheServiceNonLocal
方法名:<init>
[英]Default.
[中]违约
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Not yet sure what to do here.
* <p>
* @param ex
* @param msg
* @throws IOException
*/
private void handleException( Exception ex, String msg )
throws IOException
{
log.error( "Disabling lateral cache due to error " + msg, ex );
lateralCacheService = new ZombieCacheServiceNonLocal<K, V>( lateralCacheAttributes.getZombieQueueMaxSize() );
// may want to flush if region specifies
// Notify the cache monitor about the error, and kick off the recovery
// process.
monitor.notifyError();
// could stop the net search if it is built and try to reconnect?
if ( ex instanceof IOException )
{
throw (IOException) ex;
}
throw new IOException( ex.getMessage() );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Not yet sure what to do here.
* <p>
* @param ex
* @param msg
* @throws IOException
*/
private void handleException( Exception ex, String msg )
throws IOException
{
log.error( "Disabling lateral cache due to error " + msg, ex );
lateralCacheService = new ZombieCacheServiceNonLocal<K, V>( lateralCacheAttributes.getZombieQueueMaxSize() );
// may want to flush if region specifies
// Notify the cache monitor about the error, and kick off the recovery
// process.
monitor.notifyError();
// could stop the net search if it is built and try to reconnect?
if ( ex instanceof IOException )
{
throw (IOException) ex;
}
throw new IOException( ex.getMessage() );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Nothing right now. This should setup a zombie and initiate recovery.
* <p>
* @param ex
* @param msg
* @param eventName
* @throws IOException
*/
@Override
protected void handleException( Exception ex, String msg, String eventName )
throws IOException
{
// we should not switch if the existing is a zombie.
if ( !( getRemoteCacheService() instanceof ZombieCacheServiceNonLocal ) )
{
String message = "Disabling remote cache due to error: " + msg;
logError( cacheName, "", message );
log.error( message, ex );
setRemoteCacheService( new ZombieCacheServiceNonLocal<K, V>( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
monitor.notifyError( this );
}
if ( ex instanceof IOException )
{
throw (IOException) ex;
}
throw new IOException( ex.getMessage() );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that a remove event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testRemoveThenWalk()
throws Exception
{
// SETUP
MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testRemoveThenWalk";
String key = "myKey";
// DO WORK
zombie.remove( cacheName, key, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", key, service.lastRemoveKey );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that a removeAll event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testRemoveAllThenWalk()
throws Exception
{
// SETUP
MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testRemoveThenWalk";
// DO WORK
zombie.removeAll( cacheName, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", cacheName, service.lastRemoveAllCacheName);
}
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Verify that a remove event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testRemoveThenWalk()
throws Exception
{
// SETUP
MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testRemoveThenWalk";
String key = "myKey";
// DO WORK
zombie.remove( cacheName, key, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", key, service.lastRemoveKey );
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Verify that a removeAll event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testRemoveAllThenWalk()
throws Exception
{
// SETUP
MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testRemoveThenWalk";
// DO WORK
zombie.removeAll( cacheName, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", cacheName, service.lastRemoveAllCacheName );
}
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that a remove event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testRemoveThenWalk()
throws Exception
{
// SETUP
MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testRemoveThenWalk";
String key = "myKey";
// DO WORK
zombie.remove( cacheName, key, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", key, service.lastRemoveKey );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that a removeAll event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testRemoveAllThenWalk()
throws Exception
{
// SETUP
MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testRemoveThenWalk";
// DO WORK
zombie.removeAll( cacheName, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", cacheName, service.lastRemoveAllCacheName );
}
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Verify that a remove event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testRemoveThenWalk()
throws Exception
{
// SETUP
MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testRemoveThenWalk";
String key = "myKey";
// DO WORK
zombie.remove( cacheName, key, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", key, service.lastRemoveKey );
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Verify that a removeAll event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testRemoveAllThenWalk()
throws Exception
{
// SETUP
MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testRemoveThenWalk";
// DO WORK
zombie.removeAll( cacheName, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", cacheName, service.lastRemoveAllCacheName);
}
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that an update event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testUpdateThenWalk()
throws Exception
{
// SETUP
MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
zombie.update( element, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", element, service.lastUpdate );
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Verify that nothing is added if the max is set to 0.
* <p>
* @throws Exception
*/
public void testUpdateThenWalk_zeroSize()
throws Exception
{
// SETUP
MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 0 );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
zombie.update( element, 123l );
zombie.propagateEvents( service );
// VERIFY
assertNull( "Nothing should have been put to the service.", service.lastUpdate );
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Verify that an update event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testUpdateThenWalk()
throws Exception
{
// SETUP
MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
zombie.update( element, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", element, service.lastUpdate );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that nothing is added if the max is set to 0.
* <p>
* @throws Exception
*/
public void testUpdateThenWalk_zeroSize()
throws Exception
{
// SETUP
MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 0 );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
zombie.update( element, 123l );
zombie.propagateEvents( service );
// VERIFY
assertNull( "Nothing should have been put to the service.", service.lastUpdate );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that an update event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testUpdateThenWalk()
throws Exception
{
// SETUP
MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
zombie.update( element, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", element, service.lastUpdate );
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Verify that nothing is added if the max is set to 0.
* <p>
* @throws Exception
*/
public void testUpdateThenWalk_zeroSize()
throws Exception
{
// SETUP
MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 0 );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
zombie.update( element, 123l );
zombie.propagateEvents( service );
// VERIFY
assertNull( "Nothing should have been put to the service.", service.lastUpdate );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that nothing is added if the max is set to 0.
* <p>
* @throws Exception
*/
public void testUpdateThenWalk_zeroSize()
throws Exception
{
// SETUP
MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 0 );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
zombie.update( element, 123l );
zombie.propagateEvents( service );
// VERIFY
assertNull( "Nothing should have been put to the service.", service.lastUpdate );
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-core
/**
* Verify that an update event gets added and then is sent to the service passed to propagate.
* <p>
* @throws Exception
*/
public void testUpdateThenWalk()
throws Exception
{
// SETUP
MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
zombie.update( element, 123l );
zombie.propagateEvents( service );
// VERIFY
assertEquals( "Updated element is not as expected.", element, service.lastUpdate );
}
代码示例来源:origin: org.apache.commons/commons-jcs-core
/**
* Verify that when we call fix events queued in the zombie are propagated to the new service.
* <p>
* @throws Exception
*/
public void testUpdateZombieThenFix()
throws Exception
{
// SETUP
ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
// set the zombie
RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, zombie, listener, monitor );
String cacheName = "testUpdate";
// DO WORK
ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
remoteCache.update( element );
// set the new service, this should call propagate
remoteCache.fixCache( service );
// VERIFY
assertTrue( "The element should be in the serialized warapper.",
service.lastUpdate instanceof ICacheElementSerialized );
ICacheElement<String, String> result = SerializationConversionUtil
.getDeSerializedCacheElement( (ICacheElementSerialized<String, String>) service.lastUpdate, remoteCache
.getElementSerializer() );
assertEquals( "Wrong element updated.", element.getVal(), result.getVal() );
}
我是第一次实现磁盘缓存 (jcs)。我想配置 cache.ccf 文件以允许磁盘缓存。我的 cache.ccf 文件有这样的配置: jcs.region.lesson=blockDiskCache j
我在我的应用程序中使用 JCS 进行缓存。最近发生了一些错误,其中并发访问缓存中的数据导致空值,即一个线程写入缓存,一个线程读取缓存缓存。我想知道 JCS 在写入和读取缓存时是否天生支持线程安全实现。
我是第一次实现 JCS。 我的要求:我有一个带有 main 方法的 java 类,在该方法中我在缓存中存储一些数据。 我有第二个java类,它有一个主要方法,我从磁盘缓存中检索我使用第一个java
我正在使用 JCS 进行缓存,我遇到了数据未写入磁盘的问题,即没有出现错误,但是当我查看数据文件时,它们的大小都是 0k。有人知道吗是什么导致了这个错误,我正在使用 JCS 网站中提供的属性文件。 最
我在应用程序中使用 Apache JCS 在应用程序启动时缓存常用数据。但是,如果缓存中的某些数据直到空闲时间才使用,我想从数据库手动重新加载该值。 所以,基本上我想重写 JCS 事件,以便我的 ja
我们使用 JCS 非常简单。没有分发或任何东西,简单地说: JCS jcs = JCS.getInstance("region-name"); 我正在尝试注册某种监听器,该监听器可用于在元素从缓存中删
我们将身份验证 token 存储在 JCS 中,重新启动服务器时,缓存上下文丢失。为了克服这个问题,当停止服务器时,决定将 JCS 值列表存储到一个文件中,并在重新启动时读取该文件并将其存储回 JCS
这与我之前的问题https://stackoverflow.com/questions/8428911/jcs-disk-cache-data-retrieval有关 即使在应用程序关闭后,JCS 也
JCS 缓存 - 删除功能而不删除特定元素 我们应用程序的 jcs 缓存配置如下,我看到当我们使用 fulshAll() 方法时它会删除整个缓存但是当我们使用 remove(key) 时它不会删除该对
我正在使用 JCS 进行缓存。现在我正在使用磁盘缓存来临时存储所有数据。问题是当我使用 JCS 时,只有当缓存正确关闭时, key 才会写入磁盘。 我使用磁盘使用模式作为更新,它告诉 JCS 立即将数
我们有作业在 JCS 中运行,由于不再支持 JCS,我们正在将 JCS 中的作业迁移到 Autosys 。我们团队中没有人知道如何将 JCS 中的 JOB 迁移到 Autosys。即使我在谷歌上搜索了
我们计划在我们的应用程序中使用一些缓存机制,并在与许多其他缓存解决方案进行比较研究后选择了Java缓存系统(JCS)。当我使用外部配置(cache.ccf)来定义缓存区域及其属性(如 maxlife、
我正在尝试使用 JCS 1.3 创建永久磁盘缓存。我希望缓存能够关闭,然后在下次使用时从磁盘重新加载。我有很多数据要从需要很长时间才能运行的数据库中填充,如果缓存只是从磁盘重新加载,速度会快得多。我尝
大多数缓存服务都支持将任何对象缓存为键值对。但我正在寻找一种可以将对象缓存为区域或组的方法。这意味着,缓存对象应该能够分组。一个或多个对象被缓存到一个组中。无论我们对组做什么(删除、更新),都应该影响
我正在使用 JCS 缓存。我想检索特定区域的所有键和值。 JCS jcsInstance=JCS.getInstance("regionName"); 我怎样才能实现它? 最佳答案 在组缓存访问类中,
背景: 我们有 4 台物理服务器 (4 IPS),每台都在端口 80 上运行的 JBOSS 6 EAP 中运行。所有请求都通过负载均衡器重定向到其中任何一台服务器。现在我尝试为这种分布式环境实现 Ja
我正在使用 JCS 缓存来增强性能。当我需要维护一组 key 时会出现问题,因为我使用的存储类型通常是离线存储到磁盘。有没有一种方法可以像使用 HashMap 一样从缓存中单独获取键集,以便我可以自动
我在我的应用程序中使用 JCS 缓存。我正在从 Java 应用程序(主要方法)更新 jcs 缓存数据。并使用另一个 tomcat 应用程序( war )访问它。我的问题是我没有为 tomcat 应用程
我在我的 J2ee 应用程序中实现了 JCS,它使用 log4j 进行日志记录。 我的需求 将应用程序 rootLogger 设置为 DEBUG 级别,并将 jcs 日志设置为 ERROR 模式。 尝
本文整理了Java中org.apache.commons.jcs.engine.ZombieCacheServiceNonLocal类的一些代码示例,展示了ZombieCacheServiceNonL
我是一名优秀的程序员,十分优秀!