All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.mike10004.containment.lifecycle.LifecycleStackDecommissionException Maven / Gradle / Ivy

There is a newer version: 0.6
Show newest version
package io.github.mike10004.containment.lifecycle;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Exception class for errors that occur during the decommission stage of a lifecycle stage stack.
 */
public class LifecycleStackDecommissionException extends RuntimeException {

    /**
     * Map of exceptions thrown during the decommissioning.
     * Keys are the component lifecycles that threw the exceptions.
     */
    public final Map, RuntimeException> exceptionsThrown;

    /**
     * Constructs a new instance
     * @param exceptionsThrown exceptions
     */
    public LifecycleStackDecommissionException(Map, RuntimeException> exceptionsThrown) {
        super(String.format("%d lifecycle decommission methods threw exception(s): %s", exceptionsThrown.size(), exceptionsThrown.keySet()));
        this.exceptionsThrown = Collections.unmodifiableMap(new LinkedHashMap<>(exceptionsThrown));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy