incubator-directmemory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1244589 - /incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/serialization/SerializerFactory.java
Date Wed, 15 Feb 2012 16:53:27 GMT
Author: simonetripodi
Date: Wed Feb 15 16:53:27 2012
New Revision: 1244589

URL: http://svn.apache.org/viewvc?rev=1244589&view=rev
Log:
iterative strategy to get the Serializer impl

Modified:
    incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/serialization/SerializerFactory.java

Modified: incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/serialization/SerializerFactory.java
URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/serialization/SerializerFactory.java?rev=1244589&r1=1244588&r2=1244589&view=diff
==============================================================================
--- incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/serialization/SerializerFactory.java
(original)
+++ incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/serialization/SerializerFactory.java
Wed Feb 15 16:53:27 2012
@@ -30,9 +30,18 @@ public final class SerializerFactory
     {
         Iterator<Serializer> serializers = load( Serializer.class ).iterator();
 
-        if ( serializers.hasNext() )
+        // iterate over all found services
+        while ( serializers.hasNext() )
         {
-            return serializers.next();
+            // try getting the current service and return
+            try
+            {
+                return serializers.next();
+            }
+            catch ( Throwable t )
+            {
+                // just ignore, skip and try getting the next
+            }
         }
 
         return new StandardSerializer();



Mime
View raw message