ClassResourceInfo cri = new ClassResourceInfo(Customer.class);
OperationResourceInfo ori1 = new OperationResourceInfo(
Customer.class.getMethod("getItAsXML", new Class[]{}),
cri);
ori1.setHttpMethod("GET");
ori1.setURITemplate(new URITemplate("/"));
OperationResourceInfo ori2 = new OperationResourceInfo(
Customer.class.getMethod("getItPlain", new Class[]{}),
cri);
ori2.setHttpMethod("GET");
ori2.setURITemplate(new URITemplate("/"));
MethodDispatcher md = new MethodDispatcher();
md.bind(ori1, Customer.class.getMethod("getItAsXML", new Class[]{}));
md.bind(ori2, Customer.class.getMethod("getItPlain", new Class[]{}));
cri.setMethodDispatcher(md);