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

com.boozallen.aiops.mda.basic.cdi.CdiContainerFactory Maven / Gradle / Ivy

Go to download

Contains a barebones model with all features turned off to verify basic MDA generation and compilation

There is a newer version: 1.10.0
Show newest version
package com.boozallen.aiops.mda.basic.cdi;

/*-
 * #%L
 * aiSSEMBLE::Test::MDA::Data Delivery Spark Basic
 * %%
 * Copyright (C) 2021 Booz Allen
 * %%
 * This software package is licensed under the Booz Allen Public License. All Rights Reserved.
 * #L%
 */

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.jboss.weld.environment.se.WeldContainer;

import com.boozallen.aissemble.core.cdi.CdiContainer;
import com.boozallen.aissemble.core.cdi.CdiContext;

/**
 * Factory that creates the proper CDI Context for this series of pipelines.
 *
 * Please **DO** modify with your customizations, as appropriate.
 *
 * Originally generated from: templates/cdi.container.factory.java.vm
 */
public final class CdiContainerFactory {

    private CdiContainerFactory() {
        // private construct to prevent instantiation of all static class
    }

    /**
     * Creates a new WeldContainer with the set of {@link CdiContext}
     * implementations needed for these pipelines.
     *
     * @return Weld Container instance
     */
    public static WeldContainer getCdiContainer() {
        return getCdiContainer(null);
    }

    /**
     * Creates a new WeldContainer with the set of {@link CdiContext}
     * implementations needed for these pipelines with the ability to add in
     * additional contexts in an ad-hoc fashion.
     *
     * @param additionalContexts
     * @return Weld Container instance
     */
    public static WeldContainer getCdiContainer(List additionalContexts) {
        List contexts = getContexts();
        if (CollectionUtils.isNotEmpty(additionalContexts)) {
            contexts.addAll(additionalContexts);
        }
        return CdiContainer.create(contexts);
    }

    protected static List getContexts() {
        List contexts = new ArrayList<>();
        contexts.add(new PipelinesCdiContext());

        return contexts;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy