protected String addPartitionLostListenerInternal(MapPartitionLostListener listener) { return mapServiceContext.addPartitionLostListener(listener, name); }
protected String addPartitionLostListenerInternal(MapPartitionLostListener listener) { return mapServiceContext.addPartitionLostListener(listener, name); }
@Override protected Object call() { final MapService mapService = getService(MapService.SERVICE_NAME); final MapPartitionLostListener listener = new MapPartitionLostListener() { @Override public void partitionLost(MapPartitionLostEvent event) { if (endpoint.isAlive()) { ClientMessage eventMessage = MapAddPartitionLostListenerCodec.encodeMapPartitionLostEvent(event.getPartitionId(), event.getMember().getUuid()); sendClientMessage(null, eventMessage); } } }; MapServiceContext mapServiceContext = mapService.getMapServiceContext(); String registrationId; if (parameters.localOnly) { registrationId = mapServiceContext.addLocalPartitionLostListener(listener, parameters.name); } else { registrationId = mapServiceContext.addPartitionLostListener(listener, parameters.name); } endpoint.addListenerDestroyAction(MapService.SERVICE_NAME, parameters.name, registrationId); return registrationId; }
@Override protected Object call() { final MapService mapService = getService(MapService.SERVICE_NAME); final MapPartitionLostListener listener = new MapPartitionLostListener() { @Override public void partitionLost(MapPartitionLostEvent event) { if (endpoint.isAlive()) { ClientMessage eventMessage = MapAddPartitionLostListenerCodec.encodeMapPartitionLostEvent(event.getPartitionId(), event.getMember().getUuid()); sendClientMessage(null, eventMessage); } } }; MapServiceContext mapServiceContext = mapService.getMapServiceContext(); String registrationId; if (parameters.localOnly) { registrationId = mapServiceContext.addLocalPartitionLostListener(listener, parameters.name); } else { registrationId = mapServiceContext.addPartitionLostListener(listener, parameters.name); } endpoint.addListenerDestroyAction(MapService.SERVICE_NAME, parameters.name, registrationId); return registrationId; }