open a protected method for subclass extending replicated map

This commit is contained in:
yuhang.zhao
2016-04-29 11:25:56 +08:00
parent 0b4aa55464
commit dc10b34ad5
@@ -1378,13 +1378,22 @@ public class ChronicleMapBuilder<K, V> implements Cloneable,
} else {
replication = channel.hub();
}
return new ReplicatedChronicleMap<K, Object, MetaBytesInterop<K, Object>,
V, Object, MetaBytesInterop<V, Object>>(this, replication);
return newReplicatedMap(replication);
} else {
return new VanillaChronicleMap<K, Object, MetaBytesInterop<K, Object>,
V, Object, MetaBytesInterop<V, Object>>(this);
}
}
/**
* create the replicated map, as subclass can self implements of map.
* @param replication
* @return
*/
protected ReplicatedChronicleMap<K, ?, ?, V, ?, ?> newReplicatedMap(AbstractReplication replication){
return new ReplicatedChronicleMap<K, Object, MetaBytesInterop<K, Object>,
V, Object, MetaBytesInterop<V, Object>>(this, replication);
}
void preMapConstruction(boolean replicated) {
keyBuilder.objectSerializer(acquireObjectSerializer(JDKObjectSerializer.INSTANCE));