// Output
printStatus("Initial state for Mary", mary_);
printStatus("Initial state for Joe", joe_);
// Retrieve the pojos from the Server #2
Student mary2 = (Student) cache2_.getObject("/students/54321");
Student joe2 = (Student) cache2_.getObject("/students/65432");
Course foo2 = (Course) cache2_.getObject("/courses/101");
System.out.println("---------------------------------------------");
System.out.println("Modified on Server #1");
// Change state in one of the items. This will be fine-grained replicated
foo_.setRoom("101 Alvarez"); // Modified state on cache #2
printStatus("Course Update: id: 401 room: null->101 Alvarez (retrieved from cache #2)"
, foo2);
System.out.println("---------------------------------------------");
System.out.println("Modified on Server #2");
// Change state in one of the items. This will be fine-grained replicated
joe2.addCourse(bar_); // Modified state on cache #2
printStatus("Student Update: id: 65432 addCourse: Advanced Bar (retrieved from cache #1)"
, joe_);
System.out.println("---------------------------------------------");
System.out.println("Modified on Server #1");