ResourceMethodDispatcherFactory implements ResourceMethodDispatcher.Provider { @Override public ResourceMethodDispatcher create(Invocable resourceMethod, InvocationHandler handler, ConfiguredValidator validator) { for (ResourceMethodDispatcher.Provider provider : providers) { try { ResourceMethodDispatcher dispatcher = provider.create(resourceMethod, handler, validator); if (dispatcher != null) { return dispatcher; } } catch (Exception e) { LOGGER.log(Level.SEVERE, LocalizationMessages.ERROR_PROCESSING_METHOD(resourceMethod, provider.getClass().getName()), e); } } return null; } ResourceMethodDispatcherFactory(Collection<ResourceMethodDispatcher.Provider> providers); @Override ResourceMethodDispatcher create(Invocable resourceMethod, InvocationHandler handler, ConfiguredValidator validator);  }
@Test public void testBasicDispatchers() throws InterruptedException, ExecutionException { final Resource.Builder rb = Resource.builder(); final Method[] methods = this.getClass().getDeclaredMethods(); for (Method method : methods) { if (Modifier.isPrivate(method.getModifiers())) { rb.addMethod("GET").handledBy(this.getClass(), method); rb.addMethod("GET").handledBy(this, method); } } for (ResourceModelComponent component : rb.build().getComponents()) { if (component instanceof ResourceMethod) { Invocable invocable = ((ResourceMethod) component).getInvocable(); assertNotNull("No dispatcher found for invocable " + invocable.toString(), rmdf.create(invocable, rmihf.create(invocable), null)); } } }