Package net.engio.mbassy.dispatch

Source Code of net.engio.mbassy.dispatch.EnvelopedMessageDispatcher

package net.engio.mbassy.dispatch;

import net.engio.mbassy.bus.MessagePublication;
import net.engio.mbassy.subscription.MessageEnvelope;

/**
* The enveloped dispatcher will wrap published messages in an envelope before
* passing them to their configured dispatcher.
* <p/>
* All enveloped message handlers will have this dispatcher in their chain
*
* @author bennidi
*         Date: 12/12/12
*/
public class EnvelopedMessageDispatcher extends DelegatingMessageDispatcher {


    public EnvelopedMessageDispatcher(IMessageDispatcher dispatcher) {
        super(dispatcher);
    }

    @Override
    public void dispatch(MessagePublication publication, Object message, Iterable listeners){
        getDelegate().dispatch(publication, new MessageEnvelope(message), listeners);
    }
}
TOP

Related Classes of net.engio.mbassy.dispatch.EnvelopedMessageDispatcher

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.