Search in sources :

Example 1 with AcsJComponentCleanUpEx

use of alma.maciErrType.wrappers.AcsJComponentCleanUpEx in project ACS by ACS-Community.

the class CounterConsumerImpl method cleanUp.

@Override
public void cleanUp() throws AcsJComponentCleanUpEx {
    if (subscriber != null) {
        m_logger.info("cleanUp() called, disconnecting from channel " + alma.COUNTER.CHANNELNAME_COUNTER.value);
        StopWatch sw = new StopWatch();
        try {
            subscriber.disconnect();
            subscriber = null;
        } catch (Exception ex) {
            // could be IllegalStateException if the consumer is already disconnected.
            throw new AcsJComponentCleanUpEx(ex);
        }
        long disconnectTimeMillis = sw.getLapTimeMillis();
        if (disconnectTimeMillis > 600) {
            m_logger.info("Suspiciously slow NC disconnect in " + disconnectTimeMillis + " ms.");
        }
    } else {
        m_logger.info("cleanUp() called..., nothing to clean up.");
    }
}
Also used : AcsJComponentCleanUpEx(alma.maciErrType.wrappers.AcsJComponentCleanUpEx) ComponentLifecycleException(alma.acs.component.ComponentLifecycleException) StopWatch(alma.acs.util.StopWatch)

Aggregations

ComponentLifecycleException (alma.acs.component.ComponentLifecycleException)1 StopWatch (alma.acs.util.StopWatch)1 AcsJComponentCleanUpEx (alma.maciErrType.wrappers.AcsJComponentCleanUpEx)1