From c1a8877955d347b8233ee6cbd214cbf19e459028 Mon Sep 17 00:00:00 2001 From: gjoranv Date: Fri, 2 Apr 2021 00:14:15 +0200 Subject: Move componentgraph.Provider from container-di to component. - It was the only PublicApi class in container-di, and is widely used in the same way as e.g. AbstractComponent from the component module. --- .../container/di/componentgraph/Provider.java | 26 ++++++++++++++++++++++ .../container/di/componentgraph/package-info.java | 12 ++++++++++ .../container/di/componentgraph/Provider.java | 26 ---------------------- .../container/di/componentgraph/package-info.java | 7 ------ 4 files changed, 38 insertions(+), 33 deletions(-) create mode 100644 component/src/main/java/com/yahoo/container/di/componentgraph/Provider.java create mode 100644 component/src/main/java/com/yahoo/container/di/componentgraph/package-info.java delete mode 100644 container-di/src/main/java/com/yahoo/container/di/componentgraph/Provider.java delete mode 100644 container-di/src/main/java/com/yahoo/container/di/componentgraph/package-info.java diff --git a/component/src/main/java/com/yahoo/container/di/componentgraph/Provider.java b/component/src/main/java/com/yahoo/container/di/componentgraph/Provider.java new file mode 100644 index 00000000000..3fd3195e5dd --- /dev/null +++ b/component/src/main/java/com/yahoo/container/di/componentgraph/Provider.java @@ -0,0 +1,26 @@ +// Copyright 2017 Yahoo Holdings. 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:

+ * + * + * @author Tony Vaagenes + * @author gjoranv + */ +public interface Provider extends Deconstructable { + + T get(); + +} diff --git a/component/src/main/java/com/yahoo/container/di/componentgraph/package-info.java b/component/src/main/java/com/yahoo/container/di/componentgraph/package-info.java new file mode 100644 index 00000000000..054abe9cff9 --- /dev/null +++ b/component/src/main/java/com/yahoo/container/di/componentgraph/package-info.java @@ -0,0 +1,12 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +/** + * Note that this package also exists in another Vespa module, for historical + * reasons. All Java classes should be kept in this module, and the other + * module's package should remain empty. + */ +@ExportPackage +@PublicApi +package com.yahoo.container.di.componentgraph; + +import com.yahoo.api.annotations.PublicApi; +import com.yahoo.osgi.annotation.ExportPackage; diff --git a/container-di/src/main/java/com/yahoo/container/di/componentgraph/Provider.java b/container-di/src/main/java/com/yahoo/container/di/componentgraph/Provider.java deleted file mode 100644 index 3fd3195e5dd..00000000000 --- a/container-di/src/main/java/com/yahoo/container/di/componentgraph/Provider.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 Yahoo Holdings. 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:

- * - * - * @author Tony Vaagenes - * @author gjoranv - */ -public interface Provider extends Deconstructable { - - T get(); - -} diff --git a/container-di/src/main/java/com/yahoo/container/di/componentgraph/package-info.java b/container-di/src/main/java/com/yahoo/container/di/componentgraph/package-info.java deleted file mode 100644 index 0c11cfb5ba4..00000000000 --- a/container-di/src/main/java/com/yahoo/container/di/componentgraph/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -@ExportPackage -@PublicApi -package com.yahoo.container.di.componentgraph; - -import com.yahoo.api.annotations.PublicApi; -import com.yahoo.osgi.annotation.ExportPackage; -- cgit v1.2.3