this.includeValue = includeValue;
}
public Object call() throws Exception {
final ClientEndpoint endpoint = getEndpoint();
final MultiMapService service = getService();
EntryListener listener = new EntryAdapter() {
@Override
public void onEntryEvent(EntryEvent event) {
if (endpoint.live()) {
Data key = serializationService.toData(event.getKey());
Data value = serializationService.toData(event.getValue());
Data oldValue = serializationService.toData(event.getOldValue());
final EntryEventType type = event.getEventType();
final String uuid = event.getMember().getUuid();
PortableEntryEvent portableEntryEvent = new PortableEntryEvent(key, value, oldValue, type, uuid);
endpoint.sendEvent(portableEntryEvent, getCallId());
}
}
@Override
public void onMapEvent(MapEvent event) {
if (endpoint.live()) {
final EntryEventType type = event.getEventType();
final String uuid = event.getMember().getUuid();
PortableEntryEvent portableEntryEvent =
new PortableEntryEvent(type, uuid, event.getNumberOfEntriesAffected());
endpoint.sendEvent(portableEntryEvent, getCallId());
}
}
};
String registrationId = service.addListener(name, listener, key, includeValue, false);
endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME, name, registrationId);
return registrationId;
}