Interface WithSharedData
- All Superinterfaces:
io.vertx.core.Verticle
- All Known Implementing Classes:
RandomPositionPublisher
,TestVerticle
public interface WithSharedData
extends io.vertx.core.Verticle
Allows
Verticle
instances to get simplified access to Vert.x shared data
Usage
public class MyVerticle extends TelestionVerticle implements WithSharedData {
@Override
public void startVerticle() {
localMap("abc").put("test", "123");
}
}
-
Method Summary
Modifier and TypeMethodDescriptiondefault <K, V> io.vertx.core.shareddata.LocalMap<K,V>
Return the default local map for this specific verticle.default <K, V> io.vertx.core.Future<io.vertx.core.shareddata.AsyncMap<K,V>>
Return the default remote map for this specific verticle.default String
Return the default storage key for this specific verticle used for thedefaultLocalMap()
anddefaultRemoteMap()
verticle storage spaces.default <K, V> io.vertx.core.shareddata.LocalMap<K,V>
Return a local map from the specified storage space.default <K, V> io.vertx.core.Future<io.vertx.core.shareddata.AsyncMap<K,V>>
Return a remote map from the specified storage space.Methods inherited from interface io.vertx.core.Verticle
getVertx, init, start, stop
-
Method Details
-
localMap
Return a local map from the specified storage space.- Type Parameters:
K
- the type of the keyV
- the type of the value- Parameters:
storageSpace
- the storage space of the local map- Returns:
- the local map
-
remoteMap
default <K, V> io.vertx.core.Future<io.vertx.core.shareddata.AsyncMap<K,V>> remoteMap(String storageSpace)Return a remote map from the specified storage space.- Type Parameters:
K
- the type of the keyV
- the type of the value- Parameters:
storageSpace
- the storage space of the remote map- Returns:
- a future which resolves with the remote map
-
defaultLocalMap
default <K, V> io.vertx.core.shareddata.LocalMap<K,V> defaultLocalMap()Return the default local map for this specific verticle.- Type Parameters:
K
- the type of the keyV
- the type of the value- Returns:
- the default local map for this specific verticle
-
defaultRemoteMap
default <K, V> io.vertx.core.Future<io.vertx.core.shareddata.AsyncMap<K,V>> defaultRemoteMap()Return the default remote map for this specific verticle.- Type Parameters:
K
- the type of the keyV
- the type of the value- Returns:
- the default remote map for this specific verticle
-
defaultStorageKey
Return the default storage key for this specific verticle used for thedefaultLocalMap()
anddefaultRemoteMap()
verticle storage spaces.- Returns:
- the default storage key for this specific verticle
-