public static void main(String args[]) throws RemoteException,
            NotBoundException,
            MalformedURLException
    {
        String myId = args[0];
        MyClient me = new MyClient(myId);

        ServerInterface server =
                (ServerInterface) Naming.lookup("rmi://localhost/chat");
        server.registerClient(me);
        server.broadcastMsg(me.getID() + " : Hi guys, I am new ....");

        List<ClientInterface> clients = server.getClients();
        if (!clients.isEmpty())
        {
            System.out.println("\nRegistered Clients ***********");
            for (ClientInterface client : clients)
            {
                System.out.println(client.getID());
            }
            System.out.println("******************************\n");
        }

        for (int i = 0; i < 1000; i++)
        {
            server.broadcastMsg(me.getID() + " : [" + i + "]");
            try
            {
                Thread.sleep(1000);
            } catch (InterruptedException ie)
            {
                ie.printStackTrace();
            }
        }

        server.broadcastMsg("good bye ...");
        server.unregisterClient(me);
    }