public static void main(String[] args){
        try{
            //check the arguments
            if(args.length != 5)
                throw new IllegalArgumentException("Illegal argument count");
            int rCount= Integer.parseInt(args[0]);
            int wCount= Integer.parseInt(args[1]);
            Integer idListStart= Integer.parseInt(args[2]);
            Integer idListEnd= Integer.parseInt(args[3]);
            int activity= Integer.parseInt(args[4]);
            if(rCount < 0 || wCount < 0 || idListStart < 0 || idListEnd < idListStart || activity < 0)
                throw new IllegalArgumentException("Illegal argument value");

            Registry registry= LocateRegistry.getRegistry("localhost", 1099);
            AccountService accountService= (AccountService)registry.lookup("myAccountServiceObject");

            //run threads
            //run writers
            int clientId= 0;
            for(int i=0; i< wCount; ++i, ++clientId)
                new Thread(new Client(accountService, ClientType.WRITER, idListStart, idListEnd, activity, clientId)).start();
            //run readers
            for(int i=0; i< rCount; ++i, ++clientId)
                new Thread(new Client(accountService, ClientType.READER, idListStart, idListEnd, activity, clientId)).start();

            System.out.println("ClientManager: all clients have been started");
        }
        catch (Exception e){
            e.printStackTrace();
            System.out.println("Client stopped because of an exception");
            System.exit(1);
        }
    }