/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
*/
/**
* <p>A thread-safe singleton holding the system startup Guice Injector instance that system
* startup and bootstrapping classes can call to get to use dependency injection during the system
* startup process.</p>
*
* The SystemStartupInjectorHolder should ONLY be used from
* {@link AMSetupFilter#init(FilterConfig)} and NOWHERE else!
*
* @see com.google.inject.Injector
*
* @since 13.0.0
*/
final class SystemStartupInjectorHolder {
}
/**
* <p>Initialises the system startup injector holder with a specific Guice injector
* instance.</p>
*
* This should ONLY be called from the
* {@link SystemStartupInjectorListener#contextInitialized(ServletContextEvent)} and
* {@link AMSetupFilter} tests and NOWHERE else!
*
* @param injector The system startup injector.
*/
}
}
/**
* <p>Retrieves the system startup Guice injector.</p>
*
* This should ONLY be called from {@link AMSetupFilter#init(FilterConfig)} and NOWHERE else!
*
* @return The configured Guice injector.
*/
throw new IllegalStateException("SystemStartupInjectorHolder has not been initialised!");
}
return instance;
}
/**
* <p>Uses the Guice injector to return the appropriate instance for the given injection
* type.</p>
*
* Avoid using this method, in favour of having Guice inject your dependencies ahead of time.
*
* @param type The class to get an instance of.
* @param <T> The type of class to get.
* @return A non-null instance of the class.
*/
}
/**
* <p>Uses the Guice injector to return the appropriate instance for the given injection
* key.</p>
*
* Avoid using this method, in favour of having Guice inject your dependencies ahead of time.
*
* @param key The key that defines the class to get.
* @param <T> The type of class defined by the key.
* @return A non-null instance of the class defined by the key.
*/
}
}