geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject geronimo-website git commit: Initial content for config section.
Date Wed, 20 Sep 2017 02:22:30 GMT
Repository: geronimo-website
Updated Branches:
  refs/heads/master 0dcb46b06 -> bbc0c853a


Initial content for config section.


Project: http://git-wip-us.apache.org/repos/asf/geronimo-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/geronimo-website/commit/bbc0c853
Tree: http://git-wip-us.apache.org/repos/asf/geronimo-website/tree/bbc0c853
Diff: http://git-wip-us.apache.org/repos/asf/geronimo-website/diff/bbc0c853

Branch: refs/heads/master
Commit: bbc0c853accc3580c7f0c20a7f62e637c9759b16
Parents: 0dcb46b
Author: John D. Ament <john.d.ament@gmail.com>
Authored: Tue Sep 19 22:22:26 2017 -0400
Committer: John D. Ament <john.d.ament@gmail.com>
Committed: Tue Sep 19 22:22:26 2017 -0400

----------------------------------------------------------------------
 content/config/downloads.ad | 16 ++++++++
 content/config/index.ad     | 17 ++++----
 content/config/userguide.ad | 84 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 107 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geronimo-website/blob/bbc0c853/content/config/downloads.ad
----------------------------------------------------------------------
diff --git a/content/config/downloads.ad b/content/config/downloads.ad
new file mode 100644
index 0000000..0e148cc
--- /dev/null
+++ b/content/config/downloads.ad
@@ -0,0 +1,16 @@
+title=Geronimo Config Downloads
+date=2017-09-19
+type=page
+status=published
+~~~~~~
+
+= Geronimo Config 1.0 Download Information
+|===
+|Source Download |ASC |SHA1 |MD5
+
+|link:http://www.apache.org/dyn/closer.cgi/geronimo/config/geronimo-config-1.0-source-release.zip[geronimo-config-1.0-source-release]
+|link:http://www.apache.org/dist/geronimo/config/geronimo-config-1.0-source-release.zip.asc[ASC]
+|link:http://www.apache.org/dist/geronimo/config/geronimo-config-1.0-source-release.zip.sha1[SHA1]
+|link:http://www.apache.org/dist/geronimo/config/geronimo-config-1.0-source-release.zip.md5[MD5]
+|===
+

http://git-wip-us.apache.org/repos/asf/geronimo-website/blob/bbc0c853/content/config/index.ad
----------------------------------------------------------------------
diff --git a/content/config/index.ad b/content/config/index.ad
index 3b8f788..22a7925 100644
--- a/content/config/index.ad
+++ b/content/config/index.ad
@@ -1,14 +1,11 @@
-title=Config
-date=2013-09-24
+title=Geronimo Config
+date=2017-09-19
 type=page
 status=published
 ~~~~~~
 
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vel diam purus. Curabitur
ut nisi lacus.
-Nam id nisl quam. Donec a lorem sit amet libero pretium vulputate vel ut purus. Suspendisse
leo arcu,
-mattis et imperdiet luctus, pulvinar vitae mi. Quisque fermentum sollicitudin feugiat. Mauris
nec leo
-ligula. Vestibulum tristique odio ut risus ultricies a hendrerit quam iaculis. Duis tempor
elit sit amet
-ligula vehicula et iaculis sem placerat. Fusce dictum, metus at volutpat lacinia, elit massa
auctor risus,
-id auctor arcu enim eu augue. Donec ultrices turpis in mi imperdiet ac venenatis sapien sodales.
In
-consequat imperdiet nunc quis bibendum. Nulla semper, erat quis ornare tristique, lectus
massa posuere
-libero, ut vehicula lectus nunc ut lorem. Aliquam erat volutpat.
\ No newline at end of file
+Geronimo Config is an implementation of link:http://microprofile.io/project/eclipse/microprofile-config[MicroProfile
Config] for use in both Java SE and Java EE applications.
+
+- Get started with our link:userguide.html[User Guide] and how to use Geronimo Config in
your projects
+
+- More information about link:downloads.html[Source Downloads]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/geronimo-website/blob/bbc0c853/content/config/userguide.ad
----------------------------------------------------------------------
diff --git a/content/config/userguide.ad b/content/config/userguide.ad
new file mode 100644
index 0000000..039f16d
--- /dev/null
+++ b/content/config/userguide.ad
@@ -0,0 +1,84 @@
+title=Geronimo Config User Guide
+date=2017-09-19
+type=page
+status=published
+~~~~~~
+
+= Using Geronimo Config
+
+To get started with Geronimo Config, you'll want to add the dependencies to the project.
 Eclipse MicroProfile Config is a transitive dependency, it will come in automatically as
a dependency.
+
+If you're using Maven:
+
+```
+<dependency>
+    <groupId>org.apache.geronimo.config</groupId>
+    <artifactId>geronimo-config-impl</artifactId>
+    <version>1.0</version>
+</dependency>
+```
+
+If you're using Gradle:
+
+```
+dependencies {
+     compile 'org.apache.geronimo.config:geronimo-config-impl:1.0'
+}
+```
+
+== General Use Cases
+
+=== Registering Config Sources
+
+`ConfigSource` implementations can be registered via `ServiceLoader`.  Declare a `ServiceLoader`
of type `ConfigSource` or `ConfigSourceProvider` to link:https://github.com/eclipse/microprofile-config/blob/1.1/spec/src/main/asciidoc/configsources.asciidoc#custom-configsources[register
these classes].
+
+=== Default Config Sources
+
+By default, we register a `ConfigSource` for System Properties as well as Environment Variables.
+
+Environment Variables are attempted using both `.` as well as `_`, meaning a property lookup
for `my.config.property` will search both `my.config.property` as well as `my_config_property`,
to conform to naming convention standards for environment variables.
+
+System Properties are loaded on start up, copying the values into the config source instance.
 You can change this behavior by:
+- disabling default config source loading, and manually registering a `SystemPropertyConfigSource`
passing in `false` in the constructor
+- Set the system property `org.apache.geronimo.config.configsource.SystemPropertyConfigSource.copy`
to `false`
+
+== CDI Use Cases
+
+Being an implementation of a MicroProfile specification, it favors use cases based on CDI.
 Most of the heavy lifting is done for you when using CDI.
+
+=== Injecting Config
+
+The MicroProfile `Config` interface is supported as an injection point.  It is an `@ApplicationScoped`
bean, loaded from the result of `ConfigProvider.getConfig()`.
+
+```
+@Inject
+private Config config
+```
+Will allow you to use the default `Config` object for your application.  All of the operations
of `Config` match the MicroProfile Specification.
+
+=== Injecting Config Properties
+
+Injecting `@ConfigProperty` link:https://github.com/eclipse/microprofile-config/blob/1.1/spec/src/main/asciidoc/configexamples.asciidoc#simple-dependency-injection-example[works
based on the specification].
+
+In addition to the defined supported types, Geronimo Config supports injecting `Supplier<T>`
where `T` is any type that has a supported `Converter`.
+
+== Non-CDI Use Cases
+
+You may not be using CDI, or do not want to use the built in CDI integration.  You can then
using the programmatic look up for the configuration.
+
+```java
+Config config = ConfigProviderResolver.instance().getBuilder()
+    .addDefaultSources() // built in config sources (system properties, environment variables
and microprofile-config.properties
+    .addDiscoveredConverters() // converters discovered via ServiceLoader
+    .addDiscoveredSources() // sources discovered via ServiceLoader
+    .withConverters() // list of converter instances, cannot be lambda expressions
+    .withSources() // list of config source instances
+    .forClassLoader() // the classloader associated with this config
+    .build()
+```
+
+This will register and build a `Config` object for use.  You will need to keep track of that
created instance.  If you want it to be managed automatically, you can then register it
+
+```java
+ConfigProviderResolver.instance().registerConfig(config, classLoader);
+```


Mime
View raw message