tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [04/16] incubator-tamaya git commit: Added method to access ConfigurationContext from Configuration.
Date Sun, 13 Mar 2016 23:59:05 GMT
Added method to access ConfigurationContext from Configuration.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/2abd033b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/2abd033b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/2abd033b

Branch: refs/heads/master
Commit: 2abd033bb2ee429b49cc80418a85e9f9301508e5
Parents: dc252f9
Author: anatole <anatole@apache.org>
Authored: Sun Mar 13 22:26:18 2016 +0100
Committer: anatole <anatole@apache.org>
Committed: Sun Mar 13 22:26:18 2016 +0100

----------------------------------------------------------------------
 .../apache/tamaya/core/internal/DefaultConfiguration.java    | 8 ++++++++
 .../tamaya/core/internal/DefaultConfigurationProvider.java   | 8 ++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2abd033b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
index 9e50c87..ee8abcd 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
@@ -203,4 +203,12 @@ public class DefaultConfiguration implements Configuration {
     public <T> T query(ConfigQuery<T> query) {
         return query.query(this);
     }
+
+    /**
+     * Access the configuration's context.
+     * @return the configurastion context-
+     */
+    public ConfigurationContext getConfigurationContext() {
+        return configurationContext;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2abd033b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationProvider.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationProvider.java
index 4330b7e..34c3c53 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationProvider.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationProvider.java
@@ -45,6 +45,14 @@ public class DefaultConfigurationProvider implements ConfigurationProviderSpi
{
     }
 
     @Override
+    public ConfigurationContext getConfigurationContext(Configuration config) {
+        if(config instanceof DefaultConfiguration){
+            return ((DefaultConfiguration)config).getConfigurationContext();
+        }
+        return null;
+    }
+
+    @Override
     public ConfigurationContextBuilder getConfigurationContextBuilder() {
         return ServiceContextManager.getServiceContext().getService(ConfigurationContextBuilder.class);
     }


Mime
View raw message