public static List<UserResource> getUserResources(String loc, Bus bus) { try (InputStream is = ResourceUtils.getResourceStream(loc, bus)) { if (is == null) { return null; } return getUserResources(is); } catch (Exception ex) { LOG.warning("Problem with processing a user model at " + loc); } return null; }
public static List<UserResource> getUserResources(String loc, Bus bus) { try { InputStream is = ResourceUtils.getResourceStream(loc, bus); if (is == null) { return null; } return getUserResources(is); } catch (Exception ex) { LOG.warning("Problem with processing a user model at " + loc); } return null; }
public static List<UserResource> getUserResources(String loc) { return getUserResources(loc, BusFactory.getThreadDefaultBus()); }
public static List<UserResource> getUserResources(String loc) { return getUserResources(loc, BusFactory.getThreadDefaultBus()); }
/** * Sets a reference to the external user model, * Example: "classpath:/model/resources.xml" * * @param modelRef the reference to the external model resource. */ public void setModelRef(String modelRef) { List<UserResource> resources = ResourceUtils.getUserResources(modelRef, getBus()); if (resources != null) { serviceFactory.setUserResources(resources); } }
private void processResourceModel(JAXRSServerFactoryBean sfb) { // Currently a CXF model document is the only possible source // of the model. Other sources will be supported going forward if (modelRef != null) { List<UserResource> resources = ResourceUtils.getUserResources(modelRef, sfb.getBus()); processUserResources(sfb, resources); } }
/** * Sets a reference to the external user model, * Example: "classpath:/model/resources.xml" * * @param modelRef the reference to the external model resource. */ public void setModelRef(String modelRef) { List<UserResource> resources = ResourceUtils.getUserResources(modelRef, getBus()); if (resources != null) { serviceFactory.setUserResources(resources); } }
/** * Sets a reference to the external user model, * Example: "classpath:/model/resources.xml". * Some models may only reference interfaces, thus providing a list of * concrete classes that will be instantiated is required in such cases. * * @param modelRef the reference to the external model resource. * @param sClasses concrete root resource classes */ public void setModelRefWithServiceClass(String modelRef, Class<?>... sClasses) { List<UserResource> resources = ResourceUtils.getUserResources(modelRef, getBus()); if (resources != null) { serviceFactory.setUserResourcesWithServiceClass(resources, sClasses); } } public void setProviderComparator(Comparator<?> providerComparator) {
/** * Sets a reference to the external user model, * Example: "classpath:/model/resources.xml". * Some models may only reference interfaces, thus providing a list of * concrete classes that will be instantiated is required in such cases. * * @param modelRef the reference to the external model resource. * @param sClasses concrete root resource classes */ public void setModelRefWithServiceClass(String modelRef, Class<?>... sClasses) { List<UserResource> resources = ResourceUtils.getUserResources(modelRef, getBus()); if (resources != null) { serviceFactory.setUserResourcesWithServiceClass(resources, sClasses); } }