cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/OortList.java
/**
     * <p>Adds the given {@code elements} to the local entity list,
     * and then broadcasts the addition to all nodes in the cluster.</p>
     * <p>Calling this method triggers notifications {@link ElementListener}s,
     * both on this node and on remote nodes.</p>
     * <p>The element is guaranteed to be added not when this method returns,
     * but when the {@link Result} parameter is notified.</p>
     *
     * @param callback the callback invoked with whether at least one of the elements was added to the local entity list
     *                 or {@code null} if there is no interest in knowing whether elements were added
     * @param elements the elements to add
     */
Adds the given  elements to the local entity list,
and then broadcasts the addition to all nodes in the cluster.
Calling this method triggers notifications  ElementListeners,
both on this node and on remote nodes.
The element is guaranteed to be added not when this method returns,
but when the  Result parameter is notified.

@param callback the callback invoked with whether at least one of the elements was added to the local entity list
or  null if there is no interest in knowing whether elements were added
@param elements the elements to add
Adds the given elements to the local entity list and then broadcasts the addition to all nodes in the cluster . Calling this method triggers notifications ElementListeners both on this node and on remote nodes . The element is guaranteed to be added not when this method returns but when the Result parameter is notified . @param callback the callback invoked with whether at least one of the elements was added to the local entity list or null if there is no interest in knowing whether elements were added @param elements the elements to add
public void addAndShare(Result<Boolean> callback, E... elements) {
        Data<Boolean> data = new Data<>(6, callback);
        data.put(Info.OORT_URL_FIELD, getOort().getURL());
        data.put(Info.NAME_FIELD, getName());
        data.put(Info.OBJECT_FIELD, elements);
        data.put(Info.TYPE_FIELD, TYPE_FIELD_ELEMENT_VALUE);
        data.put(Info.ACTION_FIELD, ACTION_FIELD_ADD_VALUE);
        if (logger.isDebugEnabled()) {
            logger.debug("Sharing list add {}", data);
        }
        BayeuxServer bayeuxServer = getOort().getBayeuxServer();
        bayeuxServer.getChannel(getChannelName()).publish(getLocalSession(), data, Promise.noop());
    }
public void addAndShare ( Result < Boolean > callback , E ... elements ) { Data < Boolean > data = new Data < > ( 6 , callback ) ; data . put ( Info . OORT_URL_FIELD , getOort ( ) . getURL ( ) ) ; data . put ( Info . NAME_FIELD , getName ( ) ) ; data . put ( Info . OBJECT_FIELD , elements ) ; data . put ( Info . TYPE_FIELD , TYPE_FIELD_ELEMENT_VALUE ) ; data . put ( Info . ACTION_FIELD , ACTION_FIELD_ADD_VALUE ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Sharing list add {}" , data ) ; } BayeuxServer bayeuxServer = getOort ( ) . getBayeuxServer ( ) ; bayeuxServer . getChannel ( getChannelName ( ) ) . publish ( getLocalSession ( ) , data , Promise . noop ( ) ) ; }
<p>Adds the given {@code elements} to the local entity list,
 and then broadcasts the addition to all nodes in the cluster.</p>
 <p>Calling this method triggers notifications {@link ElementListener}s,
 both on this node and on remote nodes.</p>
 <p>The element is guaranteed to be added not when this method returns,
 but when the {@link Result} parameter is notified.</p>
<p > Adds the given { @code elements } to the local entity list and then broadcasts the addition to all nodes in the cluster . < / p > <p > Calling this method triggers notifications { @link ElementListener } s both on this node and on remote nodes . < / p > <p > The element is guaranteed to be added not when this method returns but when the { @link Result } parameter is notified . < / p >