public class ImplFromPropertiesFactory<T> extends Object
NinjaProperties
(aka application.conf).
If this variable is set then the implementation class is loaded for subclasses
to use in their own implementation of Provider.get().Constructor and Description |
---|
ImplFromPropertiesFactory(com.google.inject.Injector injector,
NinjaProperties ninjaProperties,
String propertyName,
Class<? extends T> targetClass,
String defaultClassName,
boolean deferResolveUntilGet,
org.slf4j.Logger logger)
Tries to load implementation class defined as a property in NinjaProperties
or will fallback to loading the default implementation class or nothing
if its not set.
|
public ImplFromPropertiesFactory(com.google.inject.Injector injector, NinjaProperties ninjaProperties, String propertyName, Class<? extends T> targetClass, String defaultClassName, boolean deferResolveUntilGet, org.slf4j.Logger logger)
injector
- The guice injectorninjaProperties
- The ninja propertiespropertyName
- The name of the configuration property keytargetClass
- The target implementation class (e.g. ninja.Cache)defaultClassName
- The default implementation class or null if
a default doesn't exist. A string is used here to not require
an implementation class to be on the classpath.deferResolveUntilGet
- If false then the implementation class will
be resolved in the constructor. If true then the resolution will
be deferred until getImplementation() or create() is called.logger
- The logger to use for info and errorsCopyright © 2019 ninjaframework. All rights reserved.