Return-Path: X-Original-To: apmail-tamaya-commits-archive@minotaur.apache.org Delivered-To: apmail-tamaya-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F145D18F8A for ; Fri, 1 Jan 2016 23:04:20 +0000 (UTC) Received: (qmail 73164 invoked by uid 500); 1 Jan 2016 23:04:20 -0000 Delivered-To: apmail-tamaya-commits-archive@tamaya.apache.org Received: (qmail 73134 invoked by uid 500); 1 Jan 2016 23:04:20 -0000 Mailing-List: contact commits-help@tamaya.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tamaya.incubator.apache.org Delivered-To: mailing list commits@tamaya.incubator.apache.org Received: (qmail 73123 invoked by uid 99); 1 Jan 2016 23:04:20 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jan 2016 23:04:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 561EEC028D for ; Fri, 1 Jan 2016 23:04:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.226 X-Spam-Level: * X-Spam-Status: No, score=1.226 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id dhBekiPae_0n for ; Fri, 1 Jan 2016 23:04:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 399E6439C9 for ; Fri, 1 Jan 2016 23:04:11 +0000 (UTC) Received: (qmail 73120 invoked by uid 99); 1 Jan 2016 23:04:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jan 2016 23:04:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8B1BDDFF6F; Fri, 1 Jan 2016 23:04:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: plexus@apache.org To: commits@tamaya.incubator.apache.org Message-Id: <36a451743cd242c3a746bbf261df24ae@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-tamaya git commit: Fixed all Javadoc problems for now... Date: Fri, 1 Jan 2016 23:04:10 +0000 (UTC) Repository: incubator-tamaya Updated Branches: refs/heads/master 1613ec5d9 -> 4dd68204e Fixed all Javadoc problems for now... Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/4dd68204 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/4dd68204 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/4dd68204 Branch: refs/heads/master Commit: 4dd68204ef3a5fc96e93a357a237f6c1f176b484 Parents: 1613ec5 Author: Oliver B. Fischer Authored: Fri Jan 1 23:58:57 2016 +0100 Committer: Oliver B. Fischer Committed: Fri Jan 1 23:58:57 2016 +0100 ---------------------------------------------------------------------- .../org/apache/tamaya/spi/PropertySource.java | 2 +- .../org/apache/tamaya/spi/ServiceContext.java | 1 + .../core/internal/PropertyConverterManager.java | 2 +- .../internal/converters/CurrencyConverter.java | 3 +- .../internal/converters/NumberConverter.java | 10 +-- .../EnvironmentPropertySource.java | 4 +- examples/5-injection-example/pom.xml | 15 ++++ .../tamaya/builder/ConfigurationBuilder.java | 1 - .../AbstractClassloaderAwareItemLoader.java | 13 ++-- .../tamaya/clsupport/CLAwareServiceContext.java | 14 ++-- .../apache/tamaya/format/ConfigurationData.java | 4 +- .../tamaya/format/ConfigurationFormat.java | 5 +- .../tamaya/format/InputStreamFactory.java | 4 +- .../tamaya/inject/api/BaseDynamicValue.java | 10 ++- .../org/apache/tamaya/inject/api/Config.java | 77 ++++++++++---------- .../inject/api/ConfigDefaultSections.java | 15 ++-- .../apache/tamaya/inject/api/DynamicValue.java | 11 ++- .../cdi/internal/CDIAwareServiceContext.java | 14 ++-- .../cdi/internal/PropertyConverterManager.java | 11 +-- .../cdi/internal/TamayaCDIIntegration.java | 1 - .../tamaya/integration/osgi/Activator.java | 8 +- .../internal/DefaultExpressionEvaluator.java | 2 +- .../internal/ExpressionResolutionFilter.java | 2 +- .../tamaya/resolver/internal/FileResolver.java | 8 +- .../resolver/internal/ResourceResolver.java | 8 +- .../apache/tamaya/resource/ConfigResources.java | 8 +- .../tamaya/resource/ResourceResolver.java | 5 +- .../apache/tamaya/server/spi/ScopeManager.java | 6 +- .../spisupport/PropertyConverterManager.java | 7 +- 29 files changed, 153 insertions(+), 118 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/code/api/src/main/java/org/apache/tamaya/spi/PropertySource.java ---------------------------------------------------------------------- diff --git a/code/api/src/main/java/org/apache/tamaya/spi/PropertySource.java b/code/api/src/main/java/org/apache/tamaya/spi/PropertySource.java index c2b5261..f09f41c 100644 --- a/code/api/src/main/java/org/apache/tamaya/spi/PropertySource.java +++ b/code/api/src/main/java/org/apache/tamaya/spi/PropertySource.java @@ -60,7 +60,7 @@ public interface PropertySource { *
  • JNDI values (ordinal 200)
  • *
  • Properties file values (/META-INF/applicationConfiguration.properties) (ordinal 100)
  • * - *

    + * *

    Important Hints for custom implementations:

    *

    * If a custom implementation should be invoked before the default implementations, use a value > 400 http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java ---------------------------------------------------------------------- diff --git a/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java b/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java index cdd481e..2fba4c4 100644 --- a/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java +++ b/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java @@ -50,6 +50,7 @@ public interface ServiceContext { * * @param serviceType * the service type. + * @param the type of the list element returned by this method * @return The instance to be used, never {@code null} */ List getServices(Class serviceType); http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/code/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java ---------------------------------------------------------------------- diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java b/code/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java index 2a15e1d..038bccc 100644 --- a/code/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java +++ b/code/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java @@ -198,7 +198,7 @@ public class PropertyConverterManager { /** * Get the list of all current registered converters for the given target type. * If not converters are registered, they component tries to create and register a dynamic - * converter based on String costructor or static factory methods available.
    + * converter based on String costructor or static factory methods available. * The converters provided are of the following type and returned in the following order: *

      *
    • Converters mapped explicitly to the required target type are returned first, ordered http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java ---------------------------------------------------------------------- diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java index 50fded7..f774693 100644 --- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java +++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java @@ -31,7 +31,8 @@ import java.util.logging.Logger; * Converter, converting from String to Currency, the supported format is one of the following: *
        *
      • CHF (currency code)
      • - *
      • 123 (numeric currency value >= 0)
      • + *
      • 123 (numeric currency value > + * = 0)
      • *
      • DE (ISO 2-digit country)
      • *
      • de_DE, de_DE_123 (Locale)
      • *
      http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java ---------------------------------------------------------------------- diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java index 83fd3c0..c222090 100644 --- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java +++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java @@ -29,11 +29,11 @@ import java.util.logging.Logger; /** * Converter, converting from String to Number. Valid inputs are: *
      - *     POSITIVE_INFINITY -> Double.POSITIVE_INFINITY
      - *     NEGATIVE_INFINITY -> Double.NEGATIVE_INFINITY
      - *     NaN -> Double.NaN
      - *     0xFFDCD3D2 -> Long
      - *     1234566789.23642327352735273752 -> new BigDecimal(input)
      + *     POSITIVE_INFINITY -> Double.POSITIVE_INFINITY
      + *     NEGATIVE_INFINITY -> Double.NEGATIVE_INFINITY
      + *     NaN > Double.NaN
      + *     0xFFDCD3D2 -> Long
      + *     1234566789.23642327352735273752 -> new BigDecimal(input)
        * 
      */ public class NumberConverter implements PropertyConverter{ http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/code/core/src/main/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySource.java ---------------------------------------------------------------------- diff --git a/code/core/src/main/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySource.java b/code/core/src/main/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySource.java index a8a1b11..c8c1aa3 100644 --- a/code/core/src/main/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySource.java +++ b/code/core/src/main/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySource.java @@ -24,8 +24,8 @@ import java.util.Map; /** * This {@link org.apache.tamaya.spi.PropertySource} provides all Properties which are set - * via
      - * {@code export myprop=myval} on UNIX Systems or
      + * via + * {@code export myprop=myval} on UNIX Systems or * {@code set myprop=myval} on Windows */ public class EnvironmentPropertySource implements PropertySource { http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/examples/5-injection-example/pom.xml ---------------------------------------------------------------------- diff --git a/examples/5-injection-example/pom.xml b/examples/5-injection-example/pom.xml index 94df7f5..ec7a24f 100644 --- a/examples/5-injection-example/pom.xml +++ b/examples/5-injection-example/pom.xml @@ -27,6 +27,10 @@ under the License. tamaya-example-injection org.apache.tamaya.examples + + 1.0 + + Apache Tamaya Example: Configuration Injection This project contains a simple illustrating how configuration values can be injected. jar @@ -48,6 +52,17 @@ under the License. 4.12 test + + org.apache.geronimo.specs + geronimo-jcdi_1.1_spec + ${geronimo-jcdi-1.1-spec.version} + + + org.apache.geronimo.specs + geronimo-atinject_1.0_spec + 1.0 + + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/builder/src/main/java/org/apache/tamaya/builder/ConfigurationBuilder.java ---------------------------------------------------------------------- diff --git a/modules/builder/src/main/java/org/apache/tamaya/builder/ConfigurationBuilder.java b/modules/builder/src/main/java/org/apache/tamaya/builder/ConfigurationBuilder.java index ad92d51..5126cea 100644 --- a/modules/builder/src/main/java/org/apache/tamaya/builder/ConfigurationBuilder.java +++ b/modules/builder/src/main/java/org/apache/tamaya/builder/ConfigurationBuilder.java @@ -527,7 +527,6 @@ public class ConfigurationBuilder { * @return the builder instance currently used * * @see org.apache.tamaya.spi.PropertySourceProvider - * @see */ public ConfigurationBuilder enableProvidedPropertySourceProviders() { checkBuilderState(); http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/AbstractClassloaderAwareItemLoader.java ---------------------------------------------------------------------- diff --git a/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/AbstractClassloaderAwareItemLoader.java b/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/AbstractClassloaderAwareItemLoader.java index 0c90653..775d778 100644 --- a/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/AbstractClassloaderAwareItemLoader.java +++ b/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/AbstractClassloaderAwareItemLoader.java @@ -30,13 +30,15 @@ import java.util.logging.Logger; /** - * This class implements an abstract base class, which basically provides a loading mechanism that supports + *

      This class implements an abstract base class, which basically provides a loading mechanism that supports * loading and managing resources along the classloader hierarchies individually. It ensures resources are loaded * and stored related to the each target classloader within the hierarchy individually. Additionally it enables - * mechanisms to ensure an item T is not loaded multiple times, when traversing up the classloader hierarchy.

      - * Finally classloaders are not stored by reference by this class, to ensure they still can be garbage collected. + * mechanisms to ensure an item T is not loaded multiple times, when traversing up the classloader hierarchy.

      + * + *

      Finally classloaders are not stored by reference by this class, to ensure they still can be garbage collected. * Instead this class uses the fully qualified class name of the loader and the corresponsing hashCode as returned - * by {@link Objects#hashCode(Object)}. + * by {@link Objects#hashCode(Object)}.

      + * * @param the managed item type. */ public abstract class AbstractClassloaderAwareItemLoader { @@ -122,7 +124,6 @@ public abstract class AbstractClassloaderAwareItemLoader { * * @param currentItemSet the current found ItemContainer instance to be updated. * @param classLoader the classloader, not null. - * @return */ protected abstract void updateItem(T currentItemSet, ClassLoader classLoader); @@ -131,7 +132,7 @@ public abstract class AbstractClassloaderAwareItemLoader { * This prevents the storage of classloader references as keys and therefore enables classloaders not used anymore * to be garbage collected. * - * @param classLoader + * @param classLoader {@link ClassLoader} to be identified, must not be {@code null}. * @return the unique key for the given classloader */ public static String getClassLoaderID(ClassLoader classLoader) { http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/CLAwareServiceContext.java ---------------------------------------------------------------------- diff --git a/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/CLAwareServiceContext.java b/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/CLAwareServiceContext.java index 392d8b1..a5d1700 100644 --- a/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/CLAwareServiceContext.java +++ b/modules/classloader-support/src/main/java/org/apache/tamaya/clsupport/CLAwareServiceContext.java @@ -32,16 +32,18 @@ import java.util.logging.Logger; /** - * This class implements a {@link ServiceContext}, which basically provides a similar loading mechanism as used + *

      This class implements a {@link ServiceContext}, which basically provides a similar loading mechanism as used * by the {@link java.util.ServiceLoader}. Whereas the {@link java.util.ServiceLoader} only loads configurations * and instances from one classloader, this loader manages configs found and the related instances for each * classloader along the classloader hierarchies individually. It ensures instances are loaded on the classloader * level, where they first are visible. Additionally it ensures the same configuration resource (and its - * declared services) are loaded multiple times, when going up the classloader hierarchy.

      - * Finally classloaders are not stored by reference by this class, to ensure they still can be garbage collected. - * Refer also the inherited parent class for further details.

      - * This class uses an ordinal of {@code 10}, so it overrides any default {@link ServiceContext} implementations - * provided with the Tamaya core modules. + * declared services) are loaded multiple times, when going up the classloader hierarchy.

      + * + *

      Finally classloaders are not stored by reference by this class, to ensure they still can be garbage collected. + * Refer also the inherited parent class for further details.

      + * + *

      This class uses an ordinal of {@code 10}, so it overrides any default {@link ServiceContext} implementations + * provided with the Tamaya core modules.

      */ @Priority(10) public class CLAwareServiceContext extends AbstractClassloaderAwareItemLoader http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationData.java ---------------------------------------------------------------------- diff --git a/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationData.java b/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationData.java index 30ebd2e..4589972 100644 --- a/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationData.java +++ b/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationData.java @@ -21,9 +21,9 @@ package org.apache.tamaya.format; import java.util.*; /** - * Data that abstracts the data read from a configuration resources using a certain format. The data can be divided + *

      Data that abstracts the data read from a configuration resources using a certain format. The data can be divided * into different sections, similar to ini-files. Herebey different sections the best map to entries with different - * priorities to be applied, when integrated into PropertySource instances.
      + * priorities to be applied, when integrated into PropertySource instances.

      * New instances of this class can be created using a {@link org.apache.tamaya.format.ConfigurationDataBuilder}. *

      Implementation Specification

      * This class is http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java ---------------------------------------------------------------------- diff --git a/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java b/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java index 37ff92e..997ef3a 100644 --- a/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java +++ b/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java @@ -22,13 +22,14 @@ import java.io.InputStream; import java.net.URL; /** - * Implementations current this class encapsulate the mechanism how to read a + *

      Implementations current this class encapsulate the mechanism how to read a * resource including interpreting the format correctly (e.g. xml vs. * properties vs. ini). In most cases file only contains entries of the same priority, which would then * result in only one {@link org.apache.tamaya.spi.PropertySource}. Complex file formats, however, may contain entries * of different priorities. In this cases, each ordinal type found typically is returned as a separate section so the * consuming {@link org.apache.tamaya.spi.PropertySourceProvider} implementation can distribute the different part to - * individual {@link org.apache.tamaya.spi.PropertySource}s.

      + * individual {@link org.apache.tamaya.spi.PropertySource}s.

      + * *

      Implementation Requirements

      * Implementations of this type must be *
        http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/formats/src/main/java/org/apache/tamaya/format/InputStreamFactory.java ---------------------------------------------------------------------- diff --git a/modules/formats/src/main/java/org/apache/tamaya/format/InputStreamFactory.java b/modules/formats/src/main/java/org/apache/tamaya/format/InputStreamFactory.java index 89ec45b..3084db6 100644 --- a/modules/formats/src/main/java/org/apache/tamaya/format/InputStreamFactory.java +++ b/modules/formats/src/main/java/org/apache/tamaya/format/InputStreamFactory.java @@ -26,9 +26,9 @@ import java.util.logging.Logger; /** * Wrapper for a given {@link InputStream} to be able to close * it via the try-with-resources construct of Java 7. - *

        + * *

        Usage example

        - *

        + * *

          * public void readIt(InputStream inputStream) {
          *    try (InputStream is = new ParallelInputStream(inputStream) {
        
        http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/BaseDynamicValue.java
        ----------------------------------------------------------------------
        diff --git a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/BaseDynamicValue.java b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/BaseDynamicValue.java
        index 4c05da1..2f8c559 100644
        --- a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/BaseDynamicValue.java
        +++ b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/BaseDynamicValue.java
        @@ -22,12 +22,14 @@ package org.apache.tamaya.inject.api;
         import java.io.Serializable;
         
         /**
        - * A accessor for a single configured value. This can be used to support values that may change during runtime,
        + * 

        A accessor for a single configured value. This can be used to support values that may change during runtime, * reconfigured or final. Hereby external code (could be Tamaya configuration listners or client code), can set a * new value. Depending on the {@link UpdatePolicy} the new value is immedeately active or it requires an active commit - * by client code. Similarly an instance also can ignore all later changes to the value.
        - * Types of this interface can be used as injection targets in injected beans or as template resiult on configuration - * templates. + * by client code. Similarly an instance also can ignore all later changes to the value.

        + * + *

        Types of this interface can be used as injection targets in injected beans or as template resiult on configuration + * templates.

        + * *

        Implementation Specification

        * Implementation of this interface must be *
          http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/Config.java ---------------------------------------------------------------------- diff --git a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/Config.java b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/Config.java index d39c626..cceddad 100644 --- a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/Config.java +++ b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/Config.java @@ -26,44 +26,45 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -/** - * Annotation to enable injection current a configured property or define the returned data for - * a configuration template method. Hereby this annotation can be used in multiple ways and combined - * with other annotations such as {@link ConfigDefault}, {@link WithConfigOperator}, {@link WithPropertyConverter}. - * - * Below the most simple variant current a configured class is given: - * {@code - * pubic class ConfiguredItem{ - * - * @ConfiguredProperty - * private String aValue; - * } - * When this class is configured, e.g. by passing it to {@link org.apache.tamaya.Configuration#configure(Object)}, - * the following is happening: - *
            - *
          • The current valid Configuration is evaluated by calling {@code Configuration cfg = ConfigurationProvider.getConfiguration();}
          • - *
          • The current possible property keys are evaluated by calling {@code cfg.get("aValue");}
          • - *
          • if not successful, and a @ConfigDefault annotation is present, the default value is used. - *
          • If no value could be evaluated a ({@link org.apache.tamaya.ConfigException} is thrown.
          • - *
          • On success, since no type conversion is involved, the value is injected.
          • - *
          - * - * In the next example we explicitly define the property keys: - * {@code - * @ConfigDefaultSections("section1") - * pubic class ConfiguredItem{ - * - * @ConfiguredProperty({"b", "[a.b.deprecated.keys]", "a"}) - * @ConfigDefault("myDefaultValue") - * private String aValue; - * } - * - * Within this example we evaluate multiple possible keys (section1.b, a.b.deprecated.keys, section1.a). Evaluation is - * aborted if a key could be successfully resolved. Hereby the ordering current the annotations define the ordering - * current resolution, so in the example above - * resolution equals to {@code "section1.b", "a.b.deprecated.keys", "section1.a"}. If no value has bee found, - * the configured default {@code myDefaultValue} is returned. - */ +/** todo The author of this should fix this invalid Javadoc. Oliver B. Fischer, 2015-12-27 */ +///** +// * Annotation to enable injection current a configured property or define the returned data for +// * a configuration template method. Hereby this annotation can be used in multiple ways and combined +// * with other annotations such as {@link ConfigDefault}, {@link WithConfigOperator}, {@link WithPropertyConverter}. +// * +// * Below the most simple variant current a configured class is given: +// * {@code +// * pubic class ConfiguredItem{ +// * +// * @ConfiguredProperty +// * private String aValue; +// * } +// * When this class is configured, e.g. by passing it to {@link org.apache.tamaya.Configuration#configure(Object)}, +// * the following is happening: +// *
            +// *
          • The current valid Configuration is evaluated by calling {@code Configuration cfg = ConfigurationProvider.getConfiguration();}
          • +// *
          • The current possible property keys are evaluated by calling {@code cfg.get("aValue");}
          • +// *
          • if not successful, and a @ConfigDefault annotation is present, the default value is used. +// *
          • If no value could be evaluated a ({@link org.apache.tamaya.ConfigException} is thrown.
          • +// *
          • On success, since no type conversion is involved, the value is injected.
          • +// *
          +// * +// * In the next example we explicitly define the property keys: +// * {@code +// * @ConfigDefaultSections("section1") +// * pubic class ConfiguredItem{ +// * +// * @ConfiguredProperty({"b", "[a.b.deprecated.keys]", "a"}) +// * @ConfigDefault("myDefaultValue") +// * private String aValue; +// * } +// * +// * Within this example we evaluate multiple possible keys (section1.b, a.b.deprecated.keys, section1.a). Evaluation is +// * aborted if a key could be successfully resolved. Hereby the ordering current the annotations define the ordering +// * current resolution, so in the example above +// * resolution equals to {@code "section1.b", "a.b.deprecated.keys", "section1.a"}. If no value has bee found, +// * the configured default {@code myDefaultValue} is returned. +// */ @Qualifier @Retention(RetentionPolicy.RUNTIME) @Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER }) http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/ConfigDefaultSections.java ---------------------------------------------------------------------- diff --git a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/ConfigDefaultSections.java b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/ConfigDefaultSections.java index c6cec50..2037de6 100644 --- a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/ConfigDefaultSections.java +++ b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/ConfigDefaultSections.java @@ -23,13 +23,14 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -/** - * Annotation to control injection and resolution current a configured bean. The configuration keys - * to be resolved are basically determined by the {@link org.apache.tamaya.inject.ConfigProperty} - * annotation(s). Nevertheless these annotations can also have relative key names. This annotation allows - * to define a configuration area that is prefixed to all relative configuration keys within the - * corresponding class/template interface. - */ +/** todo The author of this should fix this invalid Javadoc. Oliver B. Fischer, 2015-12-27 */ +///** +// * Annotation to control injection and resolution current a configured bean. The configuration keys +// * to be resolved are basically determined by the {@link org.apache.tamaya.inject.ConfigProperty} +// * annotation(s). Nevertheless these annotations can also have relative key names. This annotation allows +// * to define a configuration area that is prefixed to all relative configuration keys within the +// * corresponding class/template interface. +// */ @Retention(RetentionPolicy.RUNTIME) @Target(value = { ElementType.TYPE }) public @interface ConfigDefaultSections { http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/DynamicValue.java ---------------------------------------------------------------------- diff --git a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/DynamicValue.java b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/DynamicValue.java index 8324f95..4cc29da 100644 --- a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/DynamicValue.java +++ b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/DynamicValue.java @@ -22,18 +22,21 @@ import java.beans.PropertyChangeListener; /** - * A accessor for a single configured value. This can be used to support values that may change during runtime, + *

          A accessor for a single configured value. This can be used to support values that may change during runtime, * reconfigured or final. Hereby external code (could be Tamaya configuration listners or client code), can set a * new value. Depending on the {@link UpdatePolicy} the new value is immedeately active or it requires an active commit - * by client code. Similarly an instance also can ignore all later changes to the value.
          - * Types of this interface can be used as injection targets in injected beans or as template resiult on configuration - * templates. + * by client code. Similarly an instance also can ignore all later changes to the value.

          + * + *

          Types of this interface can be used as injection targets in injected beans or as template resiult on configuration + * templates.

          + * *

          Implementation Specification

          * Implementation of this interface must be *
            *
          • Serializable, when also the item stored is serializable
          • *
          • Thread safe
          • *
          + * * @param The type of the value. */ public interface DynamicValue { http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java ---------------------------------------------------------------------- diff --git a/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java b/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java index a847db8..831c36a 100644 --- a/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java +++ b/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java @@ -35,16 +35,18 @@ import java.util.concurrent.ConcurrentHashMap; /** - * This class implements a {@link ServiceContext}, which basically provides a similar loading mechanism as used + *

          This class implements a {@link ServiceContext}, which basically provides a similar loading mechanism as used * by the {@link java.util.ServiceLoader}. Whereas the {@link java.util.ServiceLoader} only loads configurations * and instances from one classloader, this loader manages configs found and the related instances for each * classloader along the classloader hierarchies individually. It ensures instances are loaded on the classloader * level, where they first are visible. Additionally it ensures the same configuration resource (and its - * declared services) are loaded multiple times, when going up the classloader hierarchy.

          - * Finally classloaders are not stored by reference by this class, to ensure they still can be garbage collected. - * Refer also the inherited parent class for further details.

          - * This class uses an ordinal of {@code 10}, so it overrides any default {@link ServiceContext} implementations - * provided with the Tamaya core modules. + * declared services) are loaded multiple times, when going up the classloader hierarchy.

          + * + *

          Finally classloaders are not stored by reference by this class, to ensure they still can be garbage collected. + * Refer also the inherited parent class for further details.

          + * + *

          This class uses an ordinal of {@code 10}, so it overrides any default {@link ServiceContext} implementations + * provided with the Tamaya core modules.

          */ public class CDIAwareServiceContext implements ServiceContext { /** http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/PropertyConverterManager.java ---------------------------------------------------------------------- diff --git a/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/PropertyConverterManager.java b/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/PropertyConverterManager.java index e10b2da..789d5ed 100644 --- a/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/PropertyConverterManager.java +++ b/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/PropertyConverterManager.java @@ -190,10 +190,11 @@ public class PropertyConverterManager { } /** - * Get the list of all current registered converters for the given target type. + *

          Get the list of all current registered converters for the given target type. * If not converters are registered, they component tries to create and register a dynamic - * converter based on String costructor or static factory methods available.
          - * The converters provided are of the following type and returned in the following order: + * converter based on String costructor or static factory methods available.

          + * + *

          The converters provided are of the following type and returned in the following order:

          *
            *
          • Converters mapped explicitly to the required target type are returned first, ordered * by decreasing priority. This means, if explicit converters are registered these are used @@ -207,10 +208,10 @@ public class PropertyConverterManager { * compares the configuration values with the different enum members defined (cases sensitive mapping).
          • *
          * - * So given that list above directly registered mappings always are tried first, before any transitive mapping + *

          So given that list above directly registered mappings always are tried first, before any transitive mapping * should be used. Also in all cases @Priority annotations are honored for ordering of the converters in place. * Transitive conversion is supported for all directly implemented interfaces (including inherited ones) and - * the inheritance hierarchy (exception Object). Superinterfaces of implemented interfaces are ignored. + * the inheritance hierarchy (exception Object). Super interfaces of implemented interfaces are ignored.

          * * * @param targetType the target type, not null. http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/TamayaCDIIntegration.java ---------------------------------------------------------------------- diff --git a/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/TamayaCDIIntegration.java b/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/TamayaCDIIntegration.java index 4357242..09ca92a 100644 --- a/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/TamayaCDIIntegration.java +++ b/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/TamayaCDIIntegration.java @@ -43,7 +43,6 @@ public class TamayaCDIIntegration implements Extension{ /** * Get the current {@link BeanManager} instance. - * @return */ public static BeanManager getBeanManager(){ return beanManager; http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/integration/osgi/src/main/java/org/apache/tamaya/integration/osgi/Activator.java ---------------------------------------------------------------------- diff --git a/modules/integration/osgi/src/main/java/org/apache/tamaya/integration/osgi/Activator.java b/modules/integration/osgi/src/main/java/org/apache/tamaya/integration/osgi/Activator.java index 1eb78fe..d5378ba 100644 --- a/modules/integration/osgi/src/main/java/org/apache/tamaya/integration/osgi/Activator.java +++ b/modules/integration/osgi/src/main/java/org/apache/tamaya/integration/osgi/Activator.java @@ -38,10 +38,10 @@ import java.util.logging.Logger; * Activator that registers the Tamaya based Service Class for {@link ConfigurationAdmin}, * using a default service priority of {@code 0}. This behaviour is configurable based on OSGI properties: *
            - *
          • org.tamaya.integration.osgi.cm.ranking, type: int allows to configure the OSGI service ranking for - * Tamaya based ConfigurationAdmin instance. The default ranking used is 10.
          • - *
          • org.tamaya.integration.osgi.cm.override, type: boolean
          • allows to configure if Tamaya should - * register its ConfigAdmin service. Default is true. + *
          • org.tamaya.integration.osgi.cm.ranking, type: int allows to configure the OSGI service ranking for + * Tamaya based ConfigurationAdmin instance. The default ranking used is 10.

          • + *
          • org.tamaya.integration.osgi.cm.override, type: boolean allows to configure if Tamaya should + * register its ConfigAdmin service. Default is true.

          • *
          */ public class Activator implements BundleActivator { http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java ---------------------------------------------------------------------- diff --git a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java index 3a2e0f1..9f52c92 100644 --- a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java +++ b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java @@ -86,7 +86,7 @@ public class DefaultExpressionEvaluator implements ExpressionEvaluator { /** * Resolves an expression in the form current ${resolverId:expression} or - * ${expression}. The expression can be + * ${<prefix>expression}. The expression can be * part current any type current literal text. Also multiple expressions with mixed matching resolvers are * supported. * All control characters (${}\) can be escaped using '\'.
          http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ExpressionResolutionFilter.java ---------------------------------------------------------------------- diff --git a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ExpressionResolutionFilter.java b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ExpressionResolutionFilter.java index 30909dc..6cc3557 100644 --- a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ExpressionResolutionFilter.java +++ b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ExpressionResolutionFilter.java @@ -39,7 +39,7 @@ public class ExpressionResolutionFilter implements PropertyFilter { /** * Resolves an expression in the form current ${resolverId:expression} or - * ${expression}. The expression can be + * ${<prefix>expression}. The expression can be * part current any type current literal text. Also multiple expressions with mixed matching resolvers are * supported. * All control characters (${}\) can be escaped using '\'.
          http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/FileResolver.java ---------------------------------------------------------------------- diff --git a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/FileResolver.java b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/FileResolver.java index dffc74b..a8ba58d 100644 --- a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/FileResolver.java +++ b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/FileResolver.java @@ -35,10 +35,10 @@ import java.util.logging.Logger; import static java.nio.charset.StandardCharsets.UTF_8; /** - * Property resolver implementation that tries to load the given resource from the current file system. - *
          - * If the {@code Resources} module is available this module is used for resolving the expression. It can be - * explicitly addressed by prefixing {@code file:}, e.g. {@code ${file:c:/temp/mytext.txt}}. + *

          Property resolver implementation that tries to load the given resource from the current file system.

          + * + *

          If the {@code Resources} module is available this module is used for resolving the expression. It can be + * explicitly addressed by prefixing {@code file:}, e.g. {@code ${file:c:/temp/mytext.txt}}.

          */ @Priority(400) public final class FileResolver implements ExpressionResolver { http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ResourceResolver.java ---------------------------------------------------------------------- diff --git a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ResourceResolver.java b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ResourceResolver.java index 0068804..6fa16a5 100644 --- a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ResourceResolver.java +++ b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/ResourceResolver.java @@ -35,11 +35,11 @@ import java.util.logging.Logger; import static java.nio.charset.StandardCharsets.UTF_8; /** - * Property resolver implementation that tries to load the given resource from the current classpath using the + *

          Property resolver implementation that tries to load the given resource from the current classpath using the * Thread Context classloader, and as fallback from the classloader that loaded this module and system classloader. - * It can be explicitly addressed by prefixing {@code resource:}, e.g. {@code ${resource:META-INF/VERSION}}. - *
          - * If the {@code Resources} module is available this module is used for resolving the expression. + * It can be explicitly addressed by prefixing {@code resource:}, e.g. {@code ${resource:META-INF/VERSION}}.

          + * + *

          If the {@code Resources} module is available this module is used for resolving the expression.

          */ @Priority(300) public final class ResourceResolver implements ExpressionResolver { http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/resources/src/main/java/org/apache/tamaya/resource/ConfigResources.java ---------------------------------------------------------------------- diff --git a/modules/resources/src/main/java/org/apache/tamaya/resource/ConfigResources.java b/modules/resources/src/main/java/org/apache/tamaya/resource/ConfigResources.java index 9f4650a..ce268ab 100644 --- a/modules/resources/src/main/java/org/apache/tamaya/resource/ConfigResources.java +++ b/modules/resources/src/main/java/org/apache/tamaya/resource/ConfigResources.java @@ -32,11 +32,13 @@ public final class ConfigResources { private ConfigResources(){} /** - * Access the current ResourceResolver. + *

          Access the current ResourceResolver.

          + * + * @throws ConfigException if no ResourceResolver is available (should not happen). + * * @return the current ResourceResolver instance, never null. - * @throws org.apache.tamaya.ConfigException, if no ResourceResolver is available (should not happen). */ - public static ResourceResolver getResourceResolver(){ + public static ResourceResolver getResourceResolver() throws ConfigException { ResourceResolver resolver = ServiceContextManager.getServiceContext().getService(ResourceResolver.class); if (resolver == null) { throw new ConfigException("ResourceResolver not available."); http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/resources/src/main/java/org/apache/tamaya/resource/ResourceResolver.java ---------------------------------------------------------------------- diff --git a/modules/resources/src/main/java/org/apache/tamaya/resource/ResourceResolver.java b/modules/resources/src/main/java/org/apache/tamaya/resource/ResourceResolver.java index 784b54b..911bea3 100644 --- a/modules/resources/src/main/java/org/apache/tamaya/resource/ResourceResolver.java +++ b/modules/resources/src/main/java/org/apache/tamaya/resource/ResourceResolver.java @@ -87,9 +87,8 @@ public interface ResourceResolver { * there is no determined ordering of format located within a classloader. * * @param expressions the expressions to be resolved, not empty. - * @return the corresponding collection of current {@link URL}s found, never - * null. - * . + * @return the corresponding collection of current {@link URL}s found, + * never {@code null}. */ Collection getResources(ClassLoader classLoader, Collection expressions); http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java ---------------------------------------------------------------------- diff --git a/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java b/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java index a91ffc2..3462e40 100644 --- a/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java +++ b/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java @@ -59,11 +59,13 @@ public final class ScopeManager { /** * Get the scope given its name. + * + * @throws ConfigException if no such scope is defined * @param scopeId the scope name * @return the scope matching - * @throws ConfigException, if nos such scope is defined. */ - public static ConfigOperator getScope(String scopeId, String target){ + public static ConfigOperator getScope(String scopeId, String target) + throws ConfigException { ScopeProvider prov = scopeProviders.get(scopeId); if(prov==null){ throw new ConfigException("No such scope: " + scopeId); http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4dd68204/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/PropertyConverterManager.java ---------------------------------------------------------------------- diff --git a/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/PropertyConverterManager.java b/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/PropertyConverterManager.java index a349547..79f9fbf 100644 --- a/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/PropertyConverterManager.java +++ b/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/PropertyConverterManager.java @@ -212,8 +212,10 @@ public class PropertyConverterManager { /** * Get the list of all current registered converters for the given target type. * If not converters are registered, they component tries to create and register a dynamic - * converter based on String costructor or static factory methods available.
          - * The converters provided are of the following type and returned in the following order: + * converter based on String costructor or static factory methods available. + * + *

          The converters provided are of the following type and returned in the following order:

          + * *
            *
          • Converters mapped explicitly to the required target type are returned first, ordered * by decreasing priority. This means, if explicit converters are registered these are used @@ -227,6 +229,7 @@ public class PropertyConverterManager { * compares the configuration values with the different enum members defined (cases sensitive mapping).
          • *
          * + * * So given that list above directly registered mappings always are tried first, before any transitive mapping * should be used. Also in all cases @Priority annotations are honored for ordering of the converters in place. * Transitive conversion is supported for all directly implemented interfaces (including inherited ones) and