use of org.jnosql.diana.api.document.DocumentConfigurationAsync in project jnosql-artemis by eclipse.
the class DocumentCollectionFactoryProducer method getDocumentCollectionAsync.
private <T extends DocumentCollectionManagerAsync> DocumentCollectionManagerAsyncFactory<T> getDocumentCollectionAsync(InjectionPoint injectionPoint) {
Annotated annotated = injectionPoint.getAnnotated();
ConfigurationUnit annotation = getConfigurationUnit(injectionPoint, annotated).orElseThrow(() -> new IllegalStateException("The @ConfigurationUnit does not found"));
ConfigurationSettingsUnit unit = configurationReader.get().read(annotation, DocumentConfigurationAsync.class);
Class<DocumentConfigurationAsync> configurationClass = unit.<DocumentConfigurationAsync>getProvider().orElseThrow(() -> new IllegalStateException("The DocumentConfiguration provider is required in the configuration"));
DocumentConfigurationAsync documentConfiguration = reflections.newInstance(configurationClass);
return documentConfiguration.getAsync(unit.getSettings());
}
Aggregations