implements ReplicatedMessageListener {
public void onMessage(IdentifiedDataSerializable message) {
if (message instanceof ReplicationMessage) {
ReplicationMessage replicationMessage = (ReplicationMessage) message;
ReplicatedRecordStore replicatedRecordStorage = replicatedStorages.get(replicationMessage.getName());
ReplicationPublisher replicationPublisher = replicatedRecordStorage.getReplicationPublisher();
if (replicatedRecordStorage instanceof AbstractReplicatedRecordStore) {
replicationPublisher.queueUpdateMessage(replicationMessage);
}
} else if (message instanceof MultiReplicationMessage) {
MultiReplicationMessage multiReplicationMessage = (MultiReplicationMessage) message;
ReplicatedRecordStore replicatedRecordStorage = replicatedStorages.get(multiReplicationMessage.getName());
ReplicationPublisher replicationPublisher = replicatedRecordStorage.getReplicationPublisher();
if (replicatedRecordStorage instanceof AbstractReplicatedRecordStore) {
replicationPublisher.queueUpdateMessages(multiReplicationMessage);
}
}
}