Connection implements Closeable
authorJakub Skoczen <jakub@indexdata.dk>
Fri, 19 Apr 2013 08:44:21 +0000 (10:44 +0200)
committerJakub Skoczen <jakub@indexdata.dk>
Fri, 19 Apr 2013 08:44:21 +0000 (10:44 +0200)
this allow for try-with-resources pattern in Java 7 while
being backwards compatible

src/main/java/org/yaz4j/Connection.java

index 4accb99..ae99d7c 100644 (file)
@@ -1,5 +1,6 @@
 package org.yaz4j;
 
+import java.io.Closeable;
 import org.yaz4j.exception.ZoomException;
 import org.yaz4j.jni.SWIGTYPE_p_ZOOM_connection_p;
 import org.yaz4j.jni.SWIGTYPE_p_ZOOM_query_p;
@@ -35,7 +36,7 @@ import org.yaz4j.jni.yaz4jlib;
  * @see <a href="http://www.indexdata.com/yaz/doc/zoom.html#zoom-connections">YAZ ZOOM Connection</a>
  * @author jakub
  */
-public class Connection {
+public class Connection implements Closeable {
 
   private String host;
   private int port;