private void findResourceMethods(Object theProvider) { ourLog.info("Scanning type for RESTful methods: {}", theProvider.getClass()); int count = 0; Class<?> clazz = theProvider.getClass(); Class<?> supertype = clazz.getSuperclass(); while (!Object.class.equals(supertype)) { count += findResourceMethods(theProvider, supertype); supertype = supertype.getSuperclass(); } try { count += findResourceMethods(theProvider, clazz); } catch (ConfigurationException e) { throw new ConfigurationException("Failure scanning class " + clazz.getSimpleName() + ": " + e.getMessage(), e); } if (count == 0) { throw new ConfigurationException("Did not find any annotated RESTful methods on provider class " + theProvider.getClass().getCanonicalName()); } }
ourLog.info("Added {} resource provider(s). Total {}", newResourceProviders.size(), myResourceProviders.size()); for (IResourceProvider provider : newResourceProviders) { findResourceMethods(provider); ourLog.info("Added {} plain provider(s). Total {}", newPlainProviders.size(), myPlainProviders.size()); for (Object provider : newPlainProviders) { findResourceMethods(provider);
findResourceMethods(getServerProfilesProvider()); findResourceMethods(confProvider); findResourceMethods(new PageProvider());
private void findResourceMethods(Object theProvider) { ourLog.info("Scanning type for RESTful methods: {}", theProvider.getClass()); int count = 0; Class<?> clazz = theProvider.getClass(); Class<?> supertype = clazz.getSuperclass(); while (!Object.class.equals(supertype)) { count += findResourceMethods(theProvider, supertype); supertype = supertype.getSuperclass(); } try { count += findResourceMethods(theProvider, clazz); } catch (ConfigurationException e) { throw new ConfigurationException("Failure scanning class " + clazz.getSimpleName() + ": " + e.getMessage(), e); } if (count == 0) { throw new ConfigurationException("Did not find any annotated RESTful methods on provider class " + theProvider.getClass().getCanonicalName()); } }
ourLog.info("Added {} resource provider(s). Total {}", newResourceProviders.size(), myResourceProviders.size()); for (IResourceProvider provider : newResourceProviders) { findResourceMethods(provider); ourLog.info("Added {} plain provider(s). Total {}", newPlainProviders.size(), myPlainProviders.size()); for (Object provider : newPlainProviders) { findResourceMethods(provider);
findResourceMethods(getServerProfilesProvider()); findResourceMethods(confProvider); findResourceMethods(new PageProvider());