org.vertx.java.core.shareddata

## Class SharedData

- java.lang.Object
- - org.vertx.java.core.shareddata.SharedData

    public class SharedData
    extends java.lang.Object

Sometimes it is desirable to share immutable data between different event loops, for example to implement a cache of data.

This class allows instances of shared data structures to be looked up and used from different event loops.

The data structures themselves will only allow certain data types to be stored into them. This shields you from worrying about any thread safety issues might occur if mutable objects were shared between event loops.

The following types can be stored in a shareddata data structure:

       String
       Integer
       Long
       Double
       Float
       Short
       Byte
       Character
       byte[] - this will be automatically copied, and the copy will be stored in the structure.
       Buffer - this will be automatically copied, and the copy will be stored in the
       structure.

### Constructor Summary

Constructors
Constructor and Description
`SharedData()`

### Method Summary

Methods
`<K,V> java.util.concurrent.ConcurrentMap<K,V>` `getMap(java.lang.String name)` Return a `Map` with the specific `name`.
`<E> java.util.Set<E>` `getSet(java.lang.String name)` Return a `Set` with the specific `name`.
`boolean` `removeMap(java.lang.Object name)` Remove the `Map` with the specifiec `name`.
`boolean` `removeSet(java.lang.Object name)` Remove the `Set` with the specifiec `name`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SharedData

    public SharedData()

### Method Detail

#### getMap

    public <K,V> java.util.concurrent.ConcurrentMap<K,V> getMap(java.lang.String name)

Return a `Map` with the specific `name`. All invocations of this method with the same value of `name` are guaranteed to return the same `Map` instance.

#### getSet

    public <E> java.util.Set<E> getSet(java.lang.String name)

Return a `Set` with the specific `name`. All invocations of this method with the same value of `name` are guaranteed to return the same `Set` instance.

#### removeMap

    public boolean removeMap(java.lang.Object name)

Remove the `Map` with the specifiec `name`.

#### removeSet

    public boolean removeSet(java.lang.Object name)

Remove the `Set` with the specifiec `name`.