}
private static int getConnectTimeout(org.omg.CORBA.Policy[] policies) {
for (int i = 0; i < policies.length; i++) {
if (policies[i].policy_type() == CONNECT_TIMEOUT_POLICY_ID.value) {
ConnectTimeoutPolicy policy = (ConnectTimeoutPolicy) policies[i];
return policy.value();
}
}
//
// Fall back to TimeoutPolicy
//
for (int i = 0; i < policies.length; i++) {
if (policies[i].policy_type() == TIMEOUT_POLICY_ID.value) {
TimeoutPolicy policy = (TimeoutPolicy) policies[i];
return policy.value();
}
}
return -1;
}