Skip to content

Commit

Permalink
feat(api)!: Remove defaultStorageKey method in WithSharedData int…
Browse files Browse the repository at this point in the history
…erface

BREAKING-CHANGE: Remove `defaultStorageKey` method in `WithSharedData` interface.

Co-authored-by: pklaschka <contact@pabloklaschka.de>
  • Loading branch information
fussel178 and pklaschka committed Dec 22, 2022
1 parent a661e02 commit b6c5e59
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import io.vertx.core.shareddata.LocalMap;

/**
* Allows {@link Verticle} instances to get simplified access to Vert.x shared data
* Allows {@link Verticle} instances to get simplified access to Vert.x shared data.
*
* <h2>Usage</h2>
* <pre>
Expand Down Expand Up @@ -52,7 +52,7 @@ default <K, V> Future<AsyncMap<K, V>> remoteMap(String storageSpace) {
* @return the default local map for this specific verticle
*/
default <K, V> LocalMap<K, V> defaultLocalMap() {
return localMap(defaultStorageKey());
return localMap("@@__PRIVATE/" + getClass().getName());
}

/**
Expand All @@ -62,15 +62,6 @@ default <K, V> LocalMap<K, V> defaultLocalMap() {
* @return the default remote map for this specific verticle
*/
default <K, V> Future<AsyncMap<K, V>> defaultRemoteMap() {
return remoteMap(defaultStorageKey());
}

/**
* Return the default storage key for this specific verticle
* used for the {@link #defaultLocalMap()} and {@link #defaultRemoteMap()} verticle storage spaces.
* @return the default storage key for this specific verticle
*/
default String defaultStorageKey() {
return getClass().getName();
return remoteMap("@@__PRIVATE/" + getClass().getName());
}
}

0 comments on commit b6c5e59

Please sign in to comment.