/** * Register a single provider. This could be a Resource Provider or a "plain" provider not associated with any * resource. */ public void registerProvider(Object provider) { if (provider != null) { Collection<Object> providerList = new ArrayList<>(1); providerList.add(provider); registerProviders(providerList); } }
/** * Register a group of providers. These could be Resource Providers (classes implementing {@link IResourceProvider}) or "plain" providers, or a mixture of the two. * * @param theProviders a {@code Collection} of theProviders. The parameter could be null or an empty {@code Collection} */ public void registerProviders(Object... theProviders) { Validate.noNullElements(theProviders); registerProviders(Arrays.asList(theProviders)); }
/** * Register a group of theProviders. These could be Resource Providers, "plain" theProviders or a mixture of the two. * * @param theProviders a {@code Collection} of theProviders. The parameter could be null or an empty {@code Collection} */ public void registerProviders(Collection<?> theProviders) { Validate.noNullElements(theProviders, "theProviders must not contain any null elements"); myProviderRegistrationMutex.lock(); try { if (!myStarted) { for (Object provider : theProviders) { ourLog.info("Registration of provider [" + provider.getClass().getName() + "] will be delayed until FHIR server startup"); if (provider instanceof IResourceProvider) { myResourceProviders.add((IResourceProvider) provider); } else { myPlainProviders.add(provider); } } return; } } finally { myProviderRegistrationMutex.unlock(); } registerProviders(theProviders, false); }
registerProviders(resourceProvider, true); registerProviders(providers, true);
/** * Register a single provider. This could be a Resource Provider or a "plain" provider not associated with any * resource. */ public void registerProvider(Object provider) { if (provider != null) { Collection<Object> providerList = new ArrayList<>(1); providerList.add(provider); registerProviders(providerList); } }
/** * Register a group of providers. These could be Resource Providers (classes implementing {@link IResourceProvider}) or "plain" providers, or a mixture of the two. * * @param theProviders a {@code Collection} of theProviders. The parameter could be null or an empty {@code Collection} */ public void registerProviders(Object... theProviders) { Validate.noNullElements(theProviders); registerProviders(Arrays.asList(theProviders)); }
/** * Register a group of theProviders. These could be Resource Providers, "plain" theProviders or a mixture of the two. * * @param theProviders a {@code Collection} of theProviders. The parameter could be null or an empty {@code Collection} */ public void registerProviders(Collection<?> theProviders) { Validate.noNullElements(theProviders, "theProviders must not contain any null elements"); myProviderRegistrationMutex.lock(); try { if (!myStarted) { for (Object provider : theProviders) { ourLog.info("Registration of provider [" + provider.getClass().getName() + "] will be delayed until FHIR server startup"); if (provider instanceof IResourceProvider) { myResourceProviders.add((IResourceProvider) provider); } else { myPlainProviders.add(provider); } } return; } } finally { myProviderRegistrationMutex.unlock(); } registerProviders(theProviders, false); }
registerProviders(resourceProvider, true); registerProviders(providers, true);