aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1341257 - /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceRecipe.java
Date Mon, 21 May 2012 23:12:42 GMT
Author: gnodet
Date: Mon May 21 23:12:42 2012
New Revision: 1341257

URL: http://svn.apache.org/viewvc?rev=1341257&view=rev
Log:
Improve timeout exception when an osgi service can't be found


Conflicts:

	blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceRecipe.java

Modified:
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceRecipe.java

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceRecipe.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceRecipe.java?rev=1341257&r1=1341256&r2=1341257&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceRecipe.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceRecipe.java
Mon May 21 23:12:42 2012
@@ -220,11 +220,16 @@ public class ReferenceRecipe extends Abs
                   } 
                   
                   if (failed) {
-                    LOGGER.info("Timeout expired when waiting for OSGi service {}", getOsgiFilter());
-                    throw new ServiceUnavailableException("Timeout expired when waiting for
OSGi service", getOsgiFilter());
+                    if (metadata.getAvailability() == ServiceReferenceMetadata.AVAILABILITY_MANDATORY)
{
+                        LOGGER.info("Timeout expired when waiting for mandatory OSGi service
reference {}", getOsgiFilter());
+                        throw new ServiceUnavailableException("Timeout expired when waiting
for mandatory OSGi service reference: " + getOsgiFilter(), getOsgiFilter());
+                    } else {
+                        LOGGER.info("No matching service for optional OSGi service reference
{}", getOsgiFilter());
+                        throw new ServiceUnavailableException("No matching service for optional
OSGi service reference: " + getOsgiFilter(), getOsgiFilter());
+                    }
                   }
                 } else {
-                    throw new ServiceUnavailableException("The Blueprint container is being
or has been destroyed", getOsgiFilter());
+                    throw new ServiceUnavailableException("The Blueprint container is being
or has been destroyed: " + getOsgiFilter(), getOsgiFilter());
                 }
             } else {
             



Mime
View raw message