package com.ericsson.uecontrol.core.logic;

import com.ericsson.uecontrol.core.UeBehaviour;
import com.ericsson.uecontrol.core.UeControlExecutor;
import com.ericsson.uecontrol.core.util.Configurator.Configurable;
import org.apache.log4j.Logger;

/**
 * Created by ezivkoc on 2015-01-19.
 */
public class UeBehaviourStop extends UeBehaviour {
    private static final Logger log = Logger.getLogger(UeBehaviourStop.class);


    @Override
    protected void execute() throws Exception {
        UeControlExecutor executor = super.getExecutor();
        log.debug("Terminating executor");
        executor.terminateNonBlock();
        log.debug("Resetting executor");
        executor.reset();
        Thread.sleep(VISUAL_SLEEP_PERIOD); // Sleep as a visual queue
    }


    @Override
    public String getName() {
        return "Stop";
    }

    @Override
    public String toString() {
        return "Will stop execution";
    }
}

