bftsmart.tom

## Class AsynchServiceProxy

- java.lang.Object
- - bftsmart.tom.TOMSender
  - - bftsmart.tom.ServiceProxy
    - - bftsmart.tom.AsynchServiceProxy

All Implemented Interfaces:
  bftsmart.communication.client.ReplyReceiver

    public class AsynchServiceProxy
    extends ServiceProxy

This class is an extension of 'ServiceProxy' that can waits for replies asynchronously.

### Field Summary

### Fields inherited from class bftsmart.tom.ServiceProxy

`canReceiveLock, canSendLock`

### Constructor Summary

Constructors
Constructor and Description
`AsynchServiceProxy(int processId)`
`AsynchServiceProxy(int processId, java.lang.String configHome)`
`AsynchServiceProxy(int processId, java.lang.String configHome, java.util.Comparator<byte[]> replyComparator, Extractor replyExtractor)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `cleanAsynchRequest(int requestId)`
`int` `invokeAsynchRequest(byte[] request, int[] targets, bftsmart.communication.client.ReplyListener replyListener, bftsmart.tom.core.messages.TOMMessageType reqType)`
`int` `invokeAsynchRequest(byte[] request, bftsmart.communication.client.ReplyListener replyListener, bftsmart.tom.core.messages.TOMMessageType reqType)`
`void` `replyReceived(bftsmart.tom.core.messages.TOMMessage reply)` This is the method invoked by the client side communication system.

### Methods inherited from class bftsmart.tom.ServiceProxy

`getInvokeTimeout, getInvokeUnorderedHashedTimeout, invoke, invokeOrdered, invokeUnordered, invokeUnorderedHashed, setInvokeTimeout, setInvokeUnorderedHashedTimeout`

### Methods inherited from class bftsmart.tom.TOMSender

`close, generateOperationId, generateRequestId, getCommunicationSystem, getProcessId, getSession, getViewManager, init, init, sendMessageToTargets, sendMessageToTargets, TOMulticast, TOMulticast, TOMulticast`

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

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

### Constructor Detail

#### AsynchServiceProxy

    public AsynchServiceProxy(int processId)

Parameters:
  `processId` - Replica id

#### AsynchServiceProxy

    public AsynchServiceProxy(int processId,
                              java.lang.String configHome)

Parameters:
  `processId` - Replica id
  `configHome` - Configuration folder

#### AsynchServiceProxy

    public AsynchServiceProxy(int processId,
                              java.lang.String configHome,
                              java.util.Comparator<byte[]> replyComparator,
                              Extractor replyExtractor)

### Method Detail

#### invokeAsynchRequest

    public int invokeAsynchRequest(byte[] request,
                                   bftsmart.communication.client.ReplyListener replyListener,
                                   bftsmart.tom.core.messages.TOMMessageType reqType)

Parameters:
  `request` -
  `replyListener` -
  `reqType` - Request type
Returns:

#### invokeAsynchRequest

    public int invokeAsynchRequest(byte[] request,
                                   int[] targets,
                                   bftsmart.communication.client.ReplyListener replyListener,
                                   bftsmart.tom.core.messages.TOMMessageType reqType)

Parameters:
  `request` -
  `targets` -
  `replyListener` -
  `reqType` - Request type
Returns:

#### cleanAsynchRequest

    public void cleanAsynchRequest(int requestId)

Parameters:
  `requestId` - Request

#### replyReceived

    public void replyReceived(bftsmart.tom.core.messages.TOMMessage reply)

Description copied from class: `ServiceProxy`
This is the method invoked by the client side communication system.

Specified by:
  `replyReceived` in interface `bftsmart.communication.client.ReplyReceiver`
Overrides:
  `replyReceived` in class `ServiceProxy`
Parameters:
  `reply` - The reply delivered by the client side communication system