geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r792949 - in /geronimo/sandbox/blueprint: blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/ blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ blueprint-core/src/main/java/org/apache/geronimo/bluepri...
Date Fri, 10 Jul 2009 13:35:05 GMT
Author: gnodet
Date: Fri Jul 10 13:35:04 2009
New Revision: 792949

URL: http://svn.apache.org/viewvc?rev=792949&view=rev
Log:
Revert some of the previous changes

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/container/Parser.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ReflectionUtils.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=792949&r1=792948&r2=792949&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 Jul 10 13:35:04 2009
@@ -44,6 +44,7 @@
     private BlueprintContainer blueprintContainer;
     private ConfigurationAdmin configAdmin; 
     private String persistentId;
+    private transient Configuration config;
 
     public BlueprintContainer getBlueprintContainer() {
         return blueprintContainer;
@@ -71,12 +72,7 @@
 
     protected String getProperty(String val) {
         LOGGER.debug("Retrieving property value {} from configuration with pid {}", val,
persistentId);
-        Configuration config = null;
-        try {
-            config = CmUtils.getConfiguration(configAdmin, persistentId);
-        } catch (IOException e) {
-            // ignore
-        }
+        Configuration config = getConfig();
         Object v = null;
         if (config != null) {
             Dictionary props = config.getProperties();
@@ -97,4 +93,15 @@
         return v != null ? v.toString() : null;
     }
 
+    protected synchronized Configuration getConfig() {
+        if (config == null) {
+            try {
+                config = CmUtils.getConfiguration(configAdmin, persistentId);
+            } catch (IOException e) {
+                // ignore
+            }
+        }
+        return config;
+    }
+
 }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java?rev=792949&r1=792948&r2=792949&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
Fri Jul 10 13:35:04 2009
@@ -241,7 +241,7 @@
     private void findNamespaces(Set<URI> namespaces, Node node) {
         if (node instanceof Element || node instanceof Attr) {
             String ns = node.getNamespaceURI();
-            if (ns != null) {
+            if (ns != null && !isBlueprintNamespace(ns)) {
                 namespaces.add(URI.create(ns));
             }
         }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ReflectionUtils.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ReflectionUtils.java?rev=792949&r1=792948&r2=792949&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ReflectionUtils.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ReflectionUtils.java
Fri Jul 10 13:35:04 2009
@@ -39,6 +39,7 @@
  */
 public class ReflectionUtils {
 
+    // TODO: MLK: PropertyDescriptor holds a reference to Method which holds a reference
to the Class itself
     private static Map<Class, PropertyDescriptor[]> beanInfos = Collections.synchronizedMap(new
WeakHashMap<Class, PropertyDescriptor[]>());
 
     public static Set<String> getImplementedInterfaces(Set<String> classes, Class
clazz) {
@@ -181,14 +182,14 @@
     public static class PropertyDescriptor {
         private String name;
         private Class type;
-        private SoftReference<Method> getter;
-        private SoftReference<Method> setter;
+        private Method getter;
+        private Method setter;
 
         public PropertyDescriptor(String name, Class type, Method getter, Method setter)
{
             this.name = name;
             this.type = type;
-            this.getter = new SoftReference<Method>(getter);
-            this.setter = new SoftReference<Method>(setter);
+            this.getter = getter;
+            this.setter = setter;
         }
 
         public String getName() {
@@ -196,11 +197,11 @@
         }
 
         public Method getGetter() {
-            return getter.get();
+            return getter;
         }
 
         public Method getSetter() {
-            return setter.get();
+            return setter;
         }
     }
 



Mime
View raw message