All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.externals.jgroups.MessageDispatcherWrapper Maven / Gradle / Ivy

There is a newer version: 1.0.36
Show newest version
/**
 * EasyBeans
 * Copyright (C) 2008 Bull S.A.S.
 * Contact: [email protected]
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id: MessageDispatcherWrapper.java 2486 2008-02-20 18:10:03Z loris $
 * --------------------------------------------------------------------------
 */
package org.ow2.externals.jgroups;

import java.util.Vector;

import org.jgroups.Channel;
import org.jgroups.Message;
import org.jgroups.SuspectedException;
import org.jgroups.TimeoutException;
import org.jgroups.blocks.MessageDispatcher;
import org.jgroups.util.RspList;

/**
 * Wrap an instance of {@link MessageDispatcher}.
 * @author Loris Bouzonnet
 */
public class MessageDispatcherWrapper implements IMessageDispatcher {

    private final MessageDispatcher messageDispatcher;

    public MessageDispatcherWrapper(final MessageDispatcher messageDispatcher) {
        super();
        this.messageDispatcher = messageDispatcher;
    }

    public RspList castMessage(final Vector dests, final Message msg, final int mode, final long timeout) {
        return messageDispatcher.castMessage(dests, msg, mode, timeout);
    }

    public Object sendMessage(final Message msg, final int mode, final long timeout)
    throws TimeoutException, SuspectedException {
        return messageDispatcher.sendMessage(msg, mode, timeout);
    }

    public Channel getChannel() {
        return messageDispatcher.getChannel();
    }

    public void stop() {
        messageDispatcher.stop();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy