Repository: tomee
Updated Branches:
  refs/heads/master 68ae37bdf -> d57b2a910


adding configurationCustomizer. in tomee-embedded.properties


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

Branch: refs/heads/master
Commit: d57b2a91093b9f74451847728fe60ee24829cead
Parents: 68ae37b
Author: rmannibucau <rmannibu...@apache.org>
Authored: Thu Sep 22 15:04:42 2016 +0200
Committer: rmannibucau <rmannibu...@apache.org>
Committed: Thu Sep 22 15:04:42 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/tomee/embedded/Configuration.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/d57b2a91/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
----------------------------------------------------------------------
diff --git 
a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
 
b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
index 650e47e..5e6843b 100644
--- 
a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
+++ 
b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
@@ -212,6 +212,18 @@ public class Configuration {
                         }
                     }
                     
securityConstaint(SecurityConstaintBuilder.class.cast(recipe.create()));
+                } else if (prop.equals("configurationCustomizer.")) {
+                    final String next = 
prop.substring("configurationCustomizer.".length());
+                    if (next.contains(".")) {
+                        continue;
+                    }
+                    final ObjectRecipe recipe = new 
ObjectRecipe(SecurityConstaintBuilder.class.getName());
+                    for (final String nestedConfig : 
config.stringPropertyNames()) {
+                        if (nestedConfig.startsWith(prop)) {
+                            
recipe.setProperty(nestedConfig.substring(prop.length() + 1 /*dot*/), 
config.getProperty(nestedConfig));
+                        }
+                    }
+                    
addCustomizer(ConfigurationCustomizer.class.cast(recipe.create()));
                 }
             }
             return this;

Reply via email to