use of org.jacorb.config.ConfigurationException in project ACS by ACS-Community.
the class JconttestUtil method getSystemLevelOrbTimeoutMillis.
/**
* We get the timeout property value from the ORB configuration.
* System-level timeout defaults are not standardized in Corba, thus we need jacorb-specific access.
* @throws IllegalArgumentException if the ORB timeout is configured as a negative value
* @throws AcsJCouldntPerformActionEx if the ORB-level timeout could not be read, e.g. because the ORB is not jacorb.
*/
public int getSystemLevelOrbTimeoutMillis() throws AcsJCouldntPerformActionEx {
int orbLevelTimeout = -1;
ORB orb = containerServices.getAdvancedContainerServices().getORB();
if (orb instanceof org.jacorb.orb.ORB) {
try {
orbLevelTimeout = ((org.jacorb.orb.ORB) orb).getConfiguration().getAttributeAsInteger(PROPERTYNAME_CLIENTORBTIMEOUT);
if (orbLevelTimeout < 0) {
throw new IllegalArgumentException("system-level roundtrip timeout must be non-negative!");
}
} catch (ConfigurationException e) {
logger.log(Level.SEVERE, "Failed to read the system-level ORB timeout setting.", e);
throw new AcsJCouldntPerformActionEx();
}
} else {
logger.log(Level.SEVERE, "Wrong ORB " + orb.getClass().getName());
throw new AcsJCouldntPerformActionEx();
}
return orbLevelTimeout;
}
Aggregations