本文整理汇总了Java中org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated类的典型用法代码示例。如果您正苦于以下问题:Java ClientCacheEntryCreated类的具体用法?Java ClientCacheEntryCreated怎么用?Java ClientCacheEntryCreated使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientCacheEntryCreated类属于org.infinispan.client.hotrod.annotation包,在下文中一共展示了ClientCacheEntryCreated类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCacheEvent
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; //导入依赖的package包/类
/**
* Listens to Infinispan cache entry create and cache entry modify events. Converts data into JPG image and stores
* it into dedicated cache. Then classifies the image using trained TenforFlow NN and store the results into the
* result cache.
*
* @param e
* Custom event from StringByteArrayConverter, containing String key and byte array value.
*/
@ClientCacheEntryCreated
@ClientCacheEntryModified
public void onCacheEvent(ClientCacheEntryCustomEvent<byte[]> e) {
ByteBuffer buffer = ByteBuffer.wrap(e.getEventData());
int keyLength = UnsignedNumeric.readUnsignedInt(buffer);
byte[] keyBytes = new byte[keyLength];
buffer.get(keyBytes);
String key = new String(keyBytes);
int valueLength = UnsignedNumeric.readUnsignedInt(buffer);
byte valueBytes[] = new byte[valueLength];
buffer.get(valueBytes);
// as JS client currently doesn't support converters, we cannot send JPG image as part of the client event, thus
// storing it into separate (eagerly evicted) cache
jpgCache.put(key, bufferAsJpgString(valueBytes));
String result = classifier.processEvent(valueBytes);
resultCache.put(key, result);
System.out.printf("On the image with ID %s could be number %s\n", key, result);
}
开发者ID:infinispan-demos,项目名称:tf-ispn-demo,代码行数:28,代码来源:MnistListener.java
示例2: entryCreated
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; //导入依赖的package包/类
@ClientCacheEntryCreated
public void entryCreated(ClientCacheEntryCreatedEvent<String> event) {
if (logger.isDebugEnabled()) {
logger.debug("Session created with id: " + event.getKey());
}
eventPublisher.publishEvent(new SessionCreatedEvent(this, event.getKey()));
}
开发者ID:kazuhira-r,项目名称:spring-session-infinispan,代码行数:8,代码来源:RemoteSessionEntryListener.java
示例3: processClientEvent
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; //导入依赖的package包/类
@ClientCacheEntryCreated
@ClientCacheEntryModified
@ClientCacheEntryRemoved
@ClientCacheEntryExpired
@ClientCacheFailover
public void processClientEvent(ClientEvent event) {
if (isAccepted(event.getType().toString())) {
infinispanConsumer.processEvent(event.getType().toString(), false, cacheName, getKey(event), getEventData(event));
}
}
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:InfinispanRemoteCustomListener.java
示例4: entryCreated
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; //导入依赖的package包/类
@ClientCacheEntryCreated
public void entryCreated(ClientCacheEntryCreatedEvent<String> event) {
log.info(String.format(EVENT_MSG_FORMAT, "Created", event.getKey()));
}
开发者ID:benemon,项目名称:he-rss-poll,代码行数:5,代码来源:RemoteCacheListener.java
示例5: entryCreated
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; //导入依赖的package包/类
@ClientCacheEntryCreated
public void entryCreated(ClientCacheEntryCreatedEvent event) {
creationsInTheLastInterval.incrementAndGet();
}
开发者ID:NovaOrdis,项目名称:playground,代码行数:6,代码来源:StatisticsEnabledCacheClientListener.java
示例6: processEvent
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; //导入依赖的package包/类
@ClientCacheEntryCreated
public void processEvent(ClientCacheEntryCreatedEvent<Object> event) {
logger.trace("Received ClientEvent [{}]", event);
dispatch(event.getType().toString(), false, cacheName, event.getKey());
}
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:InfinispanRemoteEventListener.java
示例7: entryCreated
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; //导入依赖的package包/类
@ClientCacheEntryCreated
public void entryCreated(ClientCacheEntryCreatedEvent<String> event) {
System.out.printf("Created %s%n", event.getKey());
}
开发者ID:infinispan,项目名称:infinispan-simple-tutorials,代码行数:5,代码来源:InfinispanRemoteListen.java
示例8: entryCreated
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; //导入依赖的package包/类
@ClientCacheEntryCreated
public void entryCreated(ClientCacheEntryCreatedEvent event) {
//Console.info("" + event);
System.out.println("ClientCacheEntryCreated");
}
开发者ID:NovaOrdis,项目名称:playground,代码行数:8,代码来源:CacheClientListener.java
注:本文中的org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论