package com.eactive.eai.agent.circuitBreaker;

import com.eactive.eai.agent.command.Command;
import com.eactive.eai.agent.command.CommandException;
import com.eactive.eai.common.circuitBreaker.CircuitBreakerManager;
import com.eactive.eai.common.util.Logger;

public class ReloadCircuitBreakerCommand extends Command {

    Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);

    @Override
    public Object execute() throws CommandException {
        CircuitBreakerManager circuitBreakerManager = CircuitBreakerManager.getInstance();
        try {
            circuitBreakerManager.reload();
        }catch (Exception e) {
            throw new CommandException(e.getMessage());
        }
        return "success";
    }
}
