import java.io.*;
import java.util.*;
import Server.*;
import Server.ProcessHitsCollectionPackage.*;

class ConsumerApp {

    public static void main(String args[]) throws Exception{

        ProcessHitsCollection s = null;
        Properties props = System.getProperties();
        props.put("org.omg.CORBA.ORBClass", "com.ooc.CORBA.ORB");
        props.put("org.omg.CORBA.ORBSingletonClass", "com.ooc.CORBA.ORBSingleton
");
        org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, props );
        System.out.println("[client] orb.inirialized");
        BufferedReader input = new BufferedReader( new FileReader(args[0]));
        String obj_ref = input.readLine();
        System.out.println( "[client] got a stringified object reference :");
        System.out.println( obj_ref );
        org.omg.CORBA.Object object = orb.string_to_object(obj_ref);

        s = ProcessHitsCollectionHelper.narrow( object );
        Hit[] aHitsCol;
        int key;
        key = (args.length>=2)? Integer.parseInt(args[1]):0;
        aHitsCol = s.postProcess(key);
        int sLength = aHitsCol.length;
        System.out.println("# Lenght of received sequence = "+sLength);
        for (int i=0; i