incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject svn commit: r960567 - /incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java
Date Mon, 05 Jul 2010 11:51:25 GMT
Author: zoe
Date: Mon Jul  5 11:51:24 2010
New Revision: 960567

URL: http://svn.apache.org/viewvc?rev=960567&view=rev
Log:
ARIES-348 - Added a check for nul

Modified:
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java

Modified: incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java?rev=960567&r1=960566&r2=960567&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java
(original)
+++ incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java
Mon Jul  5 11:51:24 2010
@@ -50,12 +50,17 @@ public class ServiceInterceptor implemen
 			ServiceReference[] references = ctx.getAllServiceReferences(
 					ModelInfoService.class.getName(), null);
 
-			for (ServiceReference reference : references) {
-				registerServiceEnhancer(reference);
-			}
 
 			ctx.addServiceListener(this, "(objectclass='"
-					+ ModelInfoService.class.getName() + "')");
+						+ ModelInfoService.class.getName() + "')");
+
+			//If we found any service references...
+			if(references != null && references.length != 0) {
+				for (ServiceReference reference : references) {
+					registerServiceEnhancer(reference);
+				}
+			}
+
 
 		} catch (InvalidSyntaxException e) {
 			e.printStackTrace();



Mime
View raw message