// Path: provider/core/src/main/java/org/arquillian/algeron/provider/core/AlgeronProviderConfiguration.java
// public class AlgeronProviderConfiguration {
// 
//     private static final String SKIP_DEPLOYMENT = "skipDeployment";
//     private static final String RETRIEVER_CONFIGURATION = "retrieverConfiguration";
// 
//     private boolean skipDeployment = false;
//     private Map<String, Object> retrieverConfiguration = null;
// 
//     public boolean isSkipDeployment() {
//         return skipDeployment;
//     }
// 
//     public boolean isRetrieverConfigurationSet() {
//         return this.retrieverConfiguration != null;
//     }
// 
//     public Map<String, Object> getRetrieverConfiguration() {
//         return retrieverConfiguration;
//     }
// 
//     public static AlgeronProviderConfiguration fromMap(Map<String, String> config) {
//         AlgeronProviderConfiguration configuration = new AlgeronProviderConfiguration();
// 
//         if (config.containsKey(SKIP_DEPLOYMENT)) {
//             configuration.skipDeployment = Boolean.parseBoolean(config.get(SKIP_DEPLOYMENT));
//         }
// 
//         if (config.containsKey(RETRIEVER_CONFIGURATION)) {
//             configuration.retrieverConfiguration = loadConfiguration(config.get(RETRIEVER_CONFIGURATION));
//         }
// 
//         return configuration;
//     }
// 
//     private final static Map<String, Object> loadConfiguration(String configurationContent) {
//         return (Map<String, Object>) new Yaml().load(configurationContent);
//     }
// }


import org.arquillian.algeron.provider.core.AlgeronProviderConfiguration;
import org.jboss.arquillian.container.spi.event.DeployManagedDeployments;
import org.jboss.arquillian.container.spi.event.StartContainer;
import org.jboss.arquillian.container.spi.event.StopContainer;
import org.jboss.arquillian.container.spi.event.UnDeployManagedDeployments;
import org.jboss.arquillian.core.api.annotation.Observes;
import org.jboss.arquillian.core.spi.EventContext;
package org.arquillian.algeron.provider.core.deployment;


public class DeploymentEnabler {

    void skipDeployment(@Observes(precedence = -1000) EventContext<DeployManagedDeployments> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        proceedIfEnabled(eventContext, algeronProviderConfiguration);
    }

    void skipUndeploy(@Observes(precedence = -1000) EventContext<UnDeployManagedDeployments> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        proceedIfEnabled(eventContext, algeronProviderConfiguration);
    }

    void skipStartContainer(@Observes(precedence = -1000) EventContext<StartContainer> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        proceedIfEnabled(eventContext, algeronProviderConfiguration);
    }

    void skipStopContainer(@Observes(precedence = -1000) EventContext<StopContainer> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        proceedIfEnabled(eventContext, algeronProviderConfiguration);
    }

    private <T> void proceedIfEnabled(final EventContext<T> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
// Path: provider/core/src/main/java/org/arquillian/algeron/provider/core/AlgeronProviderConfiguration.java
// public class AlgeronProviderConfiguration {
// 
//     private static final String SKIP_DEPLOYMENT = "skipDeployment";
//     private static final String RETRIEVER_CONFIGURATION = "retrieverConfiguration";
// 
//     private boolean skipDeployment = false;
//     private Map<String, Object> retrieverConfiguration = null;
// 
//     public boolean isSkipDeployment() {
//         return skipDeployment;
//     }
// 
//     public boolean isRetrieverConfigurationSet() {
//         return this.retrieverConfiguration != null;
//     }
// 
//     public Map<String, Object> getRetrieverConfiguration() {
//         return retrieverConfiguration;
//     }
// 
//     public static AlgeronProviderConfiguration fromMap(Map<String, String> config) {
//         AlgeronProviderConfiguration configuration = new AlgeronProviderConfiguration();
// 
//         if (config.containsKey(SKIP_DEPLOYMENT)) {
//             configuration.skipDeployment = Boolean.parseBoolean(config.get(SKIP_DEPLOYMENT));
//         }
// 
//         if (config.containsKey(RETRIEVER_CONFIGURATION)) {
//             configuration.retrieverConfiguration = loadConfiguration(config.get(RETRIEVER_CONFIGURATION));
//         }
// 
//         return configuration;
//     }
// 
//     private final static Map<String, Object> loadConfiguration(String configurationContent) {
//         return (Map<String, Object>) new Yaml().load(configurationContent);
//     }
// }


// Path: provider/core/src/main/java/org/arquillian/algeron/provider/core/deployment/DeploymentEnabler.java
import org.arquillian.algeron.provider.core.AlgeronProviderConfiguration;
import org.jboss.arquillian.container.spi.event.DeployManagedDeployments;
import org.jboss.arquillian.container.spi.event.StartContainer;
import org.jboss.arquillian.container.spi.event.StopContainer;
import org.jboss.arquillian.container.spi.event.UnDeployManagedDeployments;
import org.jboss.arquillian.core.api.annotation.Observes;
import org.jboss.arquillian.core.spi.EventContext;

package org.arquillian.algeron.provider.core.deployment;


public class DeploymentEnabler {

    void skipDeployment(@Observes(precedence = -1000) EventContext<DeployManagedDeployments> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        proceedIfEnabled(eventContext, algeronProviderConfiguration);
    }

    void skipUndeploy(@Observes(precedence = -1000) EventContext<UnDeployManagedDeployments> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        proceedIfEnabled(eventContext, algeronProviderConfiguration);
    }

    void skipStartContainer(@Observes(precedence = -1000) EventContext<StartContainer> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        proceedIfEnabled(eventContext, algeronProviderConfiguration);
    }

    void skipStopContainer(@Observes(precedence = -1000) EventContext<StopContainer> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        proceedIfEnabled(eventContext, algeronProviderConfiguration);
    }

    private <T> void proceedIfEnabled(final EventContext<T> eventContext,
        AlgeronProviderConfiguration algeronProviderConfiguration) {
        if (shouldEnableDeployment(algeronProviderConfiguration)) {