org.jgroups.blocks.mux

## Class MuxMessageDispatcher

- java.lang.Object
- - org.jgroups.blocks.MessageDispatcher
  - - org.jgroups.blocks.mux.MuxMessageDispatcher

All Implemented Interfaces:
  RequestHandler

    public class MuxMessageDispatcher
    extends MessageDispatcher

A multiplexed message dispatcher. When used in conjunction with a MuxUpHandler, allows multiple dispatchers to use the same channel.
Usage:
`Channel c = new JChannel(...);
c.setUpHandler(new MuxUpHandler());
MessageDispatcher d1 = new MuxMessageDispatcher((short) 1, c, ...);
MessageDispatcher d2 = new MuxMessageDispatcher((short) 2, c, ...);
c.connect(...);
`

Author:
  Paul Ferraro

### Field Summary

### Fields inherited from class org.jgroups.blocks.MessageDispatcher

`adapter, channel, corr, handler, hardware_multicast_supported, id, local_addr, log, members, membership_listener, msg_listener, prot_adapter, req_handler, transport_adapter`

### Constructor Summary

Constructors
Constructor and Description
`MuxMessageDispatcher(short scopeId)`
`MuxMessageDispatcher(short scopeId, Channel channel, MessageListener messageListener, MembershipListener membershipListener, RequestHandler handler)`

### Method Summary

Methods
`protected GroupRequest` `cast(java.util.Collection<Address> dests, Message msg, RequestOptions options, boolean blockForResults)`
`protected RequestCorrelator` `createRequestCorrelator(java.lang.Object transport, RequestHandler handler, Address localAddr)`
`void` `start()`
`void` `stop()`

### Methods inherited from class org.jgroups.blocks.MessageDispatcher

`castMessage, castMessage, castMessage, castMessage, castMessageWithFuture, castMessageWithFuture, correlatorStarted, done, getChannel, getConcurrentProcessing, getDeadlockDetection, getMembers, getMessageListener, getProtocolAdapter, handle, installUpHandler, send, sendMessage, sendMessage, sendMessageWithFuture, sendMessageWithFuture, setChannel, setConcurrentProcessing, setDeadlockDetection, setMembershipListener, setMessageListener, setRequestHandler`

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

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

### Constructor Detail

#### MuxMessageDispatcher

    public MuxMessageDispatcher(short scopeId)

#### MuxMessageDispatcher

    public MuxMessageDispatcher(short scopeId,
                        Channel channel,
                        MessageListener messageListener,
                        MembershipListener membershipListener,
                        RequestHandler handler)

### Method Detail

#### createRequestCorrelator

    protected RequestCorrelator createRequestCorrelator(java.lang.Object transport,
                                            RequestHandler handler,
                                            Address localAddr)

Overrides:
  `createRequestCorrelator` in class `MessageDispatcher`

#### start

    public void start()

Overrides:
  `start` in class `MessageDispatcher`

#### stop

    public void stop()

Overrides:
  `stop` in class `MessageDispatcher`

#### cast

    protected GroupRequest cast(java.util.Collection<Address> dests,
                    Message msg,
                    RequestOptions options,
                    boolean blockForResults)

Overrides:
  `cast` in class `MessageDispatcher`