Delegate.javaModification in the infrastructure of the ORB
We add this variable to know if in the method create_binding (where we have also add this variable as a parameter) we should change the IOR of the destination of the request. The application client send to one of our replicated server its request but not necessarily to the leader and if change =true it means that for this request we have to modify the IOR to be sent to the client.
If the operation was of name replicas or client which means that this request is sent by the client or one of the server to a replicated server to inform in which port it is going to listen and on which IP address. This is needed to exchange leader and consensus message. In this case, we don't want to redirect it to the leader so we put change to false.
try {
state.request = state.binding.create_request(self,
operation, responseExpected);
}
catch(org.omg.CORBA.SystemException
ex) {
int test=receive_sysexception(self,
state, ex);
//modify 5 aout 2002
if(test==1)
{
return null;
}
continue;
}
The variable test return by receive_sysexception is equal to 1 if the exception we have intercepted happened when the client or the replicated server try to send the message for say in which port it listens and on which adresses (the variable change = false). In this case we don't want the client to resend automatically the message because the exception is due to the fact that our server is dead, so the client shouldn't do anything else. This is for this purposes that we return null in the method request.