geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r779864 - in /geronimo/sandbox/blueprint: blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmPropertyPlaceholder.java blueprint-core/src/main/java/org/apache/geronimo/blueprint/beans/AbstractPropertyPlaceholder.java
Date Fri, 29 May 2009 06:29:23 GMT
Author: gnodet
Date: Fri May 29 06:29:22 2009
New Revision: 779864

URL: http://svn.apache.org/viewvc?rev=779864&view=rev
Log:
Improve property placeholders to always use late binding

Modified:
    geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmPropertyPlaceholder.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/beans/AbstractPropertyPlaceholder.java

Modified: geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmPropertyPlaceholder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmPropertyPlaceholder.java?rev=779864&r1=779863&r2=779864&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmPropertyPlaceholder.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmPropertyPlaceholder.java
Fri May 29 06:29:22 2009
@@ -80,13 +80,6 @@
         this.defaultProperties = defaultProperties;
     }
 
-    @Override
-    protected Metadata processValueMetadata(ValueMetadata metadata) {
-        // TODO: we need to wrap the old metadata so that multiple placeholders can work
together
-        // TODO: move this code in the parent class
-        return new LateBindingValueMetadata(metadata.getStringValue(), metadata.getTypeName());
-    }
-
     protected String getProperty(String val) {
         LOGGER.debug("Retrieving property value {} from configuration with pid {}", val,
persistentId);
         Configuration config = null;
@@ -120,37 +113,4 @@
         return v != null ? v.toString() : null;
     }
 
-    public class LateBindingValueMetadata implements MutableValueMetadata {
-
-        private String stringValue;
-        private String typeName;
-        private boolean retrieved;
-        private String retrievedValue;
-
-        public LateBindingValueMetadata(String stringValue, String typeName) {
-            this.stringValue = stringValue;
-            this.typeName = typeName;
-        }
-
-        public String getStringValue() {
-            if (!retrieved) {
-                retrieved = true;
-                retrievedValue = processString(stringValue);
-            }
-            return retrievedValue;
-        }
-
-        public void setStringValue(String stringValue) {
-            this.stringValue = stringValue;
-        }
-
-        public String getTypeName() {
-            return typeName;
-        }
-
-        public void setTypeName(String typeName) {
-            this.typeName = typeName;
-        }
-    }
-
 }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/beans/AbstractPropertyPlaceholder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/beans/AbstractPropertyPlaceholder.java?rev=779864&r1=779863&r2=779864&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/beans/AbstractPropertyPlaceholder.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/beans/AbstractPropertyPlaceholder.java
Fri May 29 06:29:22 2009
@@ -194,8 +194,7 @@
     }
 
     protected Metadata processValueMetadata(ValueMetadata metadata) {
-        ((MutableValueMetadata) metadata).setStringValue(processString(metadata.getStringValue()));
-        return metadata;
+        return new LateBindingValueMetadata(metadata);
     }
 
     protected String processString(String str) {
@@ -221,4 +220,28 @@
         return pattern;
     }
 
+    public class LateBindingValueMetadata implements ValueMetadata {
+
+        private final ValueMetadata metadata;
+        private boolean retrieved;
+        private String retrievedValue;
+
+        public LateBindingValueMetadata(ValueMetadata metadata) {
+            this.metadata = metadata;
+        }
+
+        public String getStringValue() {
+            if (!retrieved) {
+                retrieved = true;
+                retrievedValue = processString(metadata.getStringValue());
+            }
+            return retrievedValue;
+        }
+
+        public String getTypeName() {
+            return metadata.getTypeName();
+        }
+
+    }
+
 }



Mime
View raw message