本文整理汇总了Java中org.springframework.cache.support.NoOpCacheManager类的典型用法代码示例。如果您正苦于以下问题:Java NoOpCacheManager类的具体用法?Java NoOpCacheManager怎么用?Java NoOpCacheManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NoOpCacheManager类属于org.springframework.cache.support包,在下文中一共展示了NoOpCacheManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: noOpCacheStatisticsProvider
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Bean
public CacheStatisticsProvider<Cache> noOpCacheStatisticsProvider() {
return new CacheStatisticsProvider<Cache>() {
@Override
public CacheStatistics getCacheStatistics(CacheManager cacheManager,
Cache cache) {
if (cacheManager instanceof NoOpCacheManager) {
return NO_OP_STATS;
}
return null;
}
};
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:CacheStatisticsAutoConfiguration.java
示例2: whenSpringCacheTypeIsNoneThenNoOpCacheLoaded
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Test
public void whenSpringCacheTypeIsNoneThenNoOpCacheLoaded() {
loadContext(CacheConfiguration.class, "spring.cache.type=none");
CacheManager cacheManager = this.applicationContext.getBean(CacheManager.class);
assertThat(cacheManager).isInstanceOf(NoOpCacheManager.class);
}
开发者ID:sixhours-team,项目名称:memcached-spring-boot,代码行数:9,代码来源:MemcachedAutoConfigurationTest.java
示例3: sourceWriteSameVersion
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Test
public void sourceWriteSameVersion() throws Exception {
User specificRecord = new User();
specificRecord.setName("joe");
Schema v1 = new Schema.Parser().parse(AvroMessageConverterSerializationTests.class
.getClassLoader().getResourceAsStream("schemas/user.avsc"));
GenericRecord genericRecord = new GenericData.Record(v1);
genericRecord.put("name", "joe");
SchemaRegistryClient client = new DefaultSchemaRegistryClient();
AvroSchemaRegistryClientMessageConverter converter = new AvroSchemaRegistryClientMessageConverter(
client, new NoOpCacheManager());
converter.setSubjectNamingStrategy(new DefaultSubjectNamingStrategy());
converter.setDynamicSchemaGenerationEnabled(false);
converter.afterPropertiesSet();
Message specificMessage = converter.toMessage(specificRecord,
new MutableMessageHeaders(Collections.<String, Object> emptyMap()),
MimeTypeUtils.parseMimeType("application/*+avro"));
SchemaReference specificRef = extractSchemaReference(MimeTypeUtils.parseMimeType(
specificMessage.getHeaders().get("contentType").toString()));
Message genericMessage = converter.toMessage(genericRecord,
new MutableMessageHeaders(Collections.<String, Object> emptyMap()),
MimeTypeUtils.parseMimeType("application/*+avro"));
SchemaReference genericRef = extractSchemaReference(MimeTypeUtils.parseMimeType(
genericMessage.getHeaders().get("contentType").toString()));
Assert.assertEquals(genericRef, specificRef);
Assert.assertEquals(1, genericRef.getVersion());
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:32,代码来源:AvroMessageConverterSerializationTests.java
示例4: testOriginalContentTypeHeaderOnly
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Test
public void testOriginalContentTypeHeaderOnly() throws Exception {
User specificRecord = new User();
specificRecord.setName("joe");
Schema v1 = new Schema.Parser().parse(AvroMessageConverterSerializationTests.class
.getClassLoader().getResourceAsStream("schemas/user.avsc"));
GenericRecord genericRecord = new GenericData.Record(v1);
genericRecord.put("name", "joe");
SchemaRegistryClient client = new DefaultSchemaRegistryClient();
client.register("user", "avro", v1.toString());
AvroSchemaRegistryClientMessageConverter converter = new AvroSchemaRegistryClientMessageConverter(
client, new NoOpCacheManager());
converter.setDynamicSchemaGenerationEnabled(false);
converter.afterPropertiesSet();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DatumWriter<User> writer = new SpecificDatumWriter<>(User.class);
Encoder encoder = EncoderFactory.get().binaryEncoder(baos, null);
writer.write(specificRecord, encoder);
encoder.flush();
Message source = MessageBuilder.withPayload(baos.toByteArray())
.setHeader(MessageHeaders.CONTENT_TYPE,
MimeTypeUtils.APPLICATION_OCTET_STREAM)
.setHeader(BinderHeaders.BINDER_ORIGINAL_CONTENT_TYPE,
"application/vnd.user.v1+avro")
.build();
Object converted = converter.fromMessage(source, User.class);
Assert.assertNotNull(converted);
Assert.assertEquals(specificRecord.getName().toString(),
((User) converted).getName().toString());
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:32,代码来源:AvroMessageConverterSerializationTests.java
示例5: testNoCacheConfiguration
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Test
public void testNoCacheConfiguration() {
ConfigurableApplicationContext sourceContext = SpringApplication.run(NoCacheConfiguration.class,
"--spring.main.web-environment=false");
AvroSchemaRegistryClientMessageConverter converter = sourceContext
.getBean(AvroSchemaRegistryClientMessageConverter.class);
DirectFieldAccessor accessor = new DirectFieldAccessor(converter);
assertThat(accessor.getPropertyValue("cacheManager")).isInstanceOf(NoOpCacheManager.class);
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:10,代码来源:AvroSchemaRegistryClientMessageConverterTests.java
示例6: setUp
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
Mongo mongo = embeddedMongoDbRule.getDatabaseOperation().connectionManager();
final AclCache aclCache = new SpringCacheBasedAclCache(new NoOpCacheManager().getCache("acl"), pgs, aas);
fixture = new MongoMutableAclService(mongo, "test", aclCache, pgs, aas);
fixture.afterPropertiesSet();
SecurityContextHolder.getContext()
.setAuthentication(new PreAuthenticatedAuthenticationToken("[email protected]", "password"));
}
开发者ID:cedac-software,项目名称:spring-security-mongodb,代码行数:13,代码来源:MongoMutableAclServiceTests.java
示例7: setUp
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
Mongo mongo = embeddedMongoDbRule.getDatabaseOperation().connectionManager();
final AclCache aclCache = new SpringCacheBasedAclCache(new NoOpCacheManager().getCache("acl"), pgs, aas);
fixture = new MongoAclService(mongo, "test", aclCache, pgs, aas);
fixture.afterPropertiesSet();
}
开发者ID:cedac-software,项目名称:spring-security-mongodb,代码行数:10,代码来源:MongoAclServiceTests.java
示例8: cacheManager
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Bean
public CacheManager cacheManager() {
log.debug("No cache");
return new NoOpCacheManager();
}
开发者ID:Cinderpup,项目名称:RoboInsta,代码行数:6,代码来源:CacheConfiguration.java
示例9: cm1
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Bean
public CacheManager cm1() {
return new NoOpCacheManager();
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:EnableCachingTests.java
示例10: cm2
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Bean
public CacheManager cm2() {
return new NoOpCacheManager();
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:EnableCachingTests.java
示例11: cm
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Bean
public CacheManager cm() {
return new NoOpCacheManager();
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:EnableCachingTests.java
示例12: cacheManager
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Override
@Bean
public CacheManager cacheManager() {
return new NoOpCacheManager();
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:EnableCachingTests.java
示例13: setup
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Before
public void setup() {
manager = new NoOpCacheManager();
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:NoOpCacheManagerTests.java
示例14: mgr
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Bean
CacheManager mgr() {
return new NoOpCacheManager();
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:EnableCachingIntegrationTests.java
示例15: cacheManager
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Bean
CacheManager cacheManager() {
return new NoOpCacheManager();
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:EnableCachingIntegrationTests.java
示例16: shouldConfigureNoOpCacheManager
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Test
public void shouldConfigureNoOpCacheManager() throws Exception {
CacheManager bean = this.applicationContext.getBean(CacheManager.class);
assertThat(bean).isInstanceOf(NoOpCacheManager.class);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:AutoConfigureCacheIntegrationTests.java
示例17: cacheManager
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Bean
public NoOpCacheManager cacheManager() {
return new NoOpCacheManager();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:CacheStatisticsAutoConfigurationTests.java
示例18: noOpCacheExplicit
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
@Test
public void noOpCacheExplicit() {
load(DefaultCacheConfiguration.class, "spring.cache.type=none");
NoOpCacheManager cacheManager = validateCacheManager(NoOpCacheManager.class);
assertThat(cacheManager.getCacheNames()).isEmpty();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:CacheAutoConfigurationTests.java
示例19: PermissionServiceImpl
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
public PermissionServiceImpl() {
this.cacheManager = new NoOpCacheManager();
}
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:PermissionServiceImpl.java
示例20: RoleServiceImpl
import org.springframework.cache.support.NoOpCacheManager; //导入依赖的package包/类
public RoleServiceImpl() {
this.cacheManager = new NoOpCacheManager();
}
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:RoleServiceImpl.java
注:本文中的org.springframework.cache.support.NoOpCacheManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论