cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/OortMap.java
/**
     * <p>Updates a single entry of the local entity map with the given {@code key} and {@code value},
     * and broadcasts the operation to all nodes in the cluster.</p>
     * <p>Calling this method triggers notifications {@link EntryListener}s, both on this node and on remote nodes.</p>
     * <p>The entry is guaranteed to be put not when this method returns,
     * but when the {@link Result} parameter is notified.</p>
     *
     * @param key      the key to associate the value to
     * @param value    the value associated with the key
     * @param callback the callback invoked with the old value,
     *                 or {@code null} if there is no interest in the old value
     * @see #putIfAbsentAndShare(Object, Object, Result)
     * @see #removeAndShare(Object, Result)
     */
Updates a single entry of the local entity map with the given  key and  value,
and broadcasts the operation to all nodes in the cluster.
Calling this method triggers notifications  EntryListeners, both on this node and on remote nodes.
The entry is guaranteed to be put not when this method returns,
but when the  Result parameter is notified.


Updates a single entry of the local entity map with the given key and value and broadcasts the operation to all nodes in the cluster . Calling this method triggers notifications EntryListeners both on this node and on remote nodes . The entry is guaranteed to be put not when this method returns but when the Result parameter is notified .
public void putAndShare(K key, V value, Result<V> callback) {
        Map<String, Object> entry = new HashMap<>(2);
        entry.put(KEY_FIELD, key);
        entry.put(VALUE_FIELD, value);
        Data<V> data = new Data<>(6, callback);
        data.put(Info.OORT_URL_FIELD, getOort().getURL());
        data.put(Info.NAME_FIELD, getName());
        data.put(Info.OBJECT_FIELD, entry);
        data.put(Info.TYPE_FIELD, TYPE_FIELD_ENTRY_VALUE);
        data.put(Info.ACTION_FIELD, ACTION_FIELD_PUT_VALUE);
        if (logger.isDebugEnabled()) {
            logger.debug("Sharing map put {}", data);
        }
        BayeuxServer bayeuxServer = getOort().getBayeuxServer();
        bayeuxServer.getChannel(getChannelName()).publish(getLocalSession(), data, Promise.noop());
    }
public void putAndShare ( K key , V value , Result < V > callback ) { Map < String , Object > entry = new HashMap < > ( 2 ) ; entry . put ( KEY_FIELD , key ) ; entry . put ( VALUE_FIELD , value ) ; Data < V > data = new Data < > ( 6 , callback ) ; data . put ( Info . OORT_URL_FIELD , getOort ( ) . getURL ( ) ) ; data . put ( Info . NAME_FIELD , getName ( ) ) ; data . put ( Info . OBJECT_FIELD , entry ) ; data . put ( Info . TYPE_FIELD , TYPE_FIELD_ENTRY_VALUE ) ; data . put ( Info . ACTION_FIELD , ACTION_FIELD_PUT_VALUE ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Sharing map put {}" , data ) ; } BayeuxServer bayeuxServer = getOort ( ) . getBayeuxServer ( ) ; bayeuxServer . getChannel ( getChannelName ( ) ) . publish ( getLocalSession ( ) , data , Promise . noop ( ) ) ; }
<p>Updates a single entry of the local entity map with the given {@code key} and {@code value},
 and broadcasts the operation to all nodes in the cluster.</p>
 <p>Calling this method triggers notifications {@link EntryListener}s, both on this node and on remote nodes.</p>
 <p>The entry is guaranteed to be put not when this method returns,
 but when the {@link Result} parameter is notified.</p>
<p > Updates a single entry of the local entity map with the given { @code key } and { @code value } and broadcasts the operation to all nodes in the cluster . < / p > <p > Calling this method triggers notifications { @link EntryListener } s both on this node and on remote nodes . < / p > <p > The entry is guaranteed to be put not when this method returns but when the { @link Result } parameter is notified . < / p >