本文整理汇总了Java中org.infinispan.client.hotrod.RemoteCache.get方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteCache.get方法的具体用法?Java RemoteCache.get怎么用?Java RemoteCache.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.infinispan.client.hotrod.RemoteCache
的用法示例。
在下文中一共展示了RemoteCache.get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupMetadataCache
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
private boolean setupMetadataCache() throws IOException {
log.log(Level.INFO, "setupMetadataCache");
try {
final RemoteCache<String, String> metadataCache = cacheManagerForIndexableCaches.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
metadataCache.put(RULE_PROTOBUF_DEFINITION_RESOURCE, readResource(RULE_PROTOBUF_DEFINITION_RESOURCE));
metadataCache.put(CUSTOM_LIST_PROTOBUF_DEFINITION_RESOURCE, readResource(CUSTOM_LIST_PROTOBUF_DEFINITION_RESOURCE));
final String errors = metadataCache.get(ProtobufMetadataManagerConstants.ERRORS_KEY_SUFFIX);
if (errors != null) {
log.log(Level.SEVERE, "Protobuffer files, either Rule or CustomLists contained errors:\n" + errors);
return false;
}
} catch (TransportException ex) {
return false;
}
return true;
}
示例2: test
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
public void test() {
RemoteCacheManager cacheManager = new RemoteCacheManager("192.168.0.58:11322;192.168.0.58:11422", true);
RemoteCache<Object, Object> cache = cacheManager.getCache("KHAN_SESSION");
Set<Object> keySet = cache.keySet();
Iterator<Object> i = keySet.iterator();
System.out.println("============= KHAN_SESSION");
while (i.hasNext()) {
Object key = i.next();
System.out.println("> key=" + key);
Object value = cache.get(key);
System.out.println("> value=" + value);
System.out.println("");
}
System.out.println("=============");
}
示例3: test2
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
public void test2() {
RemoteCacheManager cacheManager = new RemoteCacheManager("192.168.0.58:11322;192.168.0.58:11422", true);
RemoteCache<Object, Object> cache = cacheManager.getCache("KHAN_SESSION_LOGIN");
Set<Object> keySet = cache.keySet();
Iterator<Object> i = keySet.iterator();
System.out.println("============= KHAN_SESSION_LOGIN");
while (i.hasNext()) {
Object key = i.next();
System.out.println("> key=" + key);
Object value = cache.get(key);
System.out.println("> value=" + value);
System.out.println("");
}
System.out.println("=============");
}
示例4: testRemoteCache
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
public void testRemoteCache() {
RemoteCacheManager cacheManager = new RemoteCacheManager("192.168.0.58:11422;192.168.0.58:11322", true);
RemoteCache<Object, Object> cache = cacheManager.getCache("KHAN_SESSION_REMOTE");
Set<Object> keySet = cache.keySet();
Iterator<Object> i = keySet.iterator();
System.out.println("============= KHAN_SESSION_REMOTE");
while (i.hasNext()) {
Object key = i.next();
System.out.println("> key=" + key);
Object value = cache.get(key);
System.out.println("> value=" + value);
System.out.println("");
}
System.out.println("=============");
}
示例5: testRemoteLoginCache
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
public void testRemoteLoginCache() {
RemoteCacheManager cacheManager = new RemoteCacheManager("192.168.0.58:11422;192.168.0.58:11322", true);
RemoteCache<Object, Object> cache = cacheManager.getCache("KHAN_SESSION_LOGIN_REMOTE");
Set<Object> keySet = cache.keySet();
Iterator<Object> i = keySet.iterator();
System.out.println("============= KHAN_SESSION_LOGIN_REMOTE");
while (i.hasNext()) {
Object key = i.next();
System.out.println("> key=" + key);
Object value = cache.get(key);
System.out.println("> value=" + value);
System.out.println("");
}
System.out.println("=============");
}
示例6: startInternal
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
protected void startInternal() throws Exception {
SerializationContext serializationContext = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
String protoFile = builder.build(serializationContext);
//initialize server-side serialization context
RemoteCache<String, String> metadataCache = remoteCacheManager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
metadataCache.put(fileName, protoFile);
Object error = metadataCache.get(fileName + ProtobufMetadataManagerConstants.ERRORS_KEY_SUFFIX);
if (error != null) {
throw new IllegalStateException("Protobuf metadata failed: " + error);
}
}
示例7: performKeySearch
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
public static Object performKeySearch(String cacheName, String columnNameInSource, Object value, InfinispanConnection conn) throws TranslatorException {
@SuppressWarnings("rawtypes")
RemoteCache<?, Object> c = (RemoteCache<?, Object>) conn.getCache(cacheName);
Object v = c.get(value);
return v;
}
示例8: execute
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
@Override
public void execute(String restOfTheLine) throws Exception {
if (restOfTheLine == null || restOfTheLine.trim().length() == 0) {
throw new UserErrorException("key name missing");
}
String keyName = restOfTheLine.replaceAll(" .*$", "");
RemoteCache defaultCache = insureConnected();
Object o = defaultCache.get(keyName);
Console.info("" + o);
}
示例9: readSLAMessage
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
public SLAMessage readSLAMessage(String key) {
RemoteCache<String, SLAMessage> cache = remoteCacheManager.getSlaMessageCache();
if ( cache.containsKey(key) ) {
return cache.get(key);
} else {
return null;
}
}