Package io.bootique.di
Interface ScopeBuilder
- All Known Subinterfaces:
BindingBuilder<T>,MapBuilder<K,,V> SetBuilder<T>
- All Known Implementing Classes:
DICollectionBuilder
public interface ScopeBuilder
-
Method Summary
Modifier and TypeMethodDescriptionvoidSets the scope of a bound instance.voidMarks this injection point to be triggered early without explicit call toInjector.getInstance(Class).voidSets the scope of a bound instance to singleton.voidSets the scope of a bound instance to "no scope".
-
Method Details
-
in
Sets the scope of a bound instance. This method is used to change the default scope which is a singleton by default to a custom scope. -
inSingletonScope
void inSingletonScope()Sets the scope of a bound instance to singleton. Singleton is normally the default. -
withoutScope
void withoutScope()Sets the scope of a bound instance to "no scope". This means that a new instance of an object will be created on every call toInjector.getInstance(Class)or toProviderof this instance. -
initOnStartup
void initOnStartup()Marks this injection point to be triggered early without explicit call toInjector.getInstance(Class). Such service will be created right afterInjectoris fully setup. NOTE: use with caution, as this will effectively create all graph of services that this service depends on.
-