diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 31349fc..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,17 +0,0 @@
-*.class
-
-# Package Files #
-*.jar
-*.war
-*.ear
-
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-
-# IntelliJ IDEA
-.idea
-*.iml
-
-# Maven
-target
-pom.xml.versionsBackup
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index b18f8a4..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-language: java
-jdk:
- - oraclejdk8
-sudo: false
-install: true
-addons:
- sonarqube:
- organization: "microbule"
- token:
- secure: "D5oe//hLttzWg/jD/kVtPlNffe03iZS8oNgss6viose5cPGU8Q5OPgXUqdXP3sbn4q0j7CQya7p/lUrm1rGlF/n9+5izCz+mn8CmZo8kbWPECZEqF4YYYEKYmve4AhYKqigSQn6ped21YWz7jKtp5ubRSgRu1Vj2Dz6TpNOQr+w40zNq5yb2QyOetCQfA69jFavGEUvD7i1HazZvg2YNDwGwOkIRaXdGV1lkvmMU4cZol5LzbSraWFhfe9amKf9alrz0xQ0JHGIJBUMKxmUjm7Jfn9MVwYMyelinQuWgRqHxsK2tBwrAWtJQCH+UPtI7khNiMmr8xwKO6pnS5gsse/iCRMyhdRdjWAnapHWdHfDLbZZaR48wpXf/bPoAC+KLdPWwC66rCMgC+Se0FseVnoOYcFVur+Jbou5+/VMv1THLDT7X8lRd7ZaT6DVDkBaNxYG440r4u8C0zeMOIekD5CZuog6uOxzfFDwxvU0059nWoLotweCDZ7Y2Y5o891wEE8q+nLqg37t1CQKM8yTRwPydPHPw83jkcys8sQvbNuJ3JQsSOxEHHe0O86R50odWGGPLNnjwaq9G1v/VMPJF/SGnTKjKaPNkdt0Us44EeAxPgnr6FvIxujIstJYNxaL3dgoWCUwFAsWonJwxetgX3ZS3HTjaNRq5tdVGc8j6ZpI="
- apt:
- packages:
- - oracle-java8-installer
-script:
- - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar
-cache:
- directories:
- - '$HOME/.m2/repository'
- - '$HOME/.sonar/cache'
-notifications:
- webhooks:
- urls:
- - https://webhooks.gitter.im/e/bb01c18989c38844789e
- on_success: change # options: [always|never|change] default: always
- on_failure: always # options: [always|never|change] default: always
- on_start: change # options: [always|never|change] default: always
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 8dada3e..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed 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.
diff --git a/README.md b/README.md
deleted file mode 100644
index d88699d..0000000
--- a/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# Microbule
-
-[](https://maven-badges.herokuapp.com/maven-central/org.microbule/microbule-parent)
-[](https://javadoc.io/doc/Microbule/microbule)
-[](https://travis-ci.org/Microbule/microbule)
-[](https://sonarqube.com/dashboard?id=org.microbule%3Amicrobule-parent)
-[](https://sonarqube.com/dashboard?id=org.microbule%3Amicrobule-parent)
-[](https://sonarqube.com/dashboard?id=org.microbule%3Amicrobule-parent)
-[](http://www.apache.org/licenses/LICENSE-2.0.html)
-[](https://gitter.im/Microbule/Lobby)
-
-Microbule provides a framework for developing [Microservices](http://www.martinfowler.com/articles/microservices.html)
-quickly and easily! Services are written using the standard
- [Java API for RESTful Services](https://jax-rs-spec.java.net/) (JAX-RS).
-
-## Table of Contents
-
-- [Documentation](#documentation)
-- [Building](#building-microbule)
-- [Support](#support)
-- [Community](#community)
-- [Contributing](#contributing)
-- [License](#license)
-- [What's in a Name?](#whats-in-a-name)
-
-## Documentation
-
-Visit our [Documentation](https://microbule.github.io/microbule/)!
-
-## Building Microbule
-
-1. Clone the Git repository from GitHub:
-
-```text
-git clone git@github.com:Microbule/microbule.git
-```
-
-2. Build Microbule Using [Apache Maven](http://maven.apache.org):
-
-```text
-mvn clean install
-```
-
-## Support
-
-Please [open an issue](https://github.com/Microbule/microbule/issues/new) for support.
-
-## Community
-
-Please join us on [Gitter](https://gitter.im/Microbule/Lobby)!
-
-## Contributing
-
-Please contribute using [Github Flow](https://guides.github.com/introduction/flow/). Create a branch, add commits, and [open a pull request](https://github.com/Microbule/microbule/compare).
-
-## License
-
-Microbule is licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
-
-## What's in a Name?
-
-A "microbule" is a unit of length used in Marvel's
-[Guardians of the Galaxy](http://marvel.com/characters/70/guardians_of_the_galaxy) movie (the lineup scene). Microbule strives to be the
-microservices framework that the others will try to measure up to!
diff --git a/_config.yml b/_config.yml
new file mode 100644
index 0000000..f40c0c3
--- /dev/null
+++ b/_config.yml
@@ -0,0 +1,8 @@
+title: Microbule
+description: Making Microservices Fun and Easy!
+google_analytics:
+show_downloads: false
+theme: jekyll-theme-cayman
+
+gems:
+ - jekyll-mentions
diff --git a/all/pom.xml b/all/pom.xml
deleted file mode 100644
index 260dfca..0000000
--- a/all/pom.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-all
- Microbule :: All
-
-
-
-
- org.microbule
- microbule-core
- 0.3.0-SNAPSHOT
-
-
-
-
- org.microbule
- microbule-config-core
- 0.3.0-SNAPSHOT
-
-
-
-
- org.microbule
- microbule-errormap-core
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-errormap-mapper
- 0.3.0-SNAPSHOT
-
-
-
-
- org.microbule
- microbule-gson-core
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-gson-time
- 0.3.0-SNAPSHOT
-
-
-
-
- org.microbule
- microbule-scheduler-core
- 0.3.0-SNAPSHOT
-
-
-
-
- org.microbule
- microbule-metrics-core
- 0.3.0-SNAPSHOT
-
-
-
-
- org.microbule
- microbule-cache-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-circuitbreaker-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-cors-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-errormap-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-gson-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-gzip-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-logging-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-metrics-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-requestlog-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-swagger-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-timeout-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-tracer-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-validation-decorator
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-version-decorator
- 0.3.0-SNAPSHOT
-
-
-
-
- org.apache.cxf
- cxf-rt-transports-http-jetty
- ${cxf.version}
-
-
- org.apache.cxf
- cxf-rt-transports-http-hc
- ${cxf.version}
-
-
-
diff --git a/annotation/pom.xml b/annotation/pom.xml
deleted file mode 100644
index c462e5e..0000000
--- a/annotation/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-annotation
- Microbule :: Annotation
- bundle
-
-
diff --git a/annotation/src/main/java/org/microbule/annotation/JaxrsService.java b/annotation/src/main/java/org/microbule/annotation/JaxrsService.java
deleted file mode 100644
index 442d86d..0000000
--- a/annotation/src/main/java/org/microbule/annotation/JaxrsService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface JaxrsService {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- String name() default "";
-
- String serverAddress() default "";
-}
diff --git a/annotation/src/main/java/org/microbule/annotation/Startup.java b/annotation/src/main/java/org/microbule/annotation/Startup.java
deleted file mode 100644
index 2912a65..0000000
--- a/annotation/src/main/java/org/microbule/annotation/Startup.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.microbule.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-@Qualifier
-public @interface Startup {
-}
diff --git a/api/pom.xml b/api/pom.xml
deleted file mode 100644
index 5238ab6..0000000
--- a/api/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-api
- Microbule :: API
- bundle
-
-
- org.microbule
- microbule-config-api
- 0.3.0-SNAPSHOT
-
-
-
diff --git a/api/src/main/java/org/microbule/api/JaxrsConfigService.java b/api/src/main/java/org/microbule/api/JaxrsConfigService.java
deleted file mode 100644
index bc18a96..0000000
--- a/api/src/main/java/org/microbule/api/JaxrsConfigService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.api;
-
-import org.microbule.config.api.Config;
-
-public interface JaxrsConfigService {
-
- Config createConfig(String... path);
-
- Config createServerConfig(Class serviceInterface, String serviceName);
-
- Config createProxyConfig(Class serviceInterface, String serviceName);
-}
diff --git a/api/src/main/java/org/microbule/api/JaxrsProxyFactory.java b/api/src/main/java/org/microbule/api/JaxrsProxyFactory.java
deleted file mode 100644
index bb77530..0000000
--- a/api/src/main/java/org/microbule/api/JaxrsProxyFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.api;
-
-public interface JaxrsProxyFactory {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
-
-
- /**
- * Creates a JAX-RS proxy which supports the JAX-RS annotated serviceInterface.
- *
- * @param serviceInterface the service interface
- * @param the proxy type
- * @return the
- */
- T createProxy(Class serviceInterface);
-}
diff --git a/api/src/main/java/org/microbule/api/JaxrsProxyReference.java b/api/src/main/java/org/microbule/api/JaxrsProxyReference.java
deleted file mode 100644
index c14e047..0000000
--- a/api/src/main/java/org/microbule/api/JaxrsProxyReference.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.api;
-
-@FunctionalInterface
-public interface JaxrsProxyReference {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- T get();
-}
diff --git a/api/src/main/java/org/microbule/api/JaxrsServer.java b/api/src/main/java/org/microbule/api/JaxrsServer.java
deleted file mode 100644
index 5a1ff7a..0000000
--- a/api/src/main/java/org/microbule/api/JaxrsServer.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.api;
-
-@FunctionalInterface
-public interface JaxrsServer {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- /**
- * Shuts down the JAX-RS server.
- */
- void shutdown();
-}
diff --git a/api/src/main/java/org/microbule/api/JaxrsServerFactory.java b/api/src/main/java/org/microbule/api/JaxrsServerFactory.java
deleted file mode 100644
index 2dafe07..0000000
--- a/api/src/main/java/org/microbule/api/JaxrsServerFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.api;
-
-public interface JaxrsServerFactory {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- /**
- * Creates a new JAX-RS server
- *
- * @param serviceInterface the service interface
- * @param serviceImplementation the service implementation object
- * @return the server
- */
- JaxrsServer createJaxrsServer(Class> serviceInterface, Object serviceImplementation);
-}
diff --git a/cache.md b/cache.md
new file mode 100644
index 0000000..817e48f
--- /dev/null
+++ b/cache.md
@@ -0,0 +1,46 @@
+# Cache-Control
+
+Microbule will automatically manage the *Cache-Control* headers for you. Each method annotated with @Cacheable will
+yield a *Cache-Control* header. For example, consider the following method:
+
+ ```
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ @Path("/value")
+ @Cacheable(maxAge = 600)
+ String getValue();
+ ```
+
+When executed, the *Cache-Control* header will contain:
+
+ ```
+ Cache-Control=[no-transform,max-age=600]
+ ```
+
+Microbule will also manage the *ETag* and *Last-Modified* headers for you. You can provide these values by using a
+JAX-RS Response object:
+
+ ```
+ public Response createResponse() {
+ return Response.ok("payload").lastModified(new Date()).build();
+ }
+ ```
+
+or by injecting a *ResourceState* object, using the @Context annotation:
+
+ ```
+ public class CacheResourceImpl implements CacheResource {
+
+ @Context
+ private ResourceState resourceState;
+
+ @Override
+ public String getValueWithEtag() {
+ resourceState.setEntityTag("12345");
+ return "payload";
+ }
+ }
+ ```
+
+When an *ETag* or *Last-Modified* value is provided, Microbule will check the *If-None-Match* and *If-Modified-Since*
+headers correspondingly. If the resource is up-to-date, Microbule will return a "No Content" (204) response.
diff --git a/cache/annnotation/pom.xml b/cache/annnotation/pom.xml
deleted file mode 100644
index bf47880..0000000
--- a/cache/annnotation/pom.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-cache-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-cache-annotation
- Microbule :: Cache :: Annotation
- bundle
-
-
diff --git a/cache/annnotation/src/main/java/org/microbule/cache/annotation/Cacheable.java b/cache/annnotation/src/main/java/org/microbule/cache/annotation/Cacheable.java
deleted file mode 100644
index 469d620..0000000
--- a/cache/annnotation/src/main/java/org/microbule/cache/annotation/Cacheable.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface Cacheable {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- int maxAge() default -1;
-
- boolean mustRevalidate() default false;
-
- boolean noCache() default false;
-
- String[] noCacheFields() default {};
-
- boolean noStore() default false;
-
- boolean noTransform() default true;
-
- String[] privateFields() default {};
-
- boolean privateFlag() default false;
-
- boolean proxyRevalidate() default false;
-
- int sMaxAge() default -1;
-}
diff --git a/cache/decorator/pom.xml b/cache/decorator/pom.xml
deleted file mode 100644
index 40ad5fe..0000000
--- a/cache/decorator/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-cache-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-cache-decorator
- Microbule :: Cache :: Decorator
- bundle
-
-
-
- org.microbule
- microbule-util
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-cache-annotation
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-spi
- 0.3.0-SNAPSHOT
-
-
- org.apache.cxf
- cxf-rt-frontend-jaxrs
- ${cxf.version}
-
-
- org.microbule
- microbule-test-server
- 0.3.0-SNAPSHOT
- test
-
-
-
diff --git a/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheDynamicFeature.java b/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheDynamicFeature.java
deleted file mode 100644
index 0146bb0..0000000
--- a/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheDynamicFeature.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.stream.Collectors;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.container.ResourceInfo;
-import javax.ws.rs.core.FeatureContext;
-import javax.ws.rs.ext.Provider;
-
-import org.microbule.cache.annotation.Cacheable;
-import org.microbule.util.jaxrs.AnnotationDrivenDynamicFeature;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Provider
-public class CacheDynamicFeature extends AnnotationDrivenDynamicFeature {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private static final Logger LOGGER = LoggerFactory.getLogger(CacheDynamicFeature.class);
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- protected void configure(Cacheable annotation, ResourceInfo resourceInfo, FeatureContext featureContext) {
- final Method method = resourceInfo.getResourceMethod();
- getAnnotation(method, GET.class).ifPresent(get -> {
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("Adding cache filter to method {}({})...", resourceInfo.getResourceMethod().getName(), Arrays.stream(method.getParameterTypes()).map(Class::getSimpleName).collect(Collectors.joining(", ")));
- }
- featureContext.register(new ContainerCacheFilter(annotation));
- });
- }
-}
diff --git a/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheInfoProvider.java b/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheInfoProvider.java
deleted file mode 100644
index 502062c..0000000
--- a/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheInfoProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator;
-
-import javax.ws.rs.ext.Provider;
-
-import org.apache.cxf.jaxrs.ext.ContextProvider;
-import org.apache.cxf.message.Message;
-import org.microbule.cache.decorator.state.DefaultResourceState;
-import org.microbule.cache.decorator.state.ResourceState;
-
-@Provider
-public class CacheInfoProvider implements ContextProvider {
-//----------------------------------------------------------------------------------------------------------------------
-// ContextProvider Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public ResourceState createContext(Message message) {
- return new DefaultResourceState(message);
- }
-}
diff --git a/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheServerDecorator.java b/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheServerDecorator.java
deleted file mode 100644
index d8e9d4d..0000000
--- a/cache/decorator/src/main/java/org/microbule/cache/decorator/CacheServerDecorator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.microbule.config.api.Config;
-import org.microbule.spi.JaxrsServerDecorator;
-import org.microbule.spi.JaxrsServiceDescriptor;
-
-@Singleton
-@Named("cacheServerDecorator")
-public class CacheServerDecorator implements JaxrsServerDecorator {
-//----------------------------------------------------------------------------------------------------------------------
-// JaxrsServiceDecorator Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public void decorate(JaxrsServiceDescriptor descriptor, Config config) {
- descriptor.addProvider(new CacheDynamicFeature());
- descriptor.addProvider(new CacheInfoProvider());
- }
-
- @Override
- public String name() {
- return "cache";
- }
-}
diff --git a/cache/decorator/src/main/java/org/microbule/cache/decorator/ContainerCacheFilter.java b/cache/decorator/src/main/java/org/microbule/cache/decorator/ContainerCacheFilter.java
deleted file mode 100644
index 653987f..0000000
--- a/cache/decorator/src/main/java/org/microbule/cache/decorator/ContainerCacheFilter.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Date;
-
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerResponseContext;
-import javax.ws.rs.container.ContainerResponseFilter;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.Provider;
-
-import org.apache.commons.lang3.ObjectUtils;
-import org.apache.cxf.jaxrs.utils.HttpUtils;
-import org.microbule.cache.annotation.Cacheable;
-import org.microbule.cache.decorator.state.ResourceState;
-
-@Provider
-public class ContainerCacheFilter implements ContainerResponseFilter {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private final CacheControl cacheControl;
-
- @Context
- private ResourceState resourceState;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public ContainerCacheFilter(Cacheable cacheable) {
- this.cacheControl = createCacheControl(cacheable);
- }
-
- private static CacheControl createCacheControl(Cacheable cacheable) {
- CacheControl cacheControl = new CacheControl();
- cacheControl.setMaxAge(cacheable.maxAge());
- cacheControl.setMustRevalidate(cacheable.mustRevalidate());
- cacheControl.setNoCache(cacheable.noCache());
- cacheControl.setNoStore(cacheable.noStore());
- cacheControl.setNoTransform(cacheable.noTransform());
- cacheControl.setPrivate(cacheable.privateFlag());
- cacheControl.setProxyRevalidate(cacheable.proxyRevalidate());
- cacheControl.setSMaxAge(cacheable.sMaxAge());
- cacheControl.getNoCacheFields().addAll(Arrays.asList(cacheable.noCacheFields()));
- cacheControl.getPrivateFields().addAll(Arrays.asList(cacheable.privateFields()));
- return cacheControl;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// ContainerResponseFilter Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
-
- @Override
- public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
-
- final EntityTag entityTag = getEntityTag(responseContext);
- final Date lastModified = getLastModified(responseContext);
-
- responseContext.getHeaders().putSingle(HttpHeaders.CACHE_CONTROL, cacheControl);
- writeHeader(responseContext, HttpHeaders.ETAG, entityTag);
- writeHeader(responseContext, HttpHeaders.LAST_MODIFIED, lastModified == null ? null : HttpUtils.getHttpDateFormat().format(lastModified));
-
- final Response.ResponseBuilder builder = evaluatePreconditions(requestContext, entityTag, lastModified);
- if (builder != null) {
- responseContext.setStatusInfo(Response.Status.NO_CONTENT);
- responseContext.setEntity(null);
- }
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- private Response.ResponseBuilder evaluatePreconditions(ContainerRequestContext request, EntityTag etag, Date lastModified) {
- if (etag != null && lastModified != null) {
- return request.getRequest().evaluatePreconditions(lastModified, etag);
- } else if (etag != null) {
- return request.getRequest().evaluatePreconditions(etag);
- } else if (lastModified != null) {
- return request.getRequest().evaluatePreconditions(lastModified);
- } else {
- return null;
- }
- }
-
- private EntityTag getEntityTag(ContainerResponseContext response) {
- return ObjectUtils.defaultIfNull(resourceState.getEntityTag(), response.getEntityTag());
- }
-
- private Date getLastModified(ContainerResponseContext response) {
- return ObjectUtils.defaultIfNull(resourceState.getLastModified(), response.getLastModified());
- }
-
- private void writeHeader(ContainerResponseContext response, String name, Object value) {
- if (value == null) {
- response.getHeaders().remove(name);
- } else {
- response.getHeaders().putSingle(name, value);
- }
- }
-}
diff --git a/cache/decorator/src/main/java/org/microbule/cache/decorator/state/DefaultResourceState.java b/cache/decorator/src/main/java/org/microbule/cache/decorator/state/DefaultResourceState.java
deleted file mode 100644
index 7a213e4..0000000
--- a/cache/decorator/src/main/java/org/microbule/cache/decorator/state/DefaultResourceState.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator.state;
-
-import java.util.Date;
-
-import javax.ws.rs.core.EntityTag;
-
-import org.apache.cxf.message.Message;
-
-public class DefaultResourceState implements ResourceState {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private static final String ENTITY_TAG_KEY = "ResourceState.entityTag";
- private static final String LAST_MODIFIED_KEY = "ResourceState.lastModified";
- private final Message message;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public DefaultResourceState(Message message) {
- this.message = message;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// ResourceState Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public EntityTag getEntityTag() {
- return (EntityTag) message.get(ENTITY_TAG_KEY);
- }
-
- @Override
- public Date getLastModified() {
- return (Date) message.get(LAST_MODIFIED_KEY);
- }
-
- @Override
- public void setEntityTag(EntityTag entityTag) {
- message.put(ENTITY_TAG_KEY, entityTag);
- }
-
- @Override
- public void setLastModified(Date lastModified) {
- message.put(LAST_MODIFIED_KEY, lastModified);
- }
-}
diff --git a/cache/decorator/src/main/java/org/microbule/cache/decorator/state/ResourceState.java b/cache/decorator/src/main/java/org/microbule/cache/decorator/state/ResourceState.java
deleted file mode 100644
index 528b92d..0000000
--- a/cache/decorator/src/main/java/org/microbule/cache/decorator/state/ResourceState.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator.state;
-
-import java.util.Date;
-
-import javax.ws.rs.core.EntityTag;
-
-public interface ResourceState {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- void setLastModified(Date lastUpdated);
-
- void setEntityTag(EntityTag eTag);
-
- EntityTag getEntityTag();
-
- Date getLastModified();
-}
diff --git a/cache/decorator/src/main/resources/META-INF/beans.xml b/cache/decorator/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 115b372..0000000
--- a/cache/decorator/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/cache/decorator/src/main/resources/OSGI-INF/blueprint/microbule-cache-decorator.xml b/cache/decorator/src/main/resources/OSGI-INF/blueprint/microbule-cache-decorator.xml
deleted file mode 100644
index 94bad7e..0000000
--- a/cache/decorator/src/main/resources/OSGI-INF/blueprint/microbule-cache-decorator.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/cache/decorator/src/test/java/org/microbule/cache/decorator/CacheServerDecoratorTest.java b/cache/decorator/src/test/java/org/microbule/cache/decorator/CacheServerDecoratorTest.java
deleted file mode 100644
index f087253..0000000
--- a/cache/decorator/src/test/java/org/microbule/cache/decorator/CacheServerDecoratorTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator;
-
-import java.time.temporal.ChronoUnit;
-import java.util.Date;
-
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.cxf.jaxrs.utils.HttpUtils;
-import org.junit.Test;
-import org.microbule.cache.decorator.resource.CacheResource;
-import org.microbule.cache.decorator.resource.CacheResourceImpl;
-import org.microbule.container.core.SimpleContainer;
-import org.microbule.test.server.JaxrsServerTestCase;
-
-public class CacheServerDecoratorTest extends JaxrsServerTestCase {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- protected void addBeans(SimpleContainer container) {
- container.addBean(new CacheServerDecorator());
- }
-
- @Override
- protected CacheResource createImplementation() {
- return new CacheResourceImpl();
- }
-
- @Test
- public void testEmptyResponseWithMatchingEtag() {
- final Response response = createWebTarget().path("name").path("etag")
- .request(MediaType.TEXT_PLAIN)
- .header(HttpHeaders.IF_NONE_MATCH, CacheResource.ENTITY_TAG)
- .get();
- assertEquals(204, response.getStatus());
- }
-
- @Test
- public void testEmptyResponseWithUnmodified() {
- final Response response = createWebTarget().path("name").path("lastModified")
- .request(MediaType.TEXT_PLAIN)
- .header(HttpHeaders.IF_MODIFIED_SINCE, HttpUtils.getHttpDateFormat().format(Date.from(CacheResource.LAST_MODIFIED.toInstant().plus(5, ChronoUnit.MINUTES))))
- .get();
- assertEquals(204, response.getStatus());
- }
-
- @Test
- public void testEntityTagSupport() {
- final Response response = createWebTarget().path("name").path("etag").request(MediaType.TEXT_PLAIN).get();
- CacheControl cacheControl = CacheControl.valueOf(response.getHeaderString(HttpHeaders.CACHE_CONTROL));
- assertEquals(600, cacheControl.getMaxAge());
- assertTrue(cacheControl.isNoTransform());
- assertFalse(cacheControl.isMustRevalidate());
- final EntityTag entityTag = response.getEntityTag();
- assertNotNull(entityTag);
- assertEquals("12345", entityTag.getValue());
- }
-
- @Test
- public void testLastUpdatedAndEtagSupport() {
- final Response response = createWebTarget().path("name").path("lastModifiedAndEtag").request(MediaType.TEXT_PLAIN).get();
- CacheControl cacheControl = CacheControl.valueOf(response.getHeaderString(HttpHeaders.CACHE_CONTROL));
- assertEquals(600, cacheControl.getMaxAge());
- assertTrue(cacheControl.isNoTransform());
- assertFalse(cacheControl.isMustRevalidate());
-
- Date lastModified = response.getLastModified();
- assertEquals(CacheResource.LAST_MODIFIED, lastModified);
-
- final EntityTag entityTag = response.getEntityTag();
- assertNotNull(entityTag);
- assertEquals("12345", entityTag.getValue());
- }
-
- @Test
- public void testLastUpdatedSupport() {
- final Response response = createWebTarget().path("name").path("lastModified").request(MediaType.TEXT_PLAIN).get();
- CacheControl cacheControl = CacheControl.valueOf(response.getHeaderString(HttpHeaders.CACHE_CONTROL));
- assertEquals(600, cacheControl.getMaxAge());
- assertTrue(cacheControl.isNoTransform());
- assertFalse(cacheControl.isMustRevalidate());
- Date lastModified = response.getLastModified();
- assertEquals(CacheResource.LAST_MODIFIED, lastModified);
- }
-
- @Test
- public void testWithNoState() {
- final Response response = createWebTarget().path("name").path("noState").request(MediaType.TEXT_PLAIN).get();
- CacheControl cacheControl = CacheControl.valueOf(response.getHeaderString(HttpHeaders.CACHE_CONTROL));
- assertEquals(600, cacheControl.getMaxAge());
- assertTrue(cacheControl.isNoTransform());
- assertFalse(cacheControl.isMustRevalidate());
-
- assertNull(response.getLastModified());
- assertNull(response.getEntityTag());
- }
-
- @Test
- public void testWithResponse() {
- final Response response = createProxy().createResponse();
- CacheControl cacheControl = CacheControl.valueOf(response.getHeaderString(HttpHeaders.CACHE_CONTROL));
- assertEquals(600, cacheControl.getMaxAge());
- assertTrue(cacheControl.isNoTransform());
- assertFalse(cacheControl.isMustRevalidate());
-
- Date lastModified = response.getLastModified();
- assertEquals(CacheResource.LAST_MODIFIED, lastModified);
-
- final EntityTag entityTag = response.getEntityTag();
- assertNotNull(entityTag);
- assertEquals("12345", entityTag.getValue());
- }
-}
\ No newline at end of file
diff --git a/cache/decorator/src/test/java/org/microbule/cache/decorator/resource/CacheResource.java b/cache/decorator/src/test/java/org/microbule/cache/decorator/resource/CacheResource.java
deleted file mode 100644
index 16879c9..0000000
--- a/cache/decorator/src/test/java/org/microbule/cache/decorator/resource/CacheResource.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator.resource;
-
-import java.time.Instant;
-import java.time.temporal.ChronoUnit;
-import java.util.Date;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.microbule.cache.annotation.Cacheable;
-
-@Path("/")
-public interface CacheResource {
-
- Date LAST_MODIFIED = Date.from(Instant.now().truncatedTo(ChronoUnit.MINUTES));
- EntityTag ENTITY_TAG = new EntityTag("12345");
-
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- @Path("/name/etag")
- @Cacheable(maxAge = 600)
- String getValueWithEtag();
-
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- @Path("/name/lastModified")
- @Cacheable(maxAge = 600)
- String getValueWithLastModified();
-
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- @Path("/name/lastModifiedAndEtag")
- @Cacheable(maxAge = 600)
- String getValueWithLastModifiedAndEtag();
-
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- @Path("/name/noState")
- @Cacheable(maxAge = 600)
- String getValueWithNoState();
-
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- @Path("/createResponse")
- @Cacheable(maxAge = 600)
- Response createResponse();
-}
diff --git a/cache/decorator/src/test/java/org/microbule/cache/decorator/resource/CacheResourceImpl.java b/cache/decorator/src/test/java/org/microbule/cache/decorator/resource/CacheResourceImpl.java
deleted file mode 100644
index 0c83366..0000000
--- a/cache/decorator/src/test/java/org/microbule/cache/decorator/resource/CacheResourceImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cache.decorator.resource;
-
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-
-import org.microbule.cache.decorator.state.ResourceState;
-
-public class CacheResourceImpl implements CacheResource {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- @Context
- private ResourceState resourceState;
-
-//----------------------------------------------------------------------------------------------------------------------
-// CacheResource Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public String getValueWithEtag() {
- resourceState.setEntityTag(ENTITY_TAG);
- return "ValueWithEtag";
- }
-
- @Override
- public String getValueWithLastModified() {
- resourceState.setLastModified(LAST_MODIFIED);
- return "ValueWithLastModified";
- }
-
- @Override
- public String getValueWithNoState() {
- return "ValueWithNoState";
- }
-
- @Override
- public String getValueWithLastModifiedAndEtag() {
- resourceState.setEntityTag(ENTITY_TAG);
- resourceState.setLastModified(LAST_MODIFIED);
- return "ValueWithLastModifiedAndEtag";
- }
-
- @Override
- public Response createResponse() {
- return Response.ok(System.currentTimeMillis()).lastModified(LAST_MODIFIED).tag(ENTITY_TAG).build();
- }
-}
diff --git a/cache/pom.xml b/cache/pom.xml
deleted file mode 100644
index 2721ba0..0000000
--- a/cache/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-cache-parent
- Microbule :: Cache :: Parent
- pom
-
-
- annnotation
- decorator
-
-
diff --git a/cdi.md b/cdi.md
new file mode 100644
index 0000000..0a95a33
--- /dev/null
+++ b/cdi.md
@@ -0,0 +1,34 @@
+# Contexts and Dependency Injection (CDI)
+
+Microbule is designed to be automatically detected by your CDI container. All of Microbule's components are assigned JSR-330 (_javax.inject_) annotations. First, you'll need to add Microbule to your classpath.
+
+# Dependencies
+
+If you are using Maven, simply add the following dependencies to your pom.xml file:
+
+```xml
+
+ org.microbule
+ microbule-all
+ ${microbule.version}
+
+
+
+ org.microbule
+ microbule-cdi-container
+ ${microbule.version}
+
+```
+
+Let's examine these dependencies:
+
+- **microbule-all**: the Microbule framework with all of the standard plugins.
+- **microbule-cdi-container**: the CDI-based *MicrobuleContainer* implementation, which adapts Microbule to CDI.
+
+You will also need to choose from the available [ConfigurationProviders](configuration.md).
+
+Once you have these dependencies defined, Microbule will automatically start up once the CDI "application" scope initializes.
+
+# JAX-RS Service Discovery
+
+Once Microbule starts, it will automatically create a CXF server for any `@Path`-annotated bean in the current CDI container.
diff --git a/cdi/container/pom.xml b/cdi/container/pom.xml
deleted file mode 100644
index 05862cb..0000000
--- a/cdi/container/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-cdi-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-cdi-container
- Microbule :: CDI :: Container
- bundle
-
-
-
- org.microbule
- microbule-container-core
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-api
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-util
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-annotation
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-test-cdi
- 0.3.0-SNAPSHOT
- test
-
-
- org.microbule
- microbule-core
- 0.3.0-SNAPSHOT
- test
-
-
- org.microbule
- microbule-scheduler-core
- 0.3.0-SNAPSHOT
- test
-
-
-
diff --git a/cdi/container/src/main/java/org/microbule/cdi/container/CdiContainer.java b/cdi/container/src/main/java/org/microbule/cdi/container/CdiContainer.java
deleted file mode 100644
index 9276512..0000000
--- a/cdi/container/src/main/java/org/microbule/cdi/container/CdiContainer.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cdi.container;
-
-import java.util.stream.Collectors;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.context.Initialized;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.CDI;
-import javax.enterprise.util.AnnotationLiteral;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-import javax.ws.rs.Path;
-
-import com.google.common.collect.Lists;
-import org.apache.commons.lang3.ClassUtils;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.microbule.annotation.Startup;
-import org.microbule.container.api.ServerDefinition;
-import org.microbule.container.core.DefaultServerDefinition;
-import org.microbule.container.core.StaticContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Singleton
-@Named("cdiContainer")
-public class CdiContainer extends StaticContainer {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private static final Logger LOGGER = LoggerFactory.getLogger(CdiContainer.class);
-
- @Inject
- private BeanManager beanManager;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- public void onInitialized(@Observes @Initialized(ApplicationScoped.class) Object init) {
- beanManager.getBeans(Object.class, new AnnotationLiteral() {
- }).forEach(bean -> {
- final CreationalContext> context = beanManager.createCreationalContext(bean);
- LOGGER.info("Force initializing {}...", beanManager.getReference(bean, bean.getBeanClass(), context).toString());
- });
- initialize();
- }
-
- @Override
- protected Iterable plugins(Class pluginType) {
- final Instance plugins = CDI.current().select(pluginType);
- return Lists.newArrayList(plugins.iterator());
- }
-
- @Override
- protected Iterable servers() {
- return beanManager.getBeans(Object.class).stream()
- .flatMap(bean -> ClassUtils.getAllInterfaces(bean.getBeanClass()).stream().map(serviceInterface -> new ImmutablePair<>(bean, serviceInterface)))
- .filter(pair -> pair.getRight().isAnnotationPresent(Path.class))
- .map(pair -> {
- final Bean> bean = pair.getLeft();
- final Object reference = beanManager.getReference(bean, Object.class, beanManager.createCreationalContext(bean));
- return new DefaultServerDefinition(bean.getName(), pair.getRight(), reference);
- }).collect(Collectors.toList());
- }
-}
diff --git a/cdi/container/src/main/java/org/microbule/cdi/container/JaxrsProxyProducer.java b/cdi/container/src/main/java/org/microbule/cdi/container/JaxrsProxyProducer.java
deleted file mode 100644
index ac0c51f..0000000
--- a/cdi/container/src/main/java/org/microbule/cdi/container/JaxrsProxyProducer.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.microbule.cdi.container;
-
-import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.microbule.api.JaxrsProxyFactory;
-import org.microbule.api.JaxrsProxyReference;
-import org.microbule.util.reflect.Types;
-
-@Named("jaxrsProxyProducer")
-@Singleton
-public class JaxrsProxyProducer {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Produces
- @SuppressWarnings("unchecked")
- public JaxrsProxyReference createProxy(InjectionPoint point, JaxrsProxyFactory proxyFactory) {
- final Class serviceInterface = Types.getTypeParameter(point.getType(), JaxrsProxyReference.class, 0);
- return () -> proxyFactory.createProxy(serviceInterface);
- }
-}
diff --git a/cdi/container/src/test/java/org/microbule/cdi/container/CdiContainerTest.java b/cdi/container/src/test/java/org/microbule/cdi/container/CdiContainerTest.java
deleted file mode 100644
index 6b1b18a..0000000
--- a/cdi/container/src/test/java/org/microbule/cdi/container/CdiContainerTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cdi.container;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.junit.Test;
-import org.microbule.api.JaxrsProxyReference;
-import org.microbule.test.cdi.CdiTestCase;
-import org.microbule.test.core.hello.HelloService;
-
-@Singleton
-public class CdiContainerTest extends CdiTestCase {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- @Inject
- private Consumer consumer;
-
- @Inject
- private JaxrsProxyReference helloProxy;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Test
- public void testInjectingProxy() {
- assertNotNull(helloProxy);
- }
-
- @Test
- public void testPlugins() {
- assertEquals(1, consumer.getWidgets().size());
- }
-
- @Test
- public void testServers() {
- assertEquals(1, consumer.getServerDefinitions().size());
- }
-}
\ No newline at end of file
diff --git a/cdi/container/src/test/java/org/microbule/cdi/container/Consumer.java b/cdi/container/src/test/java/org/microbule/cdi/container/Consumer.java
deleted file mode 100644
index f2b2a46..0000000
--- a/cdi/container/src/test/java/org/microbule/cdi/container/Consumer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cdi.container;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.microbule.container.api.MicrobuleContainer;
-import org.microbule.container.api.ServerDefinition;
-import org.microbule.container.api.ServerListener;
-
-@Named("consumer")
-@Singleton
-public class Consumer implements ServerListener {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private final List widgets;
-
- private final List serverDefinitions = new LinkedList<>();
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- @Inject
- public Consumer(MicrobuleContainer container) {
- widgets = container.pluginList(Widget.class);
- container.addServerListener(this);
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// ServerListener Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public void registerServer(ServerDefinition serverDefinition) {
- serverDefinitions.add(serverDefinition);
- }
-
- @Override
- public void unregisterServer(String id) {
- serverDefinitions.removeIf(def -> id.equals(def.id()));
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Getter/Setter Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- public List getServerDefinitions() {
- return serverDefinitions;
- }
-
- public List getWidgets() {
- return widgets;
- }
-}
diff --git a/cdi/container/src/test/java/org/microbule/cdi/container/SimpleWidget.java b/cdi/container/src/test/java/org/microbule/cdi/container/SimpleWidget.java
deleted file mode 100644
index 8cb8ec3..0000000
--- a/cdi/container/src/test/java/org/microbule/cdi/container/SimpleWidget.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cdi.container;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-@Named("simpleWidget")
-@Singleton
-public class SimpleWidget implements Widget {
-}
diff --git a/cdi/container/src/test/java/org/microbule/cdi/container/Widget.java b/cdi/container/src/test/java/org/microbule/cdi/container/Widget.java
deleted file mode 100644
index 6c6afde..0000000
--- a/cdi/container/src/test/java/org/microbule/cdi/container/Widget.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cdi.container;
-
-public interface Widget {
-
-}
diff --git a/cdi/pom.xml b/cdi/pom.xml
deleted file mode 100644
index c8d97a0..0000000
--- a/cdi/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-cdi-parent
- Microbule :: CDI :: Parent
- pom
-
-
- container
-
-
-
-
- javax.enterprise
- cdi-api
- ${cdi.version}
- provided
-
-
-
-
diff --git a/cglib/pom.xml b/cglib/pom.xml
deleted file mode 100644
index 27cc44e..0000000
--- a/cglib/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-cglib
- Microbule :: CGLIB Dynamic Proxy Support
- bundle
-
-
- net.sf.cglib.core,,*
-
-
-
- org.microbule
- microbule-container-api
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-spi
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-util
- 0.3.0-SNAPSHOT
-
-
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.cglib
- ${cglib.version}
-
-
- org.microbule
- microbule-test-core
- 0.3.0-SNAPSHOT
- test
-
-
-
diff --git a/cglib/src/main/java/org/microbule/cglib/CglibDynamicProxyStrategy.java b/cglib/src/main/java/org/microbule/cglib/CglibDynamicProxyStrategy.java
deleted file mode 100644
index bd03f2f..0000000
--- a/cglib/src/main/java/org/microbule/cglib/CglibDynamicProxyStrategy.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cglib;
-
-import java.util.function.Supplier;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import net.sf.cglib.proxy.Callback;
-import net.sf.cglib.proxy.CallbackFilter;
-import net.sf.cglib.proxy.Dispatcher;
-import net.sf.cglib.proxy.Enhancer;
-import net.sf.cglib.proxy.MethodInterceptor;
-import org.microbule.spi.JaxrsDynamicProxyStrategy;
-import org.microbule.util.proxy.DynamicProxyUtils;
-import org.microbule.util.reflect.DelegatingClassLoader;
-
-@Named("cglibDynamicProxyStrategy")
-@Singleton
-public class CglibDynamicProxyStrategy implements JaxrsDynamicProxyStrategy {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private static final CallbackFilter FILTER = method -> {
- if (DynamicProxyUtils.isEqualsMethod(method)) {
- return 1;
- } else if (DynamicProxyUtils.isHashCodeMethod(method)) {
- return 2;
- } else if (DynamicProxyUtils.isToStringMethod(method)) {
- return 3;
- } else {
- return 0;
- }
- };
-
-//----------------------------------------------------------------------------------------------------------------------
-// JaxrsDynamicProxyStrategy Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public T createDynamicProxy(Class type, Supplier targetSupplier, String descriptionPattern, Object... descriptionParams) {
- final String description = String.format(descriptionPattern, descriptionParams);
- final Enhancer enhancer = new Enhancer();
- enhancer.setClassLoader(new DelegatingClassLoader(type.getClassLoader(), Enhancer.class.getClassLoader()));
- enhancer.setInterfaces(new Class[]{type});
- enhancer.setSuperclass(Object.class);
- enhancer.setCallbackFilter(FILTER);
- enhancer.setCallbacks(new Callback[]{
- (Dispatcher) targetSupplier::get,
- (MethodInterceptor) (proxy, method, params, methodProxy) -> proxy == params[0],
- (MethodInterceptor) (proxy, method, params, methodProxy) -> System.identityHashCode(proxy),
- (MethodInterceptor) (proxy, method, params, methodProxy) -> description
- });
- return type.cast(enhancer.create());
- }
-}
diff --git a/cglib/src/main/resources/OSGI-INF/blueprint/microbule-cglib.xml b/cglib/src/main/resources/OSGI-INF/blueprint/microbule-cglib.xml
deleted file mode 100644
index 7c596be..0000000
--- a/cglib/src/main/resources/OSGI-INF/blueprint/microbule-cglib.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/cglib/src/test/java/org/microbule/cglib/CglibDynamicProxyStrategyTest.java b/cglib/src/test/java/org/microbule/cglib/CglibDynamicProxyStrategyTest.java
deleted file mode 100644
index eac60ec..0000000
--- a/cglib/src/test/java/org/microbule/cglib/CglibDynamicProxyStrategyTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.cglib;
-
-import org.junit.Test;
-import org.microbule.test.core.MockObjectTestCase;
-import org.microbule.test.core.hello.HelloService;
-import org.microbule.test.core.hello.HelloServiceImpl;
-
-public class CglibDynamicProxyStrategyTest extends MockObjectTestCase {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Test
- public void testEquals() {
- final CglibDynamicProxyStrategy strategy = new CglibDynamicProxyStrategy();
- final HelloService proxy1 = strategy.createDynamicProxy(HelloService.class, HelloServiceImpl::new, "my description");
- final HelloService proxy2 = strategy.createDynamicProxy(HelloService.class, HelloServiceImpl::new, "my description");
- assertEquals(proxy1, proxy1);
- assertNotEquals(proxy1, proxy2);
- }
-
-
- @Test
- public void testToString() {
- final CglibDynamicProxyStrategy strategy = new CglibDynamicProxyStrategy();
- final HelloService proxy1 = strategy.createDynamicProxy(HelloService.class, HelloServiceImpl::new, "my description");
- assertEquals("my description", proxy1.toString());
- }
-
- @Test
- public void testClassCaching() {
- final CglibDynamicProxyStrategy strategy = new CglibDynamicProxyStrategy();
- final HelloService proxy1 = strategy.createDynamicProxy(HelloService.class, HelloServiceImpl::new, "my description");
- final HelloService proxy2 = strategy.createDynamicProxy(HelloService.class, HelloServiceImpl::new, "my description");
- assertEquals(proxy1.getClass(), proxy2.getClass());
- }
-
- @Test
- public void testHashCode() {
- final CglibDynamicProxyStrategy strategy = new CglibDynamicProxyStrategy();
- final HelloService proxy1 = strategy.createDynamicProxy(HelloService.class, HelloServiceImpl::new, "my description");
- assertEquals(System.identityHashCode(proxy1), proxy1.hashCode());
- }
-
- @Test
- public void testRegularMethodCall() {
- final CglibDynamicProxyStrategy strategy = new CglibDynamicProxyStrategy();
- final HelloService proxy1 = strategy.createDynamicProxy(HelloService.class, HelloServiceImpl::new, "my description");
- assertEquals("Hello, Microbule!", proxy1.sayHello("Microbule"));
- }
-}
\ No newline at end of file
diff --git a/circuitbreaker.md b/circuitbreaker.md
new file mode 100644
index 0000000..6dc7a2e
--- /dev/null
+++ b/circuitbreaker.md
@@ -0,0 +1,3 @@
+# Circuit Breaker
+
+Microbule supports the [Circuit Breaker](https://martinfowler.com/bliki/CircuitBreaker.html) pattern for client proxies.
diff --git a/circuitbreaker/pom.xml b/circuitbreaker/pom.xml
deleted file mode 100644
index 418adc9..0000000
--- a/circuitbreaker/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-circuitbreaker-decorator
- Microbule :: Circuit Breaker :: Decorator
- bundle
-
-
- org.microbule
- microbule-spi
- 0.3.0-SNAPSHOT
-
-
- org.apache.commons
- commons-lang3
- ${commons.lang3.version}
-
-
- org.microbule
- microbule-test-server
- 0.3.0-SNAPSHOT
- test
-
-
-
diff --git a/circuitbreaker/src/main/java/org/microbule/circuitbreaker/decorator/CircuitBreakerDecorator.java b/circuitbreaker/src/main/java/org/microbule/circuitbreaker/decorator/CircuitBreakerDecorator.java
deleted file mode 100644
index ab2bc31..0000000
--- a/circuitbreaker/src/main/java/org/microbule/circuitbreaker/decorator/CircuitBreakerDecorator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.circuitbreaker.decorator;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.microbule.config.api.Config;
-import org.microbule.spi.JaxrsProxyDecorator;
-import org.microbule.spi.JaxrsServiceDescriptor;
-
-@Singleton
-@Named("circuitBreakerDecorator")
-public class CircuitBreakerDecorator implements JaxrsProxyDecorator {
-//----------------------------------------------------------------------------------------------------------------------
-// JaxrsServiceDecorator Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
-
- @Override
- public void decorate(JaxrsServiceDescriptor descriptor, Config config) {
- descriptor.addProvider(new CircuitBreakerFilter(descriptor, config));
- }
-
- @Override
- public String name() {
- return "circuitbreaker";
- }
-}
diff --git a/circuitbreaker/src/main/java/org/microbule/circuitbreaker/decorator/CircuitBreakerFilter.java b/circuitbreaker/src/main/java/org/microbule/circuitbreaker/decorator/CircuitBreakerFilter.java
deleted file mode 100644
index 9eedac7..0000000
--- a/circuitbreaker/src/main/java/org/microbule/circuitbreaker/decorator/CircuitBreakerFilter.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.circuitbreaker.decorator;
-
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-
-import javax.ws.rs.client.ClientRequestContext;
-import javax.ws.rs.client.ClientRequestFilter;
-import javax.ws.rs.client.ClientResponseContext;
-import javax.ws.rs.client.ClientResponseFilter;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.Provider;
-
-import org.apache.commons.lang3.concurrent.CircuitBreaker;
-import org.apache.commons.lang3.concurrent.EventCountCircuitBreaker;
-import org.microbule.config.api.Config;
-import org.microbule.spi.JaxrsServiceDescriptor;
-
-@Provider
-public class CircuitBreakerFilter implements ClientRequestFilter, ClientResponseFilter {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private static final String OPEN_THRESHOLD_PROP = "openThreshold";
- private static final String OPEN_INTERVAL_PROP = "openInterval";
- private static final String OPEN_INTERVAL_UNIT_PROP = "openIntervalUnit";
-
- private static final String CLOSE_THRESHOLD_PROP = "closeThreshold";
- private static final String CLOSE_INTERVAL_PROP = "closeInterval";
- private static final String CLOSE_INTERVAL_UNIT_PROP = "closeIntervalUnit";
-
- private static final int DEFAULT_OPEN_THRESHOLD = 10;
- private static final int DEFUALT_CLOSE_THRESHOLD = 10;
- private static final long DEFAULT_OPEN_INTERVAL = 1L;
- private static final long DEFAULT_CLOSE_INTERVAL = 1L;
- private static final TimeUnit DEFAULT_UNIT = TimeUnit.SECONDS;
-
- private final CircuitBreaker circuitBreaker;
- private final String serviceInterface;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- CircuitBreakerFilter(JaxrsServiceDescriptor descriptor, Config config) {
- this.serviceInterface = descriptor.serviceInterface().getSimpleName();
-
- final int openThreshold = config.integerValue(OPEN_THRESHOLD_PROP).orElse(DEFAULT_OPEN_THRESHOLD);
- final long openInterval = config.longValue(OPEN_INTERVAL_PROP).orElse(DEFAULT_OPEN_INTERVAL);
- final TimeUnit openIntervalUnit = config.enumValue(OPEN_INTERVAL_UNIT_PROP, TimeUnit.class).orElse(DEFAULT_UNIT);
-
- final int closeThreshold = config.integerValue(CLOSE_THRESHOLD_PROP).orElse(DEFUALT_CLOSE_THRESHOLD);
- final long closeInterval = config.longValue(CLOSE_INTERVAL_PROP).orElse(DEFAULT_CLOSE_INTERVAL);
- final TimeUnit closeIntervalUnit = config.enumValue(CLOSE_INTERVAL_UNIT_PROP, TimeUnit.class).orElse(DEFAULT_UNIT);
-
- this.circuitBreaker = new EventCountCircuitBreaker(openThreshold, openInterval, openIntervalUnit, closeThreshold, closeInterval, closeIntervalUnit);
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// ClientRequestFilter Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public void filter(ClientRequestContext requestContext) throws IOException {
- if (!circuitBreaker.checkState()) {
- requestContext.abortWith(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(String.format("Service %s is currently unavilable.", serviceInterface)).build());
- }
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// ClientResponseFilter Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
- if (Response.Status.Family.SERVER_ERROR == responseContext.getStatusInfo().getFamily()) {
- circuitBreaker.incrementAndCheckState(1);
- }
- }
-}
diff --git a/circuitbreaker/src/main/resources/META-INF/beans.xml b/circuitbreaker/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 115b372..0000000
--- a/circuitbreaker/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/circuitbreaker/src/main/resources/OSGI-INF/blueprint/microbule-circuitbreaker-decorator.xml b/circuitbreaker/src/main/resources/OSGI-INF/blueprint/microbule-circuitbreaker-decorator.xml
deleted file mode 100644
index b989761..0000000
--- a/circuitbreaker/src/main/resources/OSGI-INF/blueprint/microbule-circuitbreaker-decorator.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/circuitbreaker/src/test/java/org/microbule/circuitbreaker/decorator/CircuitBreakerFilterTest.java b/circuitbreaker/src/test/java/org/microbule/circuitbreaker/decorator/CircuitBreakerFilterTest.java
deleted file mode 100644
index 7390764..0000000
--- a/circuitbreaker/src/test/java/org/microbule/circuitbreaker/decorator/CircuitBreakerFilterTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.circuitbreaker.decorator;
-
-import javax.ws.rs.InternalServerErrorException;
-import javax.ws.rs.ServiceUnavailableException;
-
-import org.junit.Test;
-import org.microbule.container.core.SimpleContainer;
-import org.microbule.test.core.hello.HelloService;
-import org.microbule.test.core.hello.HelloServiceImpl;
-import org.microbule.test.server.hello.HelloTestCase;
-
-public class CircuitBreakerFilterTest extends HelloTestCase {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- protected void addBeans(SimpleContainer container) {
- container.addBean(new CircuitBreakerDecorator());
- }
-
- @Override
- protected HelloService createImplementation() {
- return new EvilHelloService();
- }
-
- @Test(expected = ServiceUnavailableException.class)
- public void testOpeningCircuitBreaker() {
- final HelloService proxy = createProxy();
- for (int i = 0; i < 20; ++i) {
- try {
- proxy.sayHello("Dr. Evil");
- } catch (InternalServerErrorException e) {
- // Ignore!
- }
- }
- proxy.sayHello("Microbule");
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Inner Classes
-//----------------------------------------------------------------------------------------------------------------------
-
- public static class EvilHelloService extends HelloServiceImpl implements HelloService {
-//----------------------------------------------------------------------------------------------------------------------
-// HelloService Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public String sayHello(String name) {
- if ("Dr. Evil".equals(name)) {
- throw new InternalServerErrorException("I don't like you!");
- }
- return super.sayHello(name);
- }
- }
-}
\ No newline at end of file
diff --git a/config/annotation/pom.xml b/config/annotation/pom.xml
deleted file mode 100644
index b206c49..0000000
--- a/config/annotation/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-config-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-config-annotation
- Microbule :: Config :: Annotation
- bundle
-
-
-
diff --git a/config/annotation/src/main/java/org/microbule/config/annotation/ServiceName.java b/config/annotation/src/main/java/org/microbule/config/annotation/ServiceName.java
deleted file mode 100644
index c2814af..0000000
--- a/config/annotation/src/main/java/org/microbule/config/annotation/ServiceName.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface ServiceName {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- String value();
-}
diff --git a/config/api/pom.xml b/config/api/pom.xml
deleted file mode 100644
index 5e07dba..0000000
--- a/config/api/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-config-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-config-api
- Microbule :: Config :: API
- bundle
-
-
-
- org.microbule
- microbule-util
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-test-core
- 0.3.0-SNAPSHOT
- test
-
-
-
diff --git a/config/api/src/main/java/org/microbule/config/api/Config.java b/config/api/src/main/java/org/microbule/config/api/Config.java
deleted file mode 100644
index 55ad760..0000000
--- a/config/api/src/main/java/org/microbule/config/api/Config.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.api;
-
-import java.util.Optional;
-import java.util.function.Function;
-
-/**
- * A Config provides access to configuration values. They values are arranged in a hierarchy
- * organized by "paths".
- */
-public interface Config {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- /**
- * Get a Boolean value
- *
- * @param key the value key
- * @return the optional Boolean value
- */
- default Optional booleanValue(String key) {
- return value(key, Boolean::valueOf);
- }
-
- /**
- * Get a Double value
- *
- * @param key the value key
- * @return the optional Double value
- */
- default Optional doubleValue(String key) {
- return value(key, Double::valueOf);
- }
-
- /**
- * Get an enum value
- *
- * @param key the value key
- * @param enumType the enum type
- * @param the enum type
- * @return the optional enum value
- */
- default > Optional enumValue(String key, Class enumType) {
- return value(key).map(value -> Enum.valueOf(enumType, value));
- }
-
- /**
- * Filter this {@link Config} object using the specified path
- *
- * @param paths the path
- * @return a new {@link Config} object containing only values at the specifed path or below
- */
- Config filtered(String... paths);
-
- /**
- * Get an Integer value
- *
- * @param key the value key
- * @return the optional Integer value
- */
- default Optional integerValue(String key) {
- return value(key, Integer::valueOf);
- }
-
- /**
- * Get a Long value
- *
- * @param key the value key
- * @return the optional Long value
- */
- default Optional longValue(String key) {
- return value(key, Long::valueOf);
- }
-
- /**
- * Get a String value
- *
- * @param key the value key
- * @return the optional String value
- */
- Optional value(String key);
-
- /**
- * Get a value by converting it to the target type using the specified converter
- *
- * @param key the value key
- * @param converter the converter
- * @param the target type
- * @return the optional target type value
- */
- default Optional value(String key, Function converter) {
- return value(key).map(converter);
- }
-}
diff --git a/config/api/src/main/java/org/microbule/config/api/ConfigService.java b/config/api/src/main/java/org/microbule/config/api/ConfigService.java
deleted file mode 100644
index 5c66b9e..0000000
--- a/config/api/src/main/java/org/microbule/config/api/ConfigService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.api;
-
-public interface ConfigService {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- /**
- * Creates a new configuration for the given path.
- * @param path the path
- * @return the configuration
- */
- Config createConfig(String... path);
-}
diff --git a/config/api/src/main/java/org/microbule/config/api/ConfigurationException.java b/config/api/src/main/java/org/microbule/config/api/ConfigurationException.java
deleted file mode 100644
index 0fa97aa..0000000
--- a/config/api/src/main/java/org/microbule/config/api/ConfigurationException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.api;
-
-import org.microbule.util.exception.MicrobuleException;
-
-public class ConfigurationException extends MicrobuleException {
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public ConfigurationException(String message, Object... params) {
- super(message, params);
- }
-
- public ConfigurationException(Throwable cause, String message, Object... params) {
- super(cause, message, params);
- }
-}
diff --git a/config/api/src/test/java/org/microbule/config/api/ConfigTest.java b/config/api/src/test/java/org/microbule/config/api/ConfigTest.java
deleted file mode 100644
index 3a8ffb7..0000000
--- a/config/api/src/test/java/org/microbule/config/api/ConfigTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.api;
-
-import java.lang.annotation.ElementType;
-import java.util.Optional;
-
-import org.junit.Test;
-import org.microbule.test.core.MicrobuleTestCase;
-
-public class ConfigTest extends MicrobuleTestCase {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Test
- public void testBooleanValue() {
- assertEquals(Boolean.TRUE, new ConstantConfig("true").booleanValue("whatever").get());
- }
-
- @Test
- public void testDoubleValue() {
- assertEquals(new Double(123.456), new ConstantConfig("123.456").doubleValue("whatever").get());
- }
-
- @Test
- public void testEnumValue() {
- assertEquals(ElementType.METHOD, new ConstantConfig("METHOD").enumValue("whatever", ElementType.class).get());
- }
-
- @Test
- public void testIntegerValue() {
- assertEquals(new Integer(123), new ConstantConfig("123").integerValue("whatever").get());
- }
-
- @Test
- public void testLongValue() {
- assertEquals(new Long(123), new ConstantConfig("123").longValue("whatever").get());
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Inner Classes
-//----------------------------------------------------------------------------------------------------------------------
-
- private static class ConstantConfig implements Config {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private final String value;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public ConstantConfig(String value) {
- this.value = value;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Config Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public Config filtered(String... paths) {
- return this;
- }
-
- @Override
- public Optional value(String key) {
- return Optional.ofNullable(value);
- }
- }
-}
\ No newline at end of file
diff --git a/config/api/src/test/java/org/microbule/config/api/ConfigurationExceptionTest.java b/config/api/src/test/java/org/microbule/config/api/ConfigurationExceptionTest.java
deleted file mode 100644
index 7d2ac4f..0000000
--- a/config/api/src/test/java/org/microbule/config/api/ConfigurationExceptionTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.api;
-
-import org.junit.Test;
-import org.microbule.test.core.MicrobuleTestCase;
-
-public class ConfigurationExceptionTest extends MicrobuleTestCase {
-
- @Test
- public void testConstructor() {
- final ConfigurationException exception = new ConfigurationException("Hello, %s!", "Microbule");
- assertEquals("Hello, Microbule!", exception.getMessage());
- }
-
- @Test
- public void testConstructorWithCause() {
- final IllegalArgumentException cause = new IllegalArgumentException("oops!");
- final ConfigurationException exception = new ConfigurationException(cause, "Hello, %s!", "Microbule");
- assertEquals("Hello, Microbule!", exception.getMessage());
- assertEquals(cause, exception.getCause());
- }
-}
\ No newline at end of file
diff --git a/config/consul/pom.xml b/config/consul/pom.xml
deleted file mode 100644
index c4f921b..0000000
--- a/config/consul/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-config-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-config-consul
- Microbule :: Config :: Consul
- bundle
-
-
-
- org.microbule
- microbule-util
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-config-core
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-test-server
- 0.3.0-SNAPSHOT
- test
-
-
- org.microbule
- microbule-gson-decorator
- 0.3.0-SNAPSHOT
- test
-
-
- org.microbule
- microbule-gson-core
- 0.3.0-SNAPSHOT
- test
-
-
-
-
-
diff --git a/config/consul/src/main/java/org/microbule/config/consul/ConsulConfigProvider.java b/config/consul/src/main/java/org/microbule/config/consul/ConsulConfigProvider.java
deleted file mode 100644
index 0dbbfdc..0000000
--- a/config/consul/src/main/java/org/microbule/config/consul/ConsulConfigProvider.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.consul;
-
-import java.util.Base64;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import com.google.common.base.Charsets;
-import com.google.gson.reflect.TypeToken;
-import org.apache.commons.lang3.StringUtils;
-import org.microbule.config.api.Config;
-import org.microbule.config.core.ConfigUtils;
-import org.microbule.config.core.EmptyConfig;
-import org.microbule.config.core.MapConfig;
-import org.microbule.config.spi.ConfigProvider;
-import org.microbule.util.jaxrs.WebTargetUtils;
-
-import static org.microbule.util.jaxrs.WebTargetUtils.extend;
-
-@Singleton
-@Named("consulConfigProvider")
-public class ConsulConfigProvider implements ConfigProvider {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private static final String RECURSE_PARAM = "recurse";
- private static final String SEPARATOR = "/";
- private static final String DEFAULT_BASE_ADDRESS = "http://localhost:8500/v1/kv/microbule";
- private static final String BASE_ADDRESS_PROP = "baseAddress";
- private static final String NAME = "consul";
- private static final TypeToken> TYPE_TOKEN = new TypeToken>() {
- };
-
- private final WebTarget baseTarget;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public ConsulConfigProvider() {
- this(ConfigUtils.bootstrapConfig(NAME).value(BASE_ADDRESS_PROP).orElse(DEFAULT_BASE_ADDRESS));
- }
-
- public ConsulConfigProvider(String baseAddress) {
- baseTarget = ClientBuilder.newClient().target(baseAddress);
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// ConfigProvider Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public Config getConfig(String... path) {
- final Response response = extend(baseTarget, path).queryParam(RECURSE_PARAM, Boolean.TRUE).request(MediaType.APPLICATION_JSON_TYPE).get();
- final String keyPath = Stream.of(path).collect(Collectors.joining(SEPARATOR)) + SEPARATOR;
- return WebTargetUtils.parseJsonResponse(response, TYPE_TOKEN)
- .map(nodes -> nodes.stream().collect(Collectors.toMap(node -> StringUtils.substringAfter(node.getKey(), keyPath), node -> base64Decode(node.getValue()))))
- .map(map -> (Config)new MapConfig(map, SEPARATOR))
- .orElse(EmptyConfig.INSTANCE);
- }
-
- @Override
- public String name() {
- return NAME;
- }
-
- @Override
- public int priority() {
- return ConfigUtils.PRIORITY_EXTERNAL;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- private String base64Decode(String value) {
- return new String(Base64.getDecoder().decode(value), Charsets.UTF_8);
- }
-}
diff --git a/config/consul/src/main/java/org/microbule/config/consul/ConsulNode.java b/config/consul/src/main/java/org/microbule/config/consul/ConsulNode.java
deleted file mode 100644
index 4d2c435..0000000
--- a/config/consul/src/main/java/org/microbule/config/consul/ConsulNode.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.consul;
-
-import com.google.gson.annotations.SerializedName;
-
-public class ConsulNode {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- @SerializedName("Key")
- private final String key;
-
- @SerializedName("Value")
- private final String value;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public ConsulNode(String key, String value) {
- this.key = key;
- this.value = value;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Getter/Setter Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- public String getKey() {
- return key;
- }
-
- public String getValue() {
- return value;
- }
-}
diff --git a/config/consul/src/main/resources/META-INF/beans.xml b/config/consul/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 115b372..0000000
--- a/config/consul/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/config/consul/src/main/resources/OSGI-INF/blueprint/microbule-config-consul.xml b/config/consul/src/main/resources/OSGI-INF/blueprint/microbule-config-consul.xml
deleted file mode 100644
index 3a9b2ee..0000000
--- a/config/consul/src/main/resources/OSGI-INF/blueprint/microbule-config-consul.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/consul/src/test/java/org/microbule/config/consul/ConsulConfigProviderTest.java b/config/consul/src/test/java/org/microbule/config/consul/ConsulConfigProviderTest.java
deleted file mode 100644
index 9c1e25c..0000000
--- a/config/consul/src/test/java/org/microbule/config/consul/ConsulConfigProviderTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.consul;
-
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
-
-import com.google.common.base.Charsets;
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import org.junit.Before;
-import org.junit.Test;
-import org.microbule.config.api.Config;
-import org.microbule.config.core.ConfigUtils;
-import org.microbule.container.core.SimpleContainer;
-import org.microbule.gson.core.DefaultGsonService;
-import org.microbule.gson.decorator.GsonProxyDecorator;
-import org.microbule.gson.decorator.GsonServerDecorator;
-import org.microbule.test.server.JaxrsServerTestCase;
-
-public class ConsulConfigProviderTest extends JaxrsServerTestCase {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private final AtomicReference> response = new AtomicReference<>();
- private static final TypeToken> TYPE_TOKEN = new TypeToken>() {
- };
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- protected void addBeans(SimpleContainer container) {
- container.addBean(new GsonServerDecorator(new DefaultGsonService(container)));
- container.addBean(new GsonProxyDecorator(new DefaultGsonService(container)));
- }
-
- @Override
- protected MockConsulService createImplementation() {
- return new MockConsulServiceImpl(response);
- }
-
- @Before
- public void setBaseAddress() {
- System.setProperty("microbule.consul.baseAddress", getBaseAddress());
- }
-
- @Test
- public void testGetConfig() {
- final ConsulConfigProvider provider = new ConsulConfigProvider();
- assertEquals("consul", provider.name());
- assertEquals(ConfigUtils.PRIORITY_EXTERNAL, provider.priority());
-
- response.set(parseResponse("/response.json", TYPE_TOKEN));
-
- final Config config = provider.getConfig("one", "two");
- assertEquals("Microbule", config.value("three").get());
- assertEquals("three, sir", config.value("five").get());
-
- }
-
- private T parseResponse(String resourceName, TypeToken type) {
- return new Gson().fromJson(new InputStreamReader(getClass().getResourceAsStream(resourceName), Charsets.UTF_8), type.getType());
- }
-}
\ No newline at end of file
diff --git a/config/consul/src/test/java/org/microbule/config/consul/ConsulNodeTest.java b/config/consul/src/test/java/org/microbule/config/consul/ConsulNodeTest.java
deleted file mode 100644
index 64c990c..0000000
--- a/config/consul/src/test/java/org/microbule/config/consul/ConsulNodeTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.consul;
-
-import org.junit.Test;
-import org.microbule.test.core.MockObjectTestCase;
-
-public class ConsulNodeTest extends MockObjectTestCase {
-
- @Test
- public void testConstructor() {
- final ConsulNode node = new ConsulNode("foo", "bar");
- assertEquals("foo", node.getKey());
- assertEquals("bar", node.getValue());
- }
-}
\ No newline at end of file
diff --git a/config/consul/src/test/java/org/microbule/config/consul/MockConsulService.java b/config/consul/src/test/java/org/microbule/config/consul/MockConsulService.java
deleted file mode 100644
index 3bba99c..0000000
--- a/config/consul/src/test/java/org/microbule/config/consul/MockConsulService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.consul;
-
-import java.util.List;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-@Path("/")
-public interface MockConsulService
-{
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @GET
- @Path("/{path:.*}")
- @Produces(MediaType.APPLICATION_JSON)
- List getKeyValues(@PathParam("path") String path);
-}
diff --git a/config/consul/src/test/java/org/microbule/config/consul/MockConsulServiceImpl.java b/config/consul/src/test/java/org/microbule/config/consul/MockConsulServiceImpl.java
deleted file mode 100644
index 1d5c61c..0000000
--- a/config/consul/src/test/java/org/microbule/config/consul/MockConsulServiceImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.consul;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class MockConsulServiceImpl implements MockConsulService {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private final AtomicReference> response;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public MockConsulServiceImpl(AtomicReference> response) {
- this.response = response;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// MockConsulService Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public List getKeyValues(String path) {
- return response.get();
- }
-}
diff --git a/config/consul/src/test/resources/response.json b/config/consul/src/test/resources/response.json
deleted file mode 100644
index 63ab543..0000000
--- a/config/consul/src/test/resources/response.json
+++ /dev/null
@@ -1,18 +0,0 @@
-[
- {
- "LockIndex": 0,
- "Key": "one/two/five",
- "Flags": 0,
- "Value": "dGhyZWUsIHNpcg==",
- "CreateIndex": 14,
- "ModifyIndex": 14
- },
- {
- "LockIndex": 0,
- "Key": "one/two/three",
- "Flags": 0,
- "Value": "TWljcm9idWxl",
- "CreateIndex": 11,
- "ModifyIndex": 11
- }
-]
\ No newline at end of file
diff --git a/config/core/pom.xml b/config/core/pom.xml
deleted file mode 100644
index fcadccb..0000000
--- a/config/core/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-config-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-config-core
- Microbule :: Config :: Core
- bundle
-
-
-
- org.microbule
- microbule-container-api
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-config-api
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-config-spi
- 0.3.0-SNAPSHOT
-
-
- com.google.code.gson
- gson
- ${gson.version}
-
-
- com.google.guava
- guava
- ${guava.version}
-
-
- org.microbule
- microbule-test-core
- 0.3.0-SNAPSHOT
- test
-
-
-
-
diff --git a/config/core/src/main/java/org/microbule/config/core/AbstractConfig.java b/config/core/src/main/java/org/microbule/config/core/AbstractConfig.java
deleted file mode 100644
index 5eb9353..0000000
--- a/config/core/src/main/java/org/microbule/config/core/AbstractConfig.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import java.util.Optional;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import org.microbule.config.api.Config;
-
-public abstract class AbstractConfig implements Config {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- protected static final String DEFAULT_SEPARATOR = ".";
-
- private final String groupPrefix;
- private final String separator;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public AbstractConfig(String groupPrefix, String separator) {
- this.groupPrefix = groupPrefix;
- this.separator = separator;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Abstract Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- protected abstract Config qualifiedConfig(String qualifiedGroupPrefix, String separator);
-
- protected abstract Optional qualifiedValue(String qualifiedKey);
-
-//----------------------------------------------------------------------------------------------------------------------
-// Config Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
-
- @Override
- public Config filtered(String... keys) {
- return qualifiedConfig(qualify(keys), separator);
- }
-
- @Override
- public Optional value(String key) {
- return qualifiedValue(qualify(key));
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- protected String qualify(String... keys) {
- final String keyPath = keys.length == 0 ? null : Stream.of(keys).collect(Collectors.joining(separator));
- return Optional.ofNullable(groupPrefix).map(prefix -> prefix + separator + keyPath).orElse(keyPath);
- }
-}
diff --git a/config/core/src/main/java/org/microbule/config/core/CompositeConfig.java b/config/core/src/main/java/org/microbule/config/core/CompositeConfig.java
deleted file mode 100644
index 43f9131..0000000
--- a/config/core/src/main/java/org/microbule/config/core/CompositeConfig.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import org.microbule.config.api.Config;
-
-public class CompositeConfig implements Config {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private final List members;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public CompositeConfig(Config... members) {
- this(Arrays.asList(members));
- }
-
- public CompositeConfig(List members) {
- this.members = members;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Config Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- public static Config create(List members) {
- switch (members.size()) {
- case 0:
- return EmptyConfig.INSTANCE;
- case 1:
- return members.get(0);
- default:
- return new CompositeConfig(members);
- }
- }
-
- @Override
- public Config filtered(String... paths) {
- return new CompositeConfig(members.stream().map(config -> config.filtered(paths)).collect(Collectors.toList()));
- }
-
- @Override
- public Optional value(String key) {
- return members.stream()
- .map(member -> member.value(key))
- .filter(Optional::isPresent)
- .map(Optional::get)
- .findFirst();
- }
-}
diff --git a/config/core/src/main/java/org/microbule/config/core/ConfigUtils.java b/config/core/src/main/java/org/microbule/config/core/ConfigUtils.java
deleted file mode 100644
index 3f16fbe..0000000
--- a/config/core/src/main/java/org/microbule/config/core/ConfigUtils.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import org.microbule.config.api.Config;
-
-public final class ConfigUtils {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- public static final int PRIORITY_SYSPROP = -2000;
- public static final int PRIORITY_ENV = -1000;
- public static final int DEFAULT_PRIORITY = 0;
- public static final int PRIORITY_EXTERNAL = 1000;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Static Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- public static Config bootstrapConfig(String providerName) {
- return new CompositeConfig(fromProperties(System.getProperties()), new MapConfig(System.getenv()))
- .filtered("microbule", providerName);
- }
-
- public static Config fromProperties(Properties props) {
- Map map = new HashMap<>();
- for (String propertyName : props.stringPropertyNames()) {
- map.put(propertyName, props.getProperty(propertyName));
- }
- return new MapConfig(map);
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- private ConfigUtils() {
- }
-}
diff --git a/config/core/src/main/java/org/microbule/config/core/DefaultConfigService.java b/config/core/src/main/java/org/microbule/config/core/DefaultConfigService.java
deleted file mode 100644
index 1b2e3db..0000000
--- a/config/core/src/main/java/org/microbule/config/core/DefaultConfigService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import java.util.Comparator;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.microbule.config.api.Config;
-import org.microbule.config.api.ConfigService;
-import org.microbule.config.spi.ConfigProvider;
-import org.microbule.container.api.MicrobuleContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Singleton
-@Named("configService")
-public class DefaultConfigService implements ConfigService {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private static final Logger LOGGER = LoggerFactory.getLogger(DefaultConfigService.class);
-
- private final Set providers;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- @Inject
- public DefaultConfigService(MicrobuleContainer container) {
- this.providers = container.pluginSortedSet(ConfigProvider.class, Comparator.comparingInt(ConfigProvider::priority));
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// ConfigService Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public Config createConfig(String... path) {
- return CompositeConfig.create(providers.stream().map(provider -> providerConfig(provider, path)).collect(Collectors.toList()));
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- private Config providerConfig(ConfigProvider provider, String[] path) {
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("Creating configuration using provider \"{}\" at path \"/{}\".", provider.name(), Stream.of(path).collect(Collectors.joining("/")));
- }
- return provider.getConfig(path);
- }
-}
diff --git a/config/core/src/main/java/org/microbule/config/core/EmptyConfig.java b/config/core/src/main/java/org/microbule/config/core/EmptyConfig.java
deleted file mode 100644
index 3b5202f..0000000
--- a/config/core/src/main/java/org/microbule/config/core/EmptyConfig.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import java.util.Optional;
-
-import org.microbule.config.api.Config;
-
-public class EmptyConfig implements Config {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- public static final Config INSTANCE = new EmptyConfig();
-
-//----------------------------------------------------------------------------------------------------------------------
-// Config Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public Config filtered(String... paths) {
- return this;
- }
-
- @Override
- public Optional value(String key) {
- return Optional.empty();
- }
-}
diff --git a/config/core/src/main/java/org/microbule/config/core/MapConfig.java b/config/core/src/main/java/org/microbule/config/core/MapConfig.java
deleted file mode 100644
index b54633f..0000000
--- a/config/core/src/main/java/org/microbule/config/core/MapConfig.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-
-import org.microbule.config.api.Config;
-
-import static java.util.Optional.ofNullable;
-
-public class MapConfig extends AbstractConfig {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private final Map values;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public MapConfig() {
- this(new HashMap<>(), null, DEFAULT_SEPARATOR);
- }
-
- public MapConfig(Map values) {
- this(new HashMap<>(values), null, DEFAULT_SEPARATOR);
- }
-
- public MapConfig(Map values, String separator) {
- this(new HashMap<>(values), null, separator);
- }
-
- private MapConfig(Map values, String groupPrefix, String separator) {
- super(groupPrefix, separator);
- this.values = values;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- public MapConfig addValue(String key, String value) {
- values.put(qualify(key), value);
- return this;
- }
-
- @Override
- protected Config qualifiedConfig(String qualifiedGroupPrefix, String separator) {
- return new MapConfig(values, qualifiedGroupPrefix, separator);
- }
-
- @Override
- protected Optional qualifiedValue(String qualifiedKey) {
- return ofNullable(values.get(qualifiedKey));
- }
-}
diff --git a/config/core/src/main/java/org/microbule/config/core/RecordingConfig.java b/config/core/src/main/java/org/microbule/config/core/RecordingConfig.java
deleted file mode 100644
index 287508f..0000000
--- a/config/core/src/main/java/org/microbule/config/core/RecordingConfig.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.microbule.config.core;
-
-import java.util.Optional;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonNull;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonPrimitive;
-import org.microbule.config.api.Config;
-
-public class RecordingConfig implements Config {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private final JsonObject recordedJson;
- private final Config delegate;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Constructors
-//----------------------------------------------------------------------------------------------------------------------
-
- public RecordingConfig(Config delegate) {
- this(delegate, new JsonObject());
- }
-
- private RecordingConfig(Config delegate, JsonObject recordedJson) {
- this.delegate = delegate;
- this.recordedJson = recordedJson;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Config Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
- @Override
- public Config filtered(String... paths) {
- JsonObject filteredJson = recordedJson;
- for (String path : paths) {
- JsonObject sub = new JsonObject();
- filteredJson.add(path, sub);
- filteredJson = sub;
- }
- return new RecordingConfig(delegate.filtered(paths), filteredJson);
- }
-
- @Override
- public Optional value(String key) {
- final Optional value = delegate.value(key);
- recordedJson.add(key, value.map(JsonPrimitive::new).orElse(JsonNull.INSTANCE));
- return value;
- }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Getter/Setter Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- public JsonObject getRecordedJson() {
- return recordedJson;
- }
-}
diff --git a/config/core/src/main/resources/META-INF/beans.xml b/config/core/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 115b372..0000000
--- a/config/core/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/config/core/src/main/resources/OSGI-INF/blueprint/microbule-config-core.xml b/config/core/src/main/resources/OSGI-INF/blueprint/microbule-config-core.xml
deleted file mode 100644
index 37d1848..0000000
--- a/config/core/src/main/resources/OSGI-INF/blueprint/microbule-config-core.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/core/src/test/java/org/microbule/config/core/CompositeConfigTest.java b/config/core/src/test/java/org/microbule/config/core/CompositeConfigTest.java
deleted file mode 100644
index 44e95ea..0000000
--- a/config/core/src/test/java/org/microbule/config/core/CompositeConfigTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import com.google.common.collect.Lists;
-import org.junit.Assert;
-import org.junit.Test;
-import org.microbule.config.api.Config;
-
-public class CompositeConfigTest extends Assert {
- @Test
- public void testValue() {
- MapConfig config1 = new MapConfig();
- config1.addValue("foo", "bar");
- MapConfig config2 = new MapConfig();
- config2.addValue("foo", "baz");
- config2.addValue("hello", "world");
-
- final CompositeConfig config = new CompositeConfig(config1, config2);
- assertEquals("bar", config.value("foo").get());
- assertEquals("world", config.value("hello").get());
- }
-
- @Test
- public void testGroup() {
- MapConfig config1 = new MapConfig();
- config1.addValue("a.foo", "bar");
- MapConfig config2 = new MapConfig();
- config2.addValue("a.foo", "baz");
- config2.addValue("a.hello", "world");
-
- final Config config = new CompositeConfig(config1, config2).filtered("a");
- assertEquals("bar", config.value("foo").get());
- assertEquals("world", config.value("hello").get());
- }
-
- @Test
- public void testCreate() {
-
- Config config1 = new MapConfig();
- Config config2 = new MapConfig();
-
- assertSame(EmptyConfig.INSTANCE, CompositeConfig.create(Lists.newArrayList()));
-
- assertEquals(config1, CompositeConfig.create(Lists.newArrayList(config1)));
-
-
- }
-}
\ No newline at end of file
diff --git a/config/core/src/test/java/org/microbule/config/core/ConfigUtilsTest.java b/config/core/src/test/java/org/microbule/config/core/ConfigUtilsTest.java
deleted file mode 100644
index 9c7edd7..0000000
--- a/config/core/src/test/java/org/microbule/config/core/ConfigUtilsTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import org.junit.Test;
-import org.microbule.config.api.Config;
-import org.microbule.test.core.MicrobuleTestCase;
-
-public class ConfigUtilsTest extends MicrobuleTestCase {
-
- @Test
- public void testIsUtilsClass() throws Exception {
- assertIsUtilsClass(ConfigUtils.class);
- }
-
- @Test
- public void testBootstrapConfig() {
- System.setProperty("microbule.foo.bar", "baz");
- final Config config = ConfigUtils.bootstrapConfig("foo");
- assertEquals("baz", config.value("bar").get());
- }
-
-}
\ No newline at end of file
diff --git a/config/core/src/test/java/org/microbule/config/core/DefaultConfigServiceTest.java b/config/core/src/test/java/org/microbule/config/core/DefaultConfigServiceTest.java
deleted file mode 100644
index 89c1451..0000000
--- a/config/core/src/test/java/org/microbule/config/core/DefaultConfigServiceTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import java.util.Comparator;
-import java.util.SortedSet;
-import java.util.concurrent.ConcurrentSkipListSet;
-
-import org.junit.Test;
-import org.microbule.config.api.Config;
-import org.microbule.config.spi.ConfigProvider;
-import org.microbule.container.api.MicrobuleContainer;
-import org.microbule.test.core.MockObjectTestCase;
-import org.mockito.Mock;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.same;
-import static org.mockito.Mockito.when;
-
-public class DefaultConfigServiceTest extends MockObjectTestCase {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- @Mock
- private ConfigProvider provider1;
-
- @Mock
- private ConfigProvider provider2;
-
- @Mock
- private MicrobuleContainer container;
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Test
- @SuppressWarnings("unchecked")
- public void testWithNoConfigProviders() {
- final MapConfig config1 = new MapConfig();
- config1.addValue("a.one", "config1.a1");
- config1.addValue("b.one", "config1.b1");
- config1.addValue("b.two", "config1.b2");
-
- when(provider1.getConfig("a")).thenReturn(config1.filtered("a"));
- when(provider1.getConfig("b")).thenReturn(config1.filtered("b"));
- when(provider1.name()).thenReturn("provider1");
- when(provider1.priority()).thenReturn(ConfigUtils.DEFAULT_PRIORITY);
-
- final MapConfig config2 = new MapConfig();
- config2.addValue("a.one", "config2.a1");
- config2.addValue("a.three", "config2.a3");
- config2.addValue("b.one", "config2.b1");
- config2.addValue("b.three", "config2.b3");
-
- when(provider2.getConfig("a")).thenReturn(config2.filtered("a"));
- when(provider2.getConfig("b")).thenReturn(config2.filtered("b"));
- when(provider2.name()).thenReturn("provider2");
- when(provider2.priority()).thenReturn(ConfigUtils.PRIORITY_EXTERNAL);
-
-
- when(container.pluginSortedSet(same(ConfigProvider.class), any())).thenAnswer(invocation -> {
- SortedSet set = new ConcurrentSkipListSet<>((Comparator) invocation.getArgument(1));
- set.add(provider1);
- set.add(provider2);
- return set;
- });
-
- final DefaultConfigService configService = new DefaultConfigService(container);
-
- Config config = configService.createConfig("a");
- assertEquals("config1.a1", config.value("one").get());
-
- assertEquals("config2.b3", createWithoutLogging(() -> configService.createConfig("b")).value("three").get());
- }
-}
\ No newline at end of file
diff --git a/config/core/src/test/java/org/microbule/config/core/EmptyConfigTest.java b/config/core/src/test/java/org/microbule/config/core/EmptyConfigTest.java
deleted file mode 100644
index 1039235..0000000
--- a/config/core/src/test/java/org/microbule/config/core/EmptyConfigTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class EmptyConfigTest extends Assert {
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
- @Test
- public void testValue() {
- assertFalse(EmptyConfig.INSTANCE.value("whatever").isPresent());
- }
-
- @Test
- public void testGroup() {
- assertSame(EmptyConfig.INSTANCE, EmptyConfig.INSTANCE.filtered("whatever"));
- }
-}
\ No newline at end of file
diff --git a/config/core/src/test/java/org/microbule/config/core/MapConfigTest.java b/config/core/src/test/java/org/microbule/config/core/MapConfigTest.java
deleted file mode 100644
index 941825e..0000000
--- a/config/core/src/test/java/org/microbule/config/core/MapConfigTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.core;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.microbule.config.api.Config;
-
-public class MapConfigTest extends Assert {
- @Test
- public void testValue() {
- Map values = new HashMap<>();
- values.put("foo", "bar");
- final MapConfig config = new MapConfig(values);
- assertEquals("bar", config.value("foo").get());
- }
-
- @Test
- public void testWithCustomSeparator() {
- Map values = new HashMap<>();
- values.put("foo/bar", "baz");
- final MapConfig config = new MapConfig(values, "/");
- assertEquals("baz", config.filtered("foo").value("bar").get());
- }
-
- @Test
- public void testFilteredWithNoPaths() {
- Map values = new HashMap<>();
- values.put("foo/bar", "baz");
- final Config config = new MapConfig(values, "/").filtered();
- assertEquals("baz", config.filtered("foo").value("bar").get());
- }
-}
\ No newline at end of file
diff --git a/config/core/src/test/java/org/microbule/config/core/RecordingConfigTest.java b/config/core/src/test/java/org/microbule/config/core/RecordingConfigTest.java
deleted file mode 100644
index 74e9d39..0000000
--- a/config/core/src/test/java/org/microbule/config/core/RecordingConfigTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.microbule.config.core;
-
-import com.google.gson.JsonNull;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonPrimitive;
-import org.junit.Test;
-import org.microbule.config.api.Config;
-import org.microbule.test.core.MicrobuleTestCase;
-
-public class RecordingConfigTest extends MicrobuleTestCase {
-
- @Test
- public void testWithEmpty() {
- final RecordingConfig recording = new RecordingConfig(new MapConfig());
- recording.value("foo");
- recording.value("bar");
- recording.filtered("baz");
- final JsonObject json = recording.getRecordedJson();
- assertEquals(JsonNull.INSTANCE, json.get("foo"));
- assertEquals(JsonNull.INSTANCE, json.get("bar"));
- assertEquals(new JsonObject(), json.get("baz"));
- }
-
- @Test
- public void testRecording() {
- final MapConfig mapConfig = new MapConfig();
- mapConfig.addValue("foo", "bar");
- mapConfig.addValue("theint", "12345");
- ((MapConfig) mapConfig.filtered("nested")).addValue("hello", "world");
- ((MapConfig) mapConfig.filtered("nested", "nested2")).addValue("hello", "world");
- final RecordingConfig recording = new RecordingConfig(mapConfig);
-
- recording.value("foo");
- recording.value("baz");
- recording.integerValue("theint");
- final Config nested = recording.filtered("nested");
- nested.value("hello");
- nested.value("bogus");
- nested.filtered("nested2").value("hello");
-
- final JsonObject json = recording.getRecordedJson();
-
- assertEquals(new JsonPrimitive("bar"), json.get("foo"));
- assertEquals(new JsonPrimitive("12345"), json.get("theint"));
- assertEquals(JsonNull.INSTANCE, json.get("baz"));
-
- JsonObject nestedJson = json.getAsJsonObject("nested");
- assertEquals(new JsonPrimitive("world"), nestedJson.get("hello"));
- assertEquals(JsonNull.INSTANCE, nestedJson.get("bogus"));
-
- JsonObject nestedJson2 = nestedJson.getAsJsonObject("nested2");
- assertEquals(new JsonPrimitive("world"), nestedJson2.get("hello"));
- }
-}
\ No newline at end of file
diff --git a/config/env/pom.xml b/config/env/pom.xml
deleted file mode 100644
index 97ee63d..0000000
--- a/config/env/pom.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.microbule
- microbule-config-parent
- 0.3.0-SNAPSHOT
-
-
- microbule-config-env
- Microbule :: Config :: Environment Variables
- bundle
-
-
-
-
- org.microbule
- microbule-config-core
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-config-spi
- 0.3.0-SNAPSHOT
-
-
- org.microbule
- microbule-test-core
- 0.3.0-SNAPSHOT
- test
-
-
-
-
diff --git a/config/env/src/main/java/org/microbule/config/env/EnvironmentVariablesConfigProvider.java b/config/env/src/main/java/org/microbule/config/env/EnvironmentVariablesConfigProvider.java
deleted file mode 100644
index 0cc4e1b..0000000
--- a/config/env/src/main/java/org/microbule/config/env/EnvironmentVariablesConfigProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2017 The Microbule Authors.
- *
- * Licensed 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.
- *
- */
-
-package org.microbule.config.env;
-
-import java.util.Map;
-import java.util.function.Supplier;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.microbule.config.api.Config;
-import org.microbule.config.core.ConfigUtils;
-import org.microbule.config.core.MapConfig;
-import org.microbule.config.spi.ConfigProvider;
-
-@Singleton
-@Named("envConfigProvider")
-public class EnvironmentVariablesConfigProvider implements ConfigProvider {
-//----------------------------------------------------------------------------------------------------------------------
-// Fields
-//----------------------------------------------------------------------------------------------------------------------
-
- private static final String SEPARATOR = "_";
- private final Supplier