コード例 #1
0
  private void testDrive() {
    PersonBean person1 = getPerson("Kamal Kaur");
    PersonBean ownerProxy = getOwnerProxy(person1);
    System.out.println("Name is " + ownerProxy.getName());
    changePersonBean(ownerProxy, "Lotus", 8, "Singing");

    System.out.println("Gender ----" + ownerProxy.getGender());
    System.out.println("Name set from owner proxy");
    System.out.println("Name ----" + ownerProxy.getName());
    System.out.println("Interests set from owner proxy");
    System.out.println("Interests ----" + ownerProxy.getInterests());
    System.out.println("Ratings set from owner proxy");
    System.out.println("Ratings------" + ownerProxy.getHotOrNotRating());

    PersonBean person2 = getPerson("Arvind Gupta");
    PersonBean nonOwnerProxy = getNonOwnerProxy(person2);
    changePersonBean(nonOwnerProxy, "Arv Gupta", 10, "Reading");

    System.out.println("Gender ----" + nonOwnerProxy.getGender());
    System.out.println("Name set from non owner proxy");
    System.out.println("Name ----" + nonOwnerProxy.getName());
    System.out.println("Interests set from non owner proxy");
    System.out.println("Interests ----" + nonOwnerProxy.getInterests());
    System.out.println("Ratings set from non owner proxy");
    System.out.println("Ratings------" + nonOwnerProxy.getHotOrNotRating());
  }