本文整理汇总了Java中com.hazelcast.core.EntryEvent.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java EntryEvent.getValue方法的具体用法?Java EntryEvent.getValue怎么用?Java EntryEvent.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.core.EntryEvent
的用法示例。
在下文中一共展示了EntryEvent.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: theEntryAdded
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
private void theEntryAdded(EntryEvent<String, DeploymentManagement> entryEvent) {
DeploymentManagement deploymentManagement = entryEvent.getValue();
Validate.notNull(deploymentManagement, "deploymentManagement must not be null");
if (!deploymentManagement.getDeploymentDescription().
getLocationInCluster().equals(gatewayRulesService.fetchGatewayRules().getLocation())) {
if (LOG.isDebugEnabled()) LOG.debug("BeyondJManagementService ignoring incoming deploymentManagement " +
"since it references a service not in this instance. Current server is {} and target server is {}",
gatewayRulesService.fetchGatewayRules().getLocation(), deploymentManagement.getDeploymentDescription().
getLocationInCluster());
return;
//do nothing
}
try {
String supervisorId = deploymentManagement.getDeploymentDescription().getSupervisorId();
BeyondJRemotingService remotingService = new BeyondJRemotingService();
ActorRefService actorRefService = remotingService.getRemoteServiceProxy(ActorRefService.class, ACTOR_REF_SERVICE);
ActorRef deploymentSupervisor = actorRefService.getActorRefs().get(supervisorId);
deploymentSupervisor.tell(deploymentManagement, null);
} catch (Exception e) {
LOG.error("Error calling actor", e);
}
}
示例2: entryAdded
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryAdded(EntryEvent<String, BpmEvent> event) {
BpmEvent bpmEvent = event.getValue();
logger.log(Level.INFO, "BpmEventListener.entryAdded executor {0}", new Object[]{bpmEvent.getExecutor()});
try {
BpmEvent.EXECUTOR executor = bpmEvent.getExecutor();
switch (executor) {
case ACTOR_RESOLVER:
InternalAPI.get().executeActorResolver(bpmEvent.getCaseId(), bpmEvent.getTaskId());
break;
case CONNECTOR:
InternalAPI.get().executeConnectorOut(bpmEvent.getCaseId(), bpmEvent.getTaskId());
break;
case JOIN:
InternalAPI.get().executeJoin(bpmEvent.getCaseId(), bpmEvent.getTaskId(), bpmEvent.getJoinId());
break;
case TRANSITION:
InternalAPI.get().executeTransition(bpmEvent.getCaseId(), bpmEvent.getTaskId());
break;
}
HazelcastServer.removeBpmEvent(bpmEvent);
} catch (Exception ex) {
logger.log(Level.SEVERE, ex.getMessage(), ex);
}
}
示例3: entryUpdated
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryUpdated(EntryEvent<DeviceId, RoleValue> event) {
// compare old and current RoleValues. If master is different,
// emit MASTER_CHANGED. else, emit BACKUPS_CHANGED.
RoleValue oldValue = event.getOldValue();
RoleValue newValue = event.getValue();
// There will be no oldValue at the very first instance of an EntryEvent.
// Technically, the progression is: null event -> null master -> some master;
// We say a null master and a null oldValue are the same condition.
NodeId oldMaster = null;
if (oldValue != null) {
oldMaster = oldValue.get(MASTER);
}
NodeId newMaster = newValue.get(MASTER);
if (!Objects.equal(oldMaster, newMaster)) {
notifyDelegate(new MastershipEvent(
MASTER_CHANGED, event.getKey(), event.getValue().roleInfo()));
} else {
notifyDelegate(new MastershipEvent(
BACKUPS_CHANGED, event.getKey(), event.getValue().roleInfo()));
}
}
示例4: entryAdded
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryAdded(EntryEvent<String, DeploymentDescription> entryEvent) {
if (entryEvent == null || entryEvent.getValue() == null) {
throw new RuntimeException("Received a null message. Something is wrong");
}
for (DestinationDiscoveryCallback callback : callBacks) {
System.out.println("CALLBACK IS " + callback);
callback.destinationAdded(entryEvent);
}
}
示例5: entryEvicted
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryEvicted(EntryEvent<String, DeploymentDescription> entryEvent) {
if (entryEvent == null || entryEvent.getValue() == null) {
throw new RuntimeException("Received a null message. Something is wrong");
}
for (DestinationDiscoveryCallback callback : callBacks) {
callback.destinationEntryEvicted(entryEvent);
}
}
示例6: entryRemoved
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryRemoved(EntryEvent<String, DeploymentDescription> entryEvent) {
if (entryEvent == null || entryEvent.getValue() == null) {
throw new RuntimeException("Received a null message. Something is wrong");
}
for (DestinationDiscoveryCallback callback : callBacks) {
callback.destinationEntryRemoved(entryEvent);
}
}
示例7: entryUpdated
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryUpdated(EntryEvent<String, DeploymentDescription> entryEvent) {
if (entryEvent == null || entryEvent.getValue() == null) {
throw new RuntimeException("Received a null message. Something is wrong");
}
for (DestinationDiscoveryCallback callback : callBacks) {
callback.destinationUpdated(entryEvent);
}
}
示例8: entryAdded
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryAdded(Object object) {
EntryEvent<String, DeploymentManagement> entryEvent =
(EntryEvent<String, DeploymentManagement>) object;
DeploymentManagement deploymentManagement = entryEvent.getValue();
Validate.notNull(deploymentManagement, "deploymentManagement must not be null");
if (!deploymentManagement.getDeploymentDescription().
getLocationInCluster().equals(gatewayRulesService.fetchGatewayRules().getLocation())) {
if (LOG.isDebugEnabled()) LOG.debug("BeyondJManagementService ignoring incoming deploymentManagement " +
"since it references a service not in this instance. Current server is {} and target server is {}",
gatewayRulesService.fetchGatewayRules().getLocation(), deploymentManagement.getDeploymentDescription().
getLocationInCluster());
return;
//do nothing
}
try {
String supervisorId = deploymentManagement.getDeploymentDescription().getSupervisorId();
BeyondJRemotingService remotingService = new BeyondJRemotingService();
ActorRefService actorRefService = remotingService.getRemoteServiceProxy(ActorRefService.class, ACTOR_REF_SERVICE);
ActorRef deploymentSupervisor = actorRefService.getActorRefs().get(supervisorId);
deploymentSupervisor.tell(deploymentManagement, null);
} catch (Exception e) {
LOG.error("Error calling actor", e);
}
}
示例9: entryUpdated
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryUpdated(EntryEvent<String, T> event) {
T entity = event.getValue();
T oldEntity = event.getOldValue();
LOG.trace("Modified entity {} in map {}", entity, event.getName());
listener.onEvent(entity, oldEntity, StorageEvent.MODIFIED);
}
示例10: entryUpdated
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryUpdated(EntryEvent<String, Path> event) {
Path path = event.getValue();
cachePath.put(path.getPathId(), path);
Set<Path> paths = cacheType.get(path.getRoot());
if (paths == null) {
paths = new HashSet<>();
Set<Path> paths2 = cacheType.putIfAbsent(path.getRoot(), paths);
if (paths2 != null) {
paths = paths2;
}
}
paths.add(path);
}
示例11: entryRemoved
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryRemoved(EntryEvent<String, Path> event) {
Path path = event.getValue();
cachePath.remove(path.getPathId());
Set<Path> paths = cacheType.get(path.getRoot());
if (paths != null) {
paths.remove(path);
}
}
示例12: entryAdded
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
@Override
public void entryAdded(EntryEvent<String, Path> event) {
Path path = event.getValue();
cachePath.putIfAbsent(path.getPathId(), path);
Set<Path> paths = cacheType.get(path.getRoot());
if (paths == null) {
paths = new HashSet<>();
Set<Path> paths2 = cacheType.putIfAbsent(path.getRoot(), paths);
if (paths2 != null) {
paths = paths2;
}
}
paths.add(path);
}
示例13: entryRemoved
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
public void entryRemoved(EntryEvent event) {
if (event == null || (event.getValue() == null && event.getOldValue() == null)) {
// Nothing to remove
return;
}
byte[] nodeID = StringUtils.getBytes(event.getMember().getUuid());
if (!XMPPServer.getInstance().getNodeID().equals(nodeID)) {
String sender = event.getKey().toString();
nodePresences.get(NodeID.getInstance(nodeID)).remove(sender);
}
}
示例14: getHandlers
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
Collection<JID> getHandlers(EntryEvent event) {
Object value = event.getValue();
Collection<JID> answer = new ArrayList<JID>();
if (value != null) {
for (DirectedPresence directedPresence : (Collection<DirectedPresence>)value) {
answer.add(directedPresence.getHandler());
}
}
return answer;
}
示例15: getReceivers
import com.hazelcast.core.EntryEvent; //导入方法依赖的package包/类
Set<String> getReceivers(EntryEvent event, JID handler) {
Object value = event.getValue();
for (DirectedPresence directedPresence : (Collection<DirectedPresence>)value) {
if (directedPresence.getHandler().equals(handler)) {
return directedPresence.getReceivers();
}
}
return Collections.emptySet();
}