@Override
    public void run() {
        try {
            // new socket at port 9000  
            ServerSocket serverSocket = new ServerSocket(9000);  
            // accept stub's doRequest
            Socket socket = serverSocket.accept();  
            while (socket != null) {  
                System.out.println("建立一个连接");
                // get stub's doRequest
                ObjectInputStream inStream =  
                    new ObjectInputStream(socket.getInputStream());  
                String method = (String)inStream.readObject();  
                // check method name  
                if (method.equals("age")) {  
                    // execute object server's business method  
                    int age = personImpl.getAge();  
                    ObjectOutputStream outStream =  
                        new ObjectOutputStream(socket.getOutputStream());  
                    // return result to stub  
                    outStream.writeInt(age);  
                    outStream.flush();  
                }  
                if(method.equals("name")) {  
                    // execute object server's business method  
                    String name = personImpl.getName();  
                    ObjectOutputStream outStream =  
                        new ObjectOutputStream(socket.getOutputStream());  
                    // return result to stub  
                    outStream.writeObject(name);  
                    outStream.flush();  
                }  
            }  
        } catch(Throwable t) {  
            t.printStackTrace();  
            System.exit(0);  
        }  

    }