Search in sources :

Example 1 with ConfigurationException

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;
}
Also used : ConfigurationException(org.jacorb.config.ConfigurationException) AcsJCouldntPerformActionEx(alma.ACSErrTypeCommon.wrappers.AcsJCouldntPerformActionEx) ORB(org.omg.CORBA.ORB)

Aggregations

AcsJCouldntPerformActionEx (alma.ACSErrTypeCommon.wrappers.AcsJCouldntPerformActionEx)1 ConfigurationException (org.jacorb.config.ConfigurationException)1 ORB (org.omg.CORBA.ORB)1