public class ServiceProxy extends TOMSender
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.locks.ReentrantLock |
canReceiveLock |
protected java.util.concurrent.locks.ReentrantLock |
canSendLock |
Constructor and Description |
---|
ServiceProxy(int processId)
Constructor
|
ServiceProxy(int processId,
java.lang.String configHome)
Constructor
|
ServiceProxy(int processId,
java.lang.String configHome,
java.util.Comparator<byte[]> replyComparator,
Extractor replyExtractor)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getInvokeTimeout()
Get the amount of time (in seconds) that this proxy will wait for
servers replies before returning null.
|
int |
getInvokeUnorderedHashedTimeout() |
byte[] |
invoke(byte[] request,
TOMMessageType reqType)
This method sends a request to the replicas, and returns the related reply.
|
byte[] |
invokeOrdered(byte[] request) |
byte[] |
invokeUnordered(byte[] request) |
byte[] |
invokeUnorderedHashed(byte[] request) |
void |
replyReceived(TOMMessage reply)
This is the method invoked by the client side communication system.
|
void |
setInvokeTimeout(int invokeTimeout)
Set the amount of time (in seconds) that this proxy will wait for
servers replies before returning null.
|
void |
setInvokeUnorderedHashedTimeout(int timeout) |
close, generateOperationId, generateRequestId, getCommunicationSystem, getProcessId, getSession, getViewManager, init, init, sendMessageToTargets, sendMessageToTargets, TOMulticast, TOMulticast, TOMulticast
protected java.util.concurrent.locks.ReentrantLock canReceiveLock
protected java.util.concurrent.locks.ReentrantLock canSendLock
public ServiceProxy(int processId)
bellow
public ServiceProxy(int processId, java.lang.String configHome)
bellow
public ServiceProxy(int processId, java.lang.String configHome, java.util.Comparator<byte[]> replyComparator, Extractor replyExtractor)
processId
- Process id for this client (should be different from replicas)configHome
- Configuration directory for BFT-SMARTreplyComparator
- used for comparing replies from different servers
to extract one returned by f+1replyExtractor
- used for extracting the response from the matching
quorum of repliespublic int getInvokeTimeout()
public int getInvokeUnorderedHashedTimeout()
public void setInvokeTimeout(int invokeTimeout)
invokeTimeout
- the invokeTimeout to setpublic void setInvokeUnorderedHashedTimeout(int timeout)
public byte[] invokeOrdered(byte[] request)
public byte[] invokeUnordered(byte[] request)
public byte[] invokeUnorderedHashed(byte[] request)
public byte[] invoke(byte[] request, TOMMessageType reqType)
request
- Request to be sentreqType
- TOM_NORMAL_REQUESTS for service requests, and other for
reconfig requests.public void replyReceived(TOMMessage reply)
reply
- The reply delivered by the client side communication system