本文整理汇总了Java中com.tangosol.util.MapEvent.getNewValue方法的典型用法代码示例。如果您正苦于以下问题:Java MapEvent.getNewValue方法的具体用法?Java MapEvent.getNewValue怎么用?Java MapEvent.getNewValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tangosol.util.MapEvent
的用法示例。
在下文中一共展示了MapEvent.getNewValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: entryDeleted
import com.tangosol.util.MapEvent; //导入方法依赖的package包/类
public void entryDeleted(MapEvent mapEvent) {
if (mapEvent.getNewValue() == null && ((Collection)mapEvent.getOldValue()).isEmpty()) {
// Nothing to remove
return;
}
byte[] nodeID = getNodeID(mapEvent, true);
if (!XMPPServer.getInstance().getNodeID().equals(nodeID)) {
String sender = mapEvent.getKey().toString();
nodePresences.get(NodeID.getInstance(nodeID)).remove(sender);
}
}
示例2: getNodeID
import com.tangosol.util.MapEvent; //导入方法依赖的package包/类
byte[] getNodeID(MapEvent mapEvent, boolean removal) {
Object value = removal ? mapEvent.getOldValue() : mapEvent.getNewValue();
Collection<DirectedPresence> directedPresences = (Collection<DirectedPresence>) value;
if (directedPresences.isEmpty()) {
Log.warn("ClusteringListener - Found empty directed presences for sender: " + mapEvent.getKey());
return null;
}
return directedPresences.iterator().next().getNodeID();
}
示例3: getHandlers
import com.tangosol.util.MapEvent; //导入方法依赖的package包/类
Collection<JID> getHandlers(MapEvent mapEvent) {
Object value = mapEvent.getNewValue();
Collection<JID> answer = new ArrayList<JID>();
for (DirectedPresence directedPresence : (Collection<DirectedPresence>)value) {
answer.add(directedPresence.getHandler());
}
return answer;
}
示例4: getReceivers
import com.tangosol.util.MapEvent; //导入方法依赖的package包/类
Set<String> getReceivers(MapEvent mapEvent, JID handler) {
Object value = mapEvent.getNewValue();
for (DirectedPresence directedPresence : (Collection<DirectedPresence>)value) {
if (directedPresence.getHandler().equals(handler)) {
return directedPresence.getReceivers();
}
}
return Collections.emptySet();
}
示例5: entryInserted
import com.tangosol.util.MapEvent; //导入方法依赖的package包/类
public void entryInserted(MapEvent mapEvent) {
Object newValue = mapEvent.getNewValue();
if (newValue != null) {
for (NodeID nodeID : (Set<NodeID>) newValue) {
//ignore items which this node has added
if (!XMPPServer.getInstance().getNodeID().equals(nodeID)) {
Set<String> sessionJIDS = lookupJIDList(nodeID, componentsCache.getName());
sessionJIDS.add(mapEvent.getKey().toString());
}
}
}
}