Crash when someone tries to overwrite existing grid cache implementations.
This commit is contained in:
@@ -40,7 +40,7 @@ public final class GridCacheRegistry implements IGridCacheRegistry {
|
|||||||
@Nonnull IGridCacheFactory<T> factory) {
|
@Nonnull IGridCacheFactory<T> factory) {
|
||||||
|
|
||||||
if (registry.stream().anyMatch(r -> r.cacheClass.equals(iface))) {
|
if (registry.stream().anyMatch(r -> r.cacheClass.equals(iface))) {
|
||||||
AELog.debug("Overriding grid cache factory for cache type %s", iface);
|
throw new IllegalArgumentException("Implementation for grid cache "+ iface + " is already registered!");
|
||||||
}
|
}
|
||||||
|
|
||||||
registry.add(new GridCacheRegistration<>(iface, factory));
|
registry.add(new GridCacheRegistration<>(iface, factory));
|
||||||
|
|||||||
Reference in New Issue
Block a user