sf.setResourceClasses(BookStore.class, SimpleBookStore.class, BookStorePerRequest.class);
List<Object> providers = new ArrayList<Object>();
//default lifecycle is per-request, change it to singleton
BinaryDataProvider p = new BinaryDataProvider();
p.setProduceMediaTypes(Collections.singletonList("application/bar"));
p.setEnableBuffering(true);
providers.add(p);
JAXBElementProvider jaxbProvider = new JAXBElementProvider();
Map<String, String> jaxbElementClassMap = new HashMap<String, String>();
jaxbElementClassMap.put(BookNoXmlRootElement.class.getName(), "BookNoXmlRootElement");
jaxbProvider.setJaxbElementClassMap(jaxbElementClassMap);