Java Code Examples for org.apache.commons.configuration.AbstractConfiguration#getInteger()

The following examples show how to use org.apache.commons.configuration.AbstractConfiguration#getInteger() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InspectorManager.java    From maestro-java with Apache License 2.0 5 votes vote down vote up
private void doInspectorStop() {
    if (inspectorContainer ==  null) {
        return;
    }

    inspectorContainer.stop();

    if (inspectorExecutor != null) {

        final AbstractConfiguration config = ConfigurationWrapper.getConfig();
        int interval = config.getInteger("inspector.sleep.interval", 5000) + 1000;

        try {
            inspectorExecutor.shutdown();

            if (!inspectorExecutor.awaitTermination(interval, TimeUnit.MILLISECONDS)) {
                logger.warn("Inspector did not terminate within the maximum allowed time");
                inspectorExecutor.shutdownNow();
                if (!inspectorExecutor.awaitTermination(10, TimeUnit.SECONDS)) {
                    logger.warn("Inspector did not terminate cleanly");
                }
            }
        } catch (Exception e) {
            logger.warn("Unable to stop the inspector in a clean way: {}", e.getMessage(), e);
        }
        finally {
            inspectorContainer.stop();
        }
    }
    else {
        logger.warn("Ignoring a stop request for the inspector because it is already stopped");
    }
}
 
Example 2
Source File: InterconnectReadData.java    From maestro-java with Apache License 2.0 5 votes vote down vote up
public InterconnectReadData(Session session,
                            Destination destination,
                            MessageConsumer responseConsumer,
                            MessageProducer requestProducer) {
    this.session = session;
    this.destination = destination;
    this.requestProducer = requestProducer;
    this.responseConsumer = responseConsumer;

    AbstractConfiguration config = ConfigurationWrapper.getConfig();
    timeout = config.getInteger("inspector.amqp.management.timeout", 2000);
}
 
Example 3
Source File: InterconnectInspector.java    From maestro-java with Apache License 2.0 4 votes vote down vote up
public InterconnectInspector() {
    final AbstractConfiguration config = ConfigurationWrapper.getConfig();

    interval = config.getInteger("inspector.sleep.interval", 5000);
}
 
Example 4
Source File: ArtemisInspector.java    From maestro-java with Apache License 2.0 4 votes vote down vote up
public ArtemisInspector() {
    final AbstractConfiguration config = ConfigurationWrapper.getConfig();
    interval = config.getInteger("inspector.sleep.interval", 5000);
}