public < T extends RESTDataProvider > void registerProvider ( Class < T > providerClass , Class < ? > providerInterface ) { try { final Constructor < T > constructor = providerClass . getConstructor ( RESTProviderFactory . class ) ; final T instance = constructor . newInstance ( this ) ; providerMap . put ( providerClass , instance ) ; if ( providerInterface != null ) { providerMap . put ( providerInterface , instance ) ; } } catch ( NoSuchMethodException e ) { throw new RuntimeException ( e ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e ) ; } catch ( InstantiationException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } }
Register an external provider with the provider factory .