|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnavigators.smart.tom.TOMSender
navigators.smart.tom.ServiceProxy
public class ServiceProxy
This class implements a TOMReplyReceiver, and a proxy to be used on the client side of the application. It sends a request to the replicas, receives the reply, and delivers it to the application
Field Summary | |
---|---|
private int |
f
|
private java.util.concurrent.Semaphore |
mutex
|
private int |
n
|
private TOMMessage[] |
replies
|
private int |
reqId
|
private byte[] |
response
|
private java.util.concurrent.Semaphore |
sm
|
Constructor Summary | |
---|---|
ServiceProxy(int id)
Constructor |
|
ServiceProxy(int id,
java.lang.String configHome)
Constructor |
Method Summary | |
---|---|
private void |
init(TOMConfiguration conf)
|
byte[] |
invoke(byte[] request)
This method sends a request to the replicas, and returns the related reply. |
byte[] |
invoke(byte[] request,
boolean readOnly)
This method sends a request to the replicas, and returns the related reply. |
void |
replyReceived(TOMMessage reply)
This is the method invoked by the client side comunication system. |
Methods inherited from class navigators.smart.tom.TOMSender |
---|
getLastSequenceNumber, init, init, sign, TOMulticast, TOMulticast, TOMulticast |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int n
private int f
private java.util.concurrent.Semaphore mutex
private java.util.concurrent.Semaphore sm
private int reqId
private TOMMessage[] replies
private byte[] response
Constructor Detail |
---|
public ServiceProxy(int id)
id
- Process id for this clientpublic ServiceProxy(int id, java.lang.String configHome)
id
- Process id for this clientconfigHome
- Configuration directory for JBP
TODO: E mesmo a directoria do JBP, ou de alguma biblioteca de terceiros?Method Detail |
---|
private void init(TOMConfiguration conf)
public byte[] invoke(byte[] request)
request
- Request to be sent
public byte[] invoke(byte[] request, boolean readOnly)
request
- Request to be sentreadOnly
- it is a read only request (will not be ordered)
public void replyReceived(TOMMessage reply)
reply
- The reply delivered by the client side comunication system
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |