tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [3/4] incubator-tamaya git commit: TAMAYA-194: Factored out ConfiguredItemSupplier, updated docs.
Date Sun, 13 Nov 2016 22:28:43 GMT
TAMAYA-194: Factored out ConfiguredItemSupplier, updated docs.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/fcf27309
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/fcf27309
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/fcf27309

Branch: refs/heads/master
Commit: fcf27309a6951b552a17843afb4286c48f02b477
Parents: 30fabab
Author: anatole <anatole@apache.org>
Authored: Sun Nov 13 23:08:36 2016 +0100
Committer: anatole <anatole@apache.org>
Committed: Sun Nov 13 23:08:36 2016 +0100

----------------------------------------------------------------------
 src/site/asciidoc/extensions/mod_injection.adoc | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/fcf27309/src/site/asciidoc/extensions/mod_injection.adoc
----------------------------------------------------------------------
diff --git a/src/site/asciidoc/extensions/mod_injection.adoc b/src/site/asciidoc/extensions/mod_injection.adoc
index 4b85f3e..47f8872 100644
--- a/src/site/asciidoc/extensions/mod_injection.adoc
+++ b/src/site/asciidoc/extensions/mod_injection.adoc
@@ -190,15 +190,15 @@ name=<unnamed>
 --------------------------------------------
 
 
-==== Accessing ConfiguredItemSupplier instances
+==== Accessing Supplier instances
 
 In many cases you want to create a supplier that simply creates instances that are correctly
configured as defined
 by the current context. This can be done using +Suppliers+:
 
 [source, java]
 --------------------------------------------
-ConfiguredItemSupplier<Tenant> configuredTenantSupplier = ConfigurationInjector.getInstance().getConfiguredSupplier(
-  new ConfiguredItemSupplier<Tenant>(){
+Supplier<Tenant> configuredTenantSupplier = ConfigurationInjector.getInstance().getConfiguredSupplier(
+  new Supplier<Tenant>(){
      public Tenant get(){
        return new Tenant();
      }
@@ -209,11 +209,11 @@ With Java 8 it's even more simpler:
 
 [source, java]
 --------------------------------------------
-ConfiguredItemSupplier<Tenant> configuredTenantSupplier = ConfigurationInjector.getInstance().getConfiguredSupplier(
+Supplier<Tenant> configuredTenantSupplier = ConfigurationInjector.getInstance().getConfiguredSupplier(
   Tenant::new);
 --------------------------------------------
 
-Hereby this annotation can be used in multiple ways and combined with other annotations such
as +@DefaultValue+,
+Hereby this annotation can be used in multiple ways and combined with other annotations such
as
 +@WithLoadPolicy+, +@WithConfigOperator+, +@WithPropertyConverter+.
 
 ==== Minimal Example
@@ -245,7 +245,7 @@ In the next example we explicitly define the property value:
 --------------------------------------------
 pubic class ConfiguredItem{
 
-  @Config({"aValue", "a.b.value","a.b.deprecated.value"}, defaultValue="${env:java.version}")
+  @Config(value={"aValue", "a.b.value","a.b.deprecated.value"}, defaultValue="${env:java.version}")
   private String aValue;
 }
 --------------------------------------------
@@ -259,7 +259,7 @@ commit new values exactly, when convenient for you.
 --------------------------------------------
 pubic class ConfiguredItem{
 
-  @Config({"aValue", "a.b.value","a.b.deprecated.value"}, defaultValue="${env:java.version}")
+  @Config(value={"aValue", "a.b.value","a.b.deprecated.value"}, defaultValue="${env:java.version}")
   private DynamicValue aValue;
 }
 --------------------------------------------
@@ -292,8 +292,9 @@ public interface DynamicValue<T> {
 
     boolean isPresent();
     T orElse(T other);
-    T orElseGet(ConfiguredItemSupplier<? extends T> other);
-    <X extends Throwable> T orElseThrow(ConfiguredItemSupplier<? extends X> exceptionSupplier)
throws X;
+    // Enabled with Java 8
+    // T orElseGet(ConfiguredItemSupplier<? extends T> other);
+    // <X extends Throwable> T orElseThrow(ConfiguredItemSupplier<? extends X>
exceptionSupplier) throws X;
 
 }
 --------------------------------------------


Mime
View raw message