
com.yahoo.container.di.componentgraph.Provider Maven / Gradle / Ivy
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.di.componentgraph;
import com.yahoo.component.Deconstructable;
/**
* Provides a component of the parameter type T.
* If (and only if) dependency injection does not have a component of type T,
* it will request one from the Provider providing type T.
*
* Providers are useful in these situations:
*
* - Some code is needed to create the component instance in question.
* - The component creates resources that must be deconstructed.
* - A fallback component should be provided in case the application (or system)
* does not provide a component instance.
*
*
* @author Tony Vaagenes
* @author gjoranv
*/
public interface Provider extends Deconstructable {
T get();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy