Author: peter_firmstone Date: Wed Jan 19 11:28:37 2011 New Revision: 1060771
URL: http://svn.apache.org/viewvc?rev=1060771&view=rev Log: ResultStream, add IOException to methods, inspired by Dan's comments on river-dev. Modified: incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamFilter.java incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamUnmarshaller.java incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/util/ResultStream.java Modified: incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamFilter.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamFilter.java?rev=1060771&r1=1060770&r2=1060771&view=diff ============================================================================== --- incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamFilter.java (original) +++ incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamFilter.java Wed Jan 19 11:28:37 2011 @@ -5,6 +5,7 @@ package org.apache.river.api.lookup; +import java.io.IOException; import net.jini.lookup.*; import org.apache.river.api.util.ResultStream; import java.util.ArrayList; @@ -48,7 +49,7 @@ public class ServiceResultStreamFilter i filters.addAll(Arrays.asList(sf)); } - public ServiceItem get() { + public ServiceItem get() throws IOException { for(Object item = inputResultStream.get(); item != null; item = inputResultStream.get()) { if (item instanceof ServiceItem){ @@ -64,7 +65,7 @@ public class ServiceResultStreamFilter i return null; // Our stream terminated item was null; } - public void close() { + public void close() throws IOException { inputResultStream.close(); } } Modified: incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamUnmarshaller.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamUnmarshaller.java?rev=1060771&r1=1060770&r2=1060771&view=diff ============================================================================== --- incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamUnmarshaller.java (original) +++ incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/ServiceResultStreamUnmarshaller.java Wed Jan 19 11:28:37 2011 @@ -18,6 +18,7 @@ package org.apache.river.api.lookup; +import java.io.IOException; import java.security.CodeSource; import org.apache.river.api.lookup.MarshalledServiceItem; import org.apache.river.api.util.ResultStream; @@ -49,7 +50,7 @@ public class ServiceResultStreamUnmarsha codebase = cs; } - public ServiceItem get() { + public ServiceItem get() throws IOException { if (input == null) return null; for(Object item = input.get(); item != null; item = input.get()) { if (item instanceof MarshalledServiceItem){ @@ -67,7 +68,7 @@ public class ServiceResultStreamUnmarsha return null; // Our stream terminated item was null; } - public void close() { + public void close() throws IOException { if (input == null) return; input.close(); } Modified: incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/util/ResultStream.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/util/ResultStream.java?rev=1060771&r1=1060770&r2=1060771&view=diff ============================================================================== --- incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/util/ResultStream.java (original) +++ incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/util/ResultStream.java Wed Jan 19 11:28:37 2011 @@ -18,6 +18,8 @@ package org.apache.river.api.util; +import java.io.IOException; + /** * This interface is similar to an Enumerator, it is designed to return * results incrementally in loops, however unlike an Enumerator, there is no @@ -32,10 +34,10 @@ public interface ResultStream<T> { * Get next T, call from a loop until T is null; * @return T unless end of stream in which case null is returned. */ - public T get(); + public T get() throws IOException; /** * Close the result stream, this allows the implementer to close any * resources prior to deleting reference. */ - public void close(); + public void close() throws IOException; }
