// Path: src/main/java/com/healthmarketscience/rmiio/RemoteIterator.java
// public interface RemoteIterator<DataType>
//   extends CloseableIOIterator<DataType>, Serializable, RemoteClient
// {
// 
//   /**
//    * Closes the iterator and releases the resources for the server
//    * object.  Note that the remote object <i>may no longer be accessible</i>
//    * after this call (depending on the implementation), so clients should not
//    * attempt to use this iterator after making this call.
//    */
//   @Override
//   public void close() throws IOException;
// 
// }


import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import com.healthmarketscience.rmiio.RemoteIterator;
/*
Copyright (c) 2007 Health Market Science, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package examples.iterator;



/**
 * Example server which consumes a bunch of strings using a RemoteIterator
 * (and sticks them in a local temp file).
 *
 * @author James Ahlborn
 */
public class TestServer {

  public static final int REGISTRY_PORT = Registry.REGISTRY_PORT;

  public static class StringServer
    implements RemoteStringServer
  {
// Path: src/main/java/com/healthmarketscience/rmiio/RemoteIterator.java
// public interface RemoteIterator<DataType>
//   extends CloseableIOIterator<DataType>, Serializable, RemoteClient
// {
// 
//   /**
//    * Closes the iterator and releases the resources for the server
//    * object.  Note that the remote object <i>may no longer be accessible</i>
//    * after this call (depending on the implementation), so clients should not
//    * attempt to use this iterator after making this call.
//    */
//   @Override
//   public void close() throws IOException;
// 
// }


// Path: src/test/java/examples/iterator/TestServer.java
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import com.healthmarketscience.rmiio.RemoteIterator;

/*
Copyright (c) 2007 Health Market Science, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package examples.iterator;



/**
 * Example server which consumes a bunch of strings using a RemoteIterator
 * (and sticks them in a local temp file).
 *
 * @author James Ahlborn
 */
public class TestServer {

  public static final int REGISTRY_PORT = Registry.REGISTRY_PORT;

  public static class StringServer
    implements RemoteStringServer
  {
    public void sendStrings(RemoteIterator<String> iter) throws IOException {