public class SharedDataImpl extends Object implements SharedData
Constructor and Description |
---|
SharedDataImpl(VertxInternal vertx,
ClusterManager clusterManager) |
Modifier and Type | Method and Description |
---|---|
<K,V> void |
getClusterWideMap(String name,
Handler<AsyncResult<AsyncMap<K,V>>> resultHandler)
Get the cluster wide map with the specified name.
|
void |
getCounter(String name,
Handler<AsyncResult<Counter>> resultHandler)
Get a cluster wide counter.
|
<K,V> LocalMap<K,V> |
getLocalMap(String name)
Return a
Map with the specific name . |
void |
getLock(String name,
Handler<AsyncResult<Lock>> resultHandler)
Get a cluster wide lock with the specified name.
|
void |
getLockWithTimeout(String name,
long timeout,
Handler<AsyncResult<Lock>> resultHandler)
Like
SharedData.getLock(String, Handler) but specifying a timeout. |
public SharedDataImpl(VertxInternal vertx, ClusterManager clusterManager)
public <K,V> void getClusterWideMap(String name, Handler<AsyncResult<AsyncMap<K,V>>> resultHandler)
SharedData
getClusterWideMap
in interface SharedData
name
- the name of the mapresultHandler
- the map will be returned asynchronously in this handlerpublic void getLock(String name, Handler<AsyncResult<Lock>> resultHandler)
SharedData
getLock
in interface SharedData
name
- the name of the lockresultHandler
- the handlerpublic void getLockWithTimeout(String name, long timeout, Handler<AsyncResult<Lock>> resultHandler)
SharedData
SharedData.getLock(String, Handler)
but specifying a timeout. If the lock is not obtained within the timeout
a failure will be sent to the handlergetLockWithTimeout
in interface SharedData
name
- the name of the locktimeout
- the timeout in msresultHandler
- the handlerpublic void getCounter(String name, Handler<AsyncResult<Counter>> resultHandler)
SharedData
getCounter
in interface SharedData
name
- the name of the counter.resultHandler
- the handlerpublic <K,V> LocalMap<K,V> getLocalMap(String name)
Map
with the specific name
. All invocations of this method with the same value of name
are guaranteed to return the same Map
instance. getLocalMap
in interface SharedData
name
- the name of the mapCopyright © 2015. All Rights Reserved.