package com.atlassian.bitbucket.mesh.spring;

import org.springframework.context.SmartLifecycle;

public abstract class AbstractSmartLifecycle implements SmartLifecycle {

    private volatile boolean running;

    //Remove the default phase. Every component integrating with the lifecycle should define an explicit phase,
    //as a constant in LifecyclePhases, so the system has a concrete, explicit order of operations.
    @Override
    public abstract int getPhase();

    @Override
    public boolean isRunning() {
        return running;
    }

    @Override
    public void start() {
        running = true;
    }

    @Override
    public void stop() {
        running = false;
    }
}
