private void processUserResources(JAXRSServerFactoryBean sfb, List<UserResource> resources) { for (UserResource resource : resources) { if (StringUtils.isEmpty(resource.getName())) { resource.setName(DefaultModelResource.class.getName()); } } // The CXF to Camel exchange binding may need to be customized // for the operation name, request, response types be derived from // the model info (when a given model does provide this info) as opposed // to a matched method which is of no real use with a default handler. sfb.setModelBeans(resources); }
private static UserResource getResourceFromElement(Element e) { UserResource resource = new UserResource(); resource.setName(e.getAttribute("name")); resource.setPath(e.getAttribute("path")); resource.setConsumes(e.getAttribute("consumes")); resource.setProduces(e.getAttribute("produces")); List<Element> operEls = DOMUtils.findAllElementsByTagNameNS(e, "http://cxf.apache.org/jaxrs", "operation"); List<UserOperation> opers = new ArrayList<>(operEls.size()); for (Element operEl : operEls) { opers.add(getOperationFromElement(operEl)); } resource.setOperations(opers); return resource; }
private static UserResource getResourceFromElement(Element e) { UserResource resource = new UserResource(); resource.setName(e.getAttribute("name")); resource.setPath(e.getAttribute("path")); resource.setConsumes(e.getAttribute("consumes")); resource.setProduces(e.getAttribute("produces")); List<Element> operEls = DOMUtils.findAllElementsByTagNameNS(e, "http://cxf.apache.org/jaxrs", "operation"); List<UserOperation> opers = new ArrayList<UserOperation>(operEls.size()); for (Element operEl : operEls) { opers.add(getOperationFromElement(operEl)); } resource.setOperations(opers); return resource; }
ur.setPath("/"); ur.setOperations(entry.getValue()); ur.setName(entry.getKey()); resources.add(ur);
ur.setPath("/"); ur.setOperations(entry.getValue()); ur.setName(entry.getKey()); resources.add(ur);
ur.setPath("/"); ur.setOperations(entry.getValue()); ur.setName(entry.getKey()); resources.add(ur);