Java Reference
In-Depth Information
The entity, Customer , is a simple POJO with accessors and mutators, and working equals, hashCode ,
toString methods.
// …
import java.util.Date;
import java.util.UUID;
public class Customer implements Serializable {
private String id;
private String firstName, lastName;
private Date birthday;
// …
// accessor/mutators, id, equals, and hashCode.
// …
Note first that nothing we do in that class has any effect on Terracotta. We implement Serializable,
ostensibly, because the class may very well be serialized in, for example, an HTTP session. The
hashCode/equals implementations are just good practice.
The client that will allow us to interact with this service class is as follows:
package com.apress.springenterpriserecipes.distributedspring.terracotta.
import com.apress.springenterpriserecipes.distributedspring.
import com.apress.springenterpriserecipes.distributedspring.
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.SystemUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import javax.swing.*;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
public class CustomerConsole {
private void log(String msg) {
private void list() {
for (Customer customer : customerService.getAllCustomers())
Search WWH ::

Custom Search