// it might be necessary to add a lock here... a synchronized method is not // possible as this method would block the "syncScheduling" method private void disposeScheduler() { if (scheduler != null) { scheduler.dispose(); scheduler = null; } }