Module org.elasticsearch.server
Package org.elasticsearch.injection.guice
package org.elasticsearch.injection.guice
Google Guice (pronounced "juice") is an ultra-lightweight dependency
injection framework. Please refer to the Guice
User's Guide
for a gentle introduction.
The principal public APIs in this package are:
Inject
- The annotation you will use in your implementation classes to tell Guice where and how it should send in ("inject") the objects you depend on (your "dependencies").
Module
- The interface you will implement in order to specify "bindings" -- instructions for how Guice should handle injection -- for a particular set of interfaces.
Binder
- The object that Guice passes into your
Module
to collect these bindings. Provider
- The interface you will implement when you need to customize exactly how Guice creates instances for a particular binding.
-
ClassDescriptionA support class for
Module
s which reduces repetition and results in a more readable configuration.Collects configuration information (primarily bindings) which will be used to create anInjector
.Binding<T>A mapping from a key (type and optional annotation) to the strategy for getting instances of the type.Annotates annotations which are used for binding.Thrown when a programming error such as a misplaced annotation, illegal binding, or unsupported scope is found.Thrown when errors occur while creating aInjector
.The entry point to the Guice framework.Annotates members of your implementation class (constructors, methods and fields) into which theInjector
should inject values.Builds the graphs of objects that make up your application.Key<T>Binding key consisting of an injection type and an optional annotation.Injects dependencies into the fields and methods on instances of typeT
.A module contributes configuration information, typically interface bindings, which will be used to create anInjector
.Returns a binder whose configuration information is hidden from its environment by default.Provider<T>An object capable of providing instances of typeT
.Indicates that there was a runtime failure while providing an instance.Built-in scope implementations.TypeLiteral<T>Represents a generic typeT
.