}
long currentTime;
long nextSleep = 2000;
boolean tryAgain;
int attemptsC = 0;
Response resp;
String error;
try {
serviceUrl = new URL("http://"
+ factParams.getHost()
+ ":"
+ factParams.getPort()
+ "/soap/servlet/rpcrouter");
}
catch (MalformedURLException exc) {}
// Building the Call object for checking the user's identification:
Call checkCall = new Call();
checkCall.setTargetObjectURI("urn:ProxyService");
checkCall.setMethodName("setConnection");
checkCall.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
Hashtable h;
try {
h = identity.soapCode();
} catch (IOException e) {
throw new JMSException("EXCEPTION:: connect identity.soapCode(): " + e.getMessage());
}
params.add(new Parameter("identityMap", Hashtable.class, h, null));
params.addElement(new Parameter("timeout",
Integer.class,
new Integer(factParams.cnxPendingTimer),
null));
checkCall.setParams(params);
while (true) {
tryAgain = false;
attemptsC++;
error = null;
try {
resp = checkCall.invoke(serviceUrl,"");
// SOAP sends a fault back: the service is possibly not started or
// not running.
if (resp.generatedFault ()) {
error = resp.getFault().getFaultString();
tryAgain = true;
}
// RPC call worked:
else {
Integer result = (Integer) resp.getReturnValue().getValue();
// The returned value is either the key of the connection, or -1
// if the user is invalid:
if (result.intValue() == -1) {
throw new JMSSecurityException("Can't open the connection with"