| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| |
| include::temp-properties-files-for-site/attributes.adoc[] |
| |
| = Apache Tamaya -- Examples |
| |
| toc::[] |
| |
| == Tamaya Examples |
| |
| === Minimal |
| |
| This example shows the basic functionality that is available when Tamaya is used without any further extensions. |
| It shows how configuration can be added to the classpath and how it can be accessed. |
| |
| === Simple PropertySource |
| |
| This example shows how to write and register an additional +PropertySource+ and +PropertySourceProvider+, which is |
| the SPI to add your own configuration data and locations. For a more advanced example you may also have a look at |
| the provided default metamodels, e.g. the simple metamodel (currently in the experimental part and not shipped with |
| the current release). |
| |
| === Resources |
| |
| This example shows how resources can be located using ANT-styled paths and this feature can help you to implement |
| +PropertySourceProvider+ instances that provide configuration for a set of files/folders at a certain (searchable) |
| location, as provided by the resource extension_. |
| |
| === Resolver |
| |
| The resolver example defines a configuration file that illustrates the usage of placeholders that are resolved on |
| configuration access, as provided by the _resolver extension_. |
| |
| === Injection |
| |
| The injection sample shows how to inject configuration into a created object instance, or how to instantiate a proxied |
| configuration template, which provides a type-safe configuration access mechanism. This functionality is provided |
| by the _injection extension_. Hereby neither JSR 330 nor 299 are used, so it is pure and minimal SE based |
| implementation. |
| |
| === FileObserver |
| |
| This example shows how the +event extension+ can be used to automatically adapt the current configuration when |
| the underlying configuration data is changing, e.g. when new configuration is added to a file folder, or removed or |
| adapted. |
| |
| === Builder |
| |
| This example shows how to build a +Configuration+ using a simple pure SE builder API as provided by the |
| _builder extension_. |
| |
| === Remote |
| |
| THe remote example shows a simple setup where parts of the +Configuration+ are read remotedly. |