CliGuiceModuleLoader.java revision 231b2dbbbc26e620c41026c9211d248e47859b51
0N/A/*
2362N/A * The contents of this file are subject to the terms of the Common Development and
0N/A * Distribution License (the License). You may not use this file except in compliance with the
0N/A * License.
0N/A *
0N/A * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
2362N/A * specific language governing permission and limitations under the License.
0N/A *
2362N/A * When distributing Covered Software, include this CDDL Header Notice in each file and include
0N/A * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
0N/A * Header, with the fields enclosed by brackets [] replaced by your own identifying
0N/A * information: "Portions copyright [year] [name of copyright owner]".
0N/A *
0N/A * Copyright 2015 ForgeRock AS.
0N/A */
0N/A
0N/Apackage com.sun.identity.cli;
0N/A
0N/Aimport java.lang.annotation.Annotation;
0N/Aimport java.util.HashSet;
2362N/Aimport java.util.Set;
2362N/A
2362N/Aimport org.forgerock.guice.core.GuiceModuleLoader;
0N/Aimport org.forgerock.openam.license.LicenseGuiceModule;
0N/Aimport org.forgerock.openam.license.LicensePresenterGuiceModule;
0N/Aimport org.forgerock.openam.shared.guice.SharedGuiceModule;
0N/A
0N/Aimport com.google.inject.Module;
0N/A
0N/A/**
0N/A * Guice module loader for loading CLI specific Guice modules.
0N/A *
0N/A * <p>This is required so as to be able to load the {@link CliGuiceModule} which contains duplicate
0N/A * bindings from CoreGuiceModule which cannot be loaded by the server.</p>
0N/A *
0N/A * @since 13.0.0
0N/A */
0N/Apublic class CliGuiceModuleLoader implements GuiceModuleLoader {
0N/A
0N/A @Override
0N/A public Set<Class<? extends Module>> getGuiceModules(Class<? extends Annotation> moduleAnnotation) {
0N/A Set<Class<? extends Module>> moduleClasses = new HashSet<>();
0N/A moduleClasses.add(LicensePresenterGuiceModule.class);
0N/A moduleClasses.add(SharedGuiceModule.class);
0N/A moduleClasses.add(LicenseGuiceModule.class);
0N/A moduleClasses.add(CliGuiceModule.class);
0N/A return moduleClasses;
0N/A }
0N/A}
0N/A