org.jgroups.blocks.mux

## Class MuxRequestCorrelator

- java.lang.Object
- - org.jgroups.blocks.RequestCorrelator
  - - org.jgroups.blocks.mux.MuxRequestCorrelator

    public class MuxRequestCorrelator
    extends RequestCorrelator

A request correlator that adds a mux header to incoming and outgoing messages.

Author:
  Bela Ban, Paul Ferraro, Brian Stansberry

### Nested Class Summary

### Nested classes/interfaces inherited from class org.jgroups.blocks.RequestCorrelator

`RequestCorrelator.Header, RequestCorrelator.MultiDestinationHeader`

### Field Summary

Fields
`protected static short` `MUX_ID`

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

`id, local_addr, log, marshaller, request_handler, requests, started, transport`

### Constructor Summary

Constructors
Constructor and Description
`MuxRequestCorrelator(short id, java.lang.Object transport, RequestHandler handler, Address localAddr)`

### Method Summary

Methods
`protected void` `prepareResponse(Message rsp)`
`void` `sendRequest(long requestId, java.util.Collection<Address> dest_mbrs, Message msg, RspCollector coll, RequestOptions options)` Sends a request to a group.
`void` `sendUnicastRequest(long id, Address target, Message msg, RspCollector coll)` Sends a request to a single destination

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

`done, getLocalAddress, getMarshaller, handleRequest, receive, receiveMessage, receiveSuspect, receiveView, registerProbeHandler, sendRequest, sendRequest, setConcurrentProcessing, setDeadlockDetection, setLocalAddress, setMarshaller, setRequestHandler, start, stop, unregisterProbeHandler`

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

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

### Field Detail

#### MUX_ID

    protected static final short MUX_ID

### Constructor Detail

#### MuxRequestCorrelator

    public MuxRequestCorrelator(short id,
                        java.lang.Object transport,
                        RequestHandler handler,
                        Address localAddr)

### Method Detail

#### sendRequest

    public void sendRequest(long requestId,
                   java.util.Collection<Address> dest_mbrs,
                   Message msg,
                   RspCollector coll,
                   RequestOptions options)
                     throws java.lang.Exception

Description copied from class: `RequestCorrelator`
Sends a request to a group. If no response collector is given, no responses are expected (making the call asynchronous)

Overrides:
  `sendRequest` in class `RequestCorrelator`
Parameters:
  `requestId` - The request ID. Must be unique for this JVM (e.g. current time in millisecs)
  `dest_mbrs` - The list of members who should receive the call. Usually a group RPC is sent via multicast, but a receiver drops the request if its own address is not in this list. Will not be used if it is null.
  `msg` - The request to be sent. The body of the message carries the request data
  `coll` - A response collector (usually the object that invokes this method). Its methods `receiveResponse()` and `suspect()` will be invoked when a message has been received or a member is suspected, respectively.
Throws:
  `java.lang.Exception`

#### sendUnicastRequest

    public void sendUnicastRequest(long id,
                          Address target,
                          Message msg,
                          RspCollector coll)
                            throws java.lang.Exception

Description copied from class: `RequestCorrelator`
Sends a request to a single destination

Overrides:
  `sendUnicastRequest` in class `RequestCorrelator`
Throws:
  `java.lang.Exception`

#### prepareResponse

    protected void prepareResponse(Message rsp)

Overrides:
  `prepareResponse` in class `RequestCorrelator`