Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 07725200D45 for ; Thu, 23 Nov 2017 23:32:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 05E25160C12; Thu, 23 Nov 2017 22:32:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CF65C160BED for ; Thu, 23 Nov 2017 23:32:05 +0100 (CET) Received: (qmail 21044 invoked by uid 500); 23 Nov 2017 22:32:05 -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 21032 invoked by uid 99); 23 Nov 2017 22:32:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2017 22:32:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E327C1A0E5A for ; Thu, 23 Nov 2017 22:32:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.021 X-Spam-Level: X-Spam-Status: No, score=-3.021 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_MANYCOMMENTS=1.2, KAM_SHORT=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id TIU0e_V4rI82 for ; Thu, 23 Nov 2017 22:31:45 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 798E75F5B8 for ; Thu, 23 Nov 2017 22:31:44 +0000 (UTC) Received: (qmail 19718 invoked by uid 99); 23 Nov 2017 22:31:43 -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; Thu, 23 Nov 2017 22:31:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AB695F5FE7; Thu, 23 Nov 2017 22:31:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pottlinger@apache.org To: commits@tamaya.incubator.apache.org Date: Thu, 23 Nov 2017 22:31:46 -0000 Message-Id: <2a25e52baead478e91571e1b15c908bd@git.apache.org> In-Reply-To: <7df5400c06a7463c8a12aaf711100647@git.apache.org> References: <7df5400c06a7463c8a12aaf711100647@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/41] incubator-tamaya-site git commit: TAMAYA-318: Update javadoc on homepage. archived-at: Thu, 23 Nov 2017 22:32:08 -0000 http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/1be99c52/apidocs/development/org/apache/tamaya/spisupport/propertysource/BuildablePropertySourceProvider.html ---------------------------------------------------------------------- diff --git a/apidocs/development/org/apache/tamaya/spisupport/propertysource/BuildablePropertySourceProvider.html b/apidocs/development/org/apache/tamaya/spisupport/propertysource/BuildablePropertySourceProvider.html new file mode 100644 index 0000000..504e480 --- /dev/null +++ b/apidocs/development/org/apache/tamaya/spisupport/propertysource/BuildablePropertySourceProvider.html @@ -0,0 +1,398 @@ + + + + + + +BuildablePropertySourceProvider (Apache Tamaya Base 0.4-incubating-SNAPSHOT API) + + + + + + + + + + + + + + + + + +
+
org.apache.tamaya.spisupport.propertysource
+

Class BuildablePropertySourceProvider

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.tamaya.spisupport.propertysource.BuildablePropertySourceProvider
    • +
    +
  • +
+
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2014–2017 Apache Software Foundation. All rights reserved.

+ + http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/1be99c52/apidocs/development/org/apache/tamaya/spisupport/propertysource/CLIPropertySource.html ---------------------------------------------------------------------- diff --git a/apidocs/development/org/apache/tamaya/spisupport/propertysource/CLIPropertySource.html b/apidocs/development/org/apache/tamaya/spisupport/propertysource/CLIPropertySource.html new file mode 100644 index 0000000..f705edd --- /dev/null +++ b/apidocs/development/org/apache/tamaya/spisupport/propertysource/CLIPropertySource.html @@ -0,0 +1,409 @@ + + + + + + +CLIPropertySource (Apache Tamaya Base 0.4-incubating-SNAPSHOT API) + + + + + + + + + + + + + + + +
+
org.apache.tamaya.spisupport.propertysource
+

Class CLIPropertySource

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    PropertySource
    +
    +
    +
    +
    public class CLIPropertySource
    +extends BasePropertySource
    +
    PropertySource that allows to add the programs main arguments as configuration entries. Unix syntax using '--' and + '-' params is supported.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CLIPropertySource

        +
        public CLIPropertySource()
        +
        Creates a new instance.
        +
      • +
      + + + +
        +
      • +

        CLIPropertySource

        +
        public CLIPropertySource(String... args)
        +
        Creates a new instance, allows optionally to pass the main arguments.
        +
        +
        Parameters:
        +
        args - the args, or null.
        +
        +
      • +
      + + + +
        +
      • +

        CLIPropertySource

        +
        public CLIPropertySource(int ordinal,
        +                         String... args)
        +
        Creates a new instance, allows optionally to pass the main arguments.
        +
        +
        Parameters:
        +
        args - the args, or null.
        +
        ordinal - the ordinal to be applied.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        initMainArgs

        +
        public static void initMainArgs(String... args)
        +
        Configure the main arguments, hereby parsing and mapping the main arguments into + configuration propertiesi as key-value pairs.
        +
        +
        Parameters:
        +
        args - the main arguments, not null.
        +
        +
      • +
      + + + +
        +
      • +

        getProperties

        +
        public Map<String,PropertyValue> getProperties()
        +
        Description copied from interface: PropertySource
        +
        Access the current properties as Set. The resulting Map may not return all items accessible, e.g. + when the underlying storage does not support iteration of its entries. + null
        +
        +
        Returns:
        +
        the corresponding map, never null.
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2014–2017 Apache Software Foundation. All rights reserved.

+ + http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/1be99c52/apidocs/development/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.html ---------------------------------------------------------------------- diff --git a/apidocs/development/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.html b/apidocs/development/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.html new file mode 100644 index 0000000..86c39fe --- /dev/null +++ b/apidocs/development/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.html @@ -0,0 +1,614 @@ + + + + + + +EnvironmentPropertySource (Apache Tamaya Base 0.4-incubating-SNAPSHOT API) + + + + + + + + + + + + + + + + + + + + +
+
org.apache.tamaya.spisupport.propertysource
+

Class EnvironmentPropertySource

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    PropertySource
    +
    +
    +
    +
    public class EnvironmentPropertySource
    +extends BasePropertySource
    +

    PropertySource to access environment variables via Tamaya + which are set via export VARIABLE=value on UNIX systems or + set VARIABLE=value on Windows systems.

    + +

    Using the EnvironmentPropertySource without any + additional configuration gives access to all existing environment + variables available to the Java process Tamaya is running in.

    + +

    Simple usage example

    + +
    + $ export OPS_MODE=production
    + $ export COLOR=false
    + $ java -jar application.jar
    + 
    + +

    To access OPS_MODE and COLOR with the following code + fragment could be used:

    + +
    + PropertySource ps = new EnvironmentPropertySource();
    + PropertyValue opsMode = ps.get("OPS_MODE");
    + PropertyValue color = ps.get("COLOR");
    + 
    + +

    Application specific environmet variables with prefix

    + +

    Given the case where to instances of the same application are running on + a single machine but need different values for the environment variable + CUSTOMER. The EnvironmentPropertySource allows you + to prefix the environment variable with an application specific prefix + and to access it by the non-prefixed variable name.

    + +
    + $ export CUSTOMER=none
    + $ export a81.CUSTOMER=moon
    + $ export b78.CUSTOMER=luna
    + 
    + +

    Given an environment with these tree variables the application running + for the customer called Moon could be started with the following command:

    + +
    + $ java -Dtamaya.envprops.prefix=a81 -jar application.jar
    + 
    + +

    The application specific value can now be accessed from the code of the + application like this:

    + +
    + PropertySource ps = new EnvironmentPropertySource();
    + PropertyValue pv = ps.get("CUSTOMER");
    + System.out.println(pv.getValue());
    + 
    + +

    The output of application would be moon.

    + +

    Disabling the access to environment variables

    + +

    The access to environment variables could be simply + disabled by the setting the systemproperty tamaya.envprops.disable + or tamaya.defaults.disable to true.

    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        EnvironmentPropertySource

        +
        public EnvironmentPropertySource()
        +
        Creates a new instance. Also initializes the prefix and disabled properties + from the system-/ environment properties: +
        +     tamaya.envprops.prefix
        +     tamaya.envprops.disable
        + 
        +
      • +
      + + + +
        +
      • +

        EnvironmentPropertySource

        +
        public EnvironmentPropertySource(int ordinal)
        +
        Creates a new instance using a fixed ordinal value.
        +
        +
        Parameters:
        +
        ordinal - the ordinal number.
        +
        +
      • +
      + + + +
        +
      • +

        EnvironmentPropertySource

        +
        public EnvironmentPropertySource(String prefix,
        +                                 int ordinal)
        +
        Creates a new instance.
        +
        +
        Parameters:
        +
        prefix - the prefix to be used, or null.
        +
        ordinal - the ordinal to be used.
        +
        +
      • +
      + + + +
        +
      • +

        EnvironmentPropertySource

        +
        public EnvironmentPropertySource(String prefix)
        +
        Creates a new instance.
        +
        +
        Parameters:
        +
        prefix - the prefix to be used, or null.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDefaultOrdinal

        +
        public int getDefaultOrdinal()
        +
        Description copied from class: BasePropertySource
        +
        Returns the default ordinal used, when no ordinal is set, or the ordinal was not parseable to an int value.
        +
        +
        Overrides:
        +
        getDefaultOrdinal in class BasePropertySource
        +
        Returns:
        +
        the default ordinal used, by default 0.
        +
        +
      • +
      + + + +
        +
      • +

        getName

        +
        public String getName()
        +
        Description copied from interface: PropertySource
        +
        Get the name of the property source. The name should be unique for the type of source, whereas the id is used + to ensure unique identity, either locally or remotely.
        +
        +
        Specified by:
        +
        getName in interface PropertySource
        +
        Overrides:
        +
        getName in class BasePropertySource
        +
        Returns:
        +
        the configuration's name, never null.
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public PropertyValue get(String key)
        +
        Description copied from interface: PropertySource
        +
        Access a property.
        +
        +
        Specified by:
        +
        get in interface PropertySource
        +
        Overrides:
        +
        get in class BasePropertySource
        +
        Parameters:
        +
        key - the property's key, not null.
        +
        Returns:
        +
        the property value map, where map.get(key) == value, including also any metadata. In case a + value is null, simply return null.
        +
        +
      • +
      + + + +
        +
      • +

        getProperties

        +
        public Map<String,PropertyValue> getProperties()
        +
        Description copied from interface: PropertySource
        +
        Access the current properties as Set. The resulting Map may not return all items accessible, e.g. + when the underlying storage does not support iteration of its entries. + null
        +
        +
        Returns:
        +
        the corresponding map, never null.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getPrefix

        +
        public String getPrefix()
        +
      • +
      + + + +
        +
      • +

        isDisabled

        +
        public boolean isDisabled()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2014–2017 Apache Software Foundation. All rights reserved.

+ +