geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r807312 - in /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container: AbstractServiceReferenceRecipe.java BeanRecipe.java ReferenceListRecipe.java ServiceListener.java ServiceRecipe.java
Date Mon, 24 Aug 2009 17:35:57 GMT
Author: gawor
Date: Mon Aug 24 17:35:56 2009
New Revision: 807312

URL: http://svn.apache.org/viewvc?rev=807312&view=rev
Log:
synchronization fixes for ReferenceListRecipe and other minor improvments

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceListener.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java?rev=807312&r1=807311&r2=807312&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
Mon Aug 24 17:35:56 2009
@@ -460,7 +460,7 @@
                     ReflectionUtils.invoke(blueprintContainer.getAccessControlContext(),

                                            method, listener, reference);
                 } catch (Exception e) {
-                    LOGGER.info("Error calling listener method " + method, e);
+                    LOGGER.error("Error calling listener method " + method, e);
                 }
             }
             for (Method method : objectMethods) {
@@ -468,7 +468,7 @@
                     ReflectionUtils.invoke(blueprintContainer.getAccessControlContext(),

                                            method, listener, service);
                 } catch (Exception e) {
-                    LOGGER.info("Error calling listener method " + method, e);
+                    LOGGER.error("Error calling listener method " + method, e);
                 }
             }
             Map<String, Object> props = null;
@@ -485,7 +485,7 @@
                     ReflectionUtils.invoke(blueprintContainer.getAccessControlContext(),

                                            method, listener, service, props);
                 } catch (Exception e) {
-                    LOGGER.info("Error calling listener method " + method, e);
+                    LOGGER.error("Error calling listener method " + method, e);
                 }
             }
         }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java?rev=807312&r1=807311&r2=807312&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
Mon Aug 24 17:35:56 2009
@@ -586,10 +586,13 @@
             if (getter != null) {
                 try {
                     instance = invoke(getter, instance, null);
-                    clazz = instance.getClass();
                 } catch (Exception e) {
                     throw new ComponentDefinitionException("Error getting property: " + names[i]
+ " on bean " + getName() + " when setting property " + propertyName + " on class " + clazz.getName(),
getRealCause(e));
                 }
+                if (instance == null) {
+                    throw new ComponentDefinitionException("Error setting compound property
" + propertyName + " on bean " + getName() + ". Property " + names[i] + " is null");
+                }
+                clazz = instance.getClass();
             } else {
                 throw new ComponentDefinitionException("No getter for " + names[i] + " property
on bean " + getName() + " when setting property " + propertyName + " on class " + clazz.getName());
             }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java?rev=807312&r1=807311&r2=807312&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java
Mon Aug 24 17:35:56 2009
@@ -56,7 +56,8 @@
     private final List<ManagedCollection> collections = new ArrayList<ManagedCollection>();
     private final DynamicCollection<ServiceDispatcher> storage = new DynamicCollection<ServiceDispatcher>();
     private final List<ServiceDispatcher> unboundDispatchers = new ArrayList<ServiceDispatcher>();
-
+    private final Object monitor = new Object();
+    
     public ReferenceListRecipe(String name,
                          ExtendedBlueprintContainer blueprintContainer,
                          ReferenceListMetadata metadata,
@@ -98,7 +99,7 @@
     }
 
     protected void track(ServiceReference reference) {
-        if (storage != null) {
+        synchronized (monitor) {
             try {
                 // ServiceReferences may be tracked at multiple points:
                 //  * first after the collection creation in #internalCreate()
@@ -145,7 +146,7 @@
     }
 
     protected void untrack(ServiceReference reference) {
-        if (storage != null) {
+        synchronized (monitor) {
             ServiceDispatcher dispatcher = findDispatcher(reference);
             if (dispatcher != null) {
                 unbind(dispatcher.reference, dispatcher.proxy);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceListener.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceListener.java?rev=807312&r1=807311&r2=807312&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceListener.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceListener.java
Mon Aug 24 17:35:56 2009
@@ -98,7 +98,7 @@
                 ReflectionUtils.invoke(blueprintContainer.getAccessControlContext(), 
                                        method, listener, service, properties);
             } catch (Exception e) {
-                LOGGER.info("Error calling listener method " + method, e);
+                LOGGER.error("Error calling listener method " + method, e);
             }
         }
     }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java?rev=807312&r1=807311&r2=807312&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
Mon Aug 24 17:35:56 2009
@@ -69,7 +69,7 @@
     private volatile ServiceRegistration registration;
     private Map registrationProperties;
     private List<ServiceListener> listeners;
-    private Object service;
+    private volatile Object service;
     
     public ServiceRecipe(String name,
                          ExtendedBlueprintContainer blueprintContainer,



Mime
View raw message