/** The logger. */
private static final Logger logger = Logger.getLogger(Core.class.getName());
+ private final Object syncObject = new Object();
/** The event bus. */
private final EventBus eventBus;
private final ConnectionFactory connectionFactory;
@Override
protected void run() throws Exception {
while (isRunning()) {
- try {
- Thread.sleep(TimeUnit.MINUTES.toMillis(1));
- } catch (InterruptedException ie1) {
- /* ignore. */
+ synchronized (syncObject) {
+ try {
+ syncObject.wait(TimeUnit.MINUTES.toMillis(1));
+ } catch (InterruptedException ie1) {
+ /* ignore. */
+ }
}
/* find channels that should be monitored but are not. */
@Override
protected void shutDown() {
+ synchronized (syncObject) {
+ syncObject.notifyAll();
+ }
}
//