@ManagedOperation
    public void pause() {
        if(!state.compareAndSet(RUNNING, PAUSED)) {
            throw new IllegalStateException("Unable to pause service with state " + state);
        }
    }