summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-25 04:57:24 (EDT)
committerEike Stepper2007-08-25 04:57:24 (EDT)
commit0d5e3c2b2c5b70954315b5d44fd13b12dc33a72c (patch)
tree3adc6bf1bd3533afa7960649b04598ffe99c4ee3
parent2181d6279e8e68aa18478ff16d2aa947c900cb4b (diff)
downloadcdo-0d5e3c2b2c5b70954315b5d44fd13b12dc33a72c.zip
cdo-0d5e3c2b2c5b70954315b5d44fd13b12dc33a72c.tar.gz
cdo-0d5e3c2b2c5b70954315b5d44fd13b12dc33a72c.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java5
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/CloseableIterator.java21
4 files changed, 29 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
index c41a3e7..76a44d7 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
@@ -14,7 +14,8 @@ import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
-import java.util.Iterator;
+import org.eclipse.net4j.util.io.CloseableIterator;
+
import java.util.Map;
/**
@@ -40,7 +41,7 @@ public interface IMappingStrategy
public IMapping getMapping(CDOClass cdoClass);
- public Iterator<CDOID> readObjectIDs(IDBStoreAccessor storeAccessor, boolean withTypes);
+ public CloseableIterator<CDOID> readObjectIDs(IDBStoreAccessor storeAccessor, boolean withTypes);
public CDOClassRef readObjectType(IDBStoreAccessor storeAccessor, CDOID id);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index 211302d..1ab1237 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -38,6 +38,7 @@ import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBRowHandler;
import org.eclipse.net4j.db.IDBTable;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.io.CloseableIterator;
import java.sql.Connection;
import java.sql.SQLException;
@@ -45,7 +46,6 @@ import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
/**
@@ -390,7 +390,7 @@ public class DBStoreAccessor implements IDBStoreAccessor
mapping.writeRevision(this, revision);
}
- public Iterator<CDOID> readObjectIDs(boolean withTypes)
+ public CloseableIterator<CDOID> readObjectIDs(boolean withTypes)
{
if (TRACER.isEnabled())
{
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
index ae35fb1..18c3999 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
@@ -16,8 +16,9 @@ import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IMapping;
+import org.eclipse.net4j.util.io.CloseableIterator;
+
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
/**
@@ -43,7 +44,7 @@ public class VerticalMappingStrategy extends MappingStrategy
}
@Override
- public Iterator<CDOID> readObjectIDs(IDBStoreAccessor storeAccessor, boolean withTypes)
+ public CloseableIterator<CDOID> readObjectIDs(IDBStoreAccessor storeAccessor, boolean withTypes)
{
return null;
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/CloseableIterator.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/CloseableIterator.java
new file mode 100644
index 0000000..e576918
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/CloseableIterator.java
@@ -0,0 +1,21 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.util.io;
+
+import java.io.Closeable;
+import java.util.Iterator;
+
+/**
+ * @author Eike Stepper
+ */
+public interface CloseableIterator<E> extends Iterator<E>, Closeable
+{
+}