本文整理汇总了Java中com.hazelcast.core.ItemEventType类的典型用法代码示例。如果您正苦于以下问题:Java ItemEventType类的具体用法?Java ItemEventType怎么用?Java ItemEventType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ItemEventType类属于com.hazelcast.core包,在下文中一共展示了ItemEventType类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notifyListeners
import com.hazelcast.core.ItemEventType; //导入依赖的package包/类
public void notifyListeners(Packet packet) {
List<ItemListenerHolder> list = queueItemListeners.get(packet.getName());
if (list != null) {
for (ItemListenerHolder listenerHolder : list) {
ItemListener<Object> listener = listenerHolder.listener;
Boolean added = (Boolean) toObject(packet.getValue());
if (added) {
listener.itemAdded(new DataAwareItemEvent(packet.getName(), ItemEventType.ADDED,
listenerHolder.includeValue ? new Data(packet.getKey()) : null, null));
} else {
listener.itemRemoved(new DataAwareItemEvent(packet.getName(), ItemEventType.REMOVED,
listenerHolder.includeValue ? new Data(packet.getKey()) : null, null));
}
}
}
}
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:17,代码来源:QueueItemListenerManager.java
示例2: add
import com.hazelcast.core.ItemEventType; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void add() throws InterruptedException {
MockEndpoint out = getMockEndpoint("mock:added");
out.expectedMessageCount(1);
final ItemEvent<String> event = new ItemEvent<String>("mm", ItemEventType.ADDED, "foo", null);
argument.getValue().itemAdded(event);
assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.ADDED);
}
示例3: remove
import com.hazelcast.core.ItemEventType; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void remove() throws InterruptedException {
MockEndpoint out = getMockEndpoint("mock:removed");
out.expectedMessageCount(1);
final ItemEvent<String> event = new ItemEvent<String>("mm", ItemEventType.REMOVED, "foo", null);
argument.getValue().itemRemoved(event);
assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.REMOVED);
}
示例4: add
import com.hazelcast.core.ItemEventType; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void add() throws InterruptedException {
MockEndpoint out = getMockEndpoint("mock:added");
out.expectedMessageCount(1);
final ItemEvent<String> event = new ItemEvent<String>("foo", ItemEventType.ADDED, "foo", null);
argument.getValue().itemAdded(event);
assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.ADDED);
}
示例5: remove
import com.hazelcast.core.ItemEventType; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void remove() throws InterruptedException {
MockEndpoint out = getMockEndpoint("mock:removed");
out.expectedMessageCount(1);
final ItemEvent<String> event = new ItemEvent<String>("foo", ItemEventType.REMOVED, "foo", null);
argument.getValue().itemRemoved(event);
assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.REMOVED);
}
示例6: notifyListeners
import com.hazelcast.core.ItemEventType; //导入依赖的package包/类
public void notifyListeners(Packet packet) {
List<ItemListener> list = queueItemListeners.get(packet.getName());
if (list != null) {
for (ItemListener<Object> listener : list) {
Boolean added = (Boolean) toObject(packet.getValue());
if (added) {
listener.itemAdded(new DataAwareItemEvent(packet.getName(), ItemEventType.ADDED, new Data(packet.getKey())));
} else {
listener.itemRemoved(new DataAwareItemEvent(packet.getName(), ItemEventType.ADDED, new Data(packet.getKey())));
}
}
}
}
示例7: DataAwareItemEvent
import com.hazelcast.core.ItemEventType; //导入依赖的package包/类
public DataAwareItemEvent(String name, ItemEventType itemEventType, Data itemData) {
super(name, itemEventType, null);
this.itemData = itemData;
}
示例8: DataAwareItemEvent
import com.hazelcast.core.ItemEventType; //导入依赖的package包/类
public DataAwareItemEvent(String name, ItemEventType itemEventType, Data itemData, Member member) {
super(name, itemEventType, null, member);
this.itemData = itemData;
}
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:5,代码来源:DataAwareItemEvent.java