Search in sources :

Example 1 with DocumentConfigurationAsync

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());
}
Also used : Annotated(javax.enterprise.inject.spi.Annotated) DocumentConfigurationAsync(org.jnosql.diana.api.document.DocumentConfigurationAsync) ConfigurationSettingsUnit(org.jnosql.artemis.ConfigurationSettingsUnit) ConfigurationUnit(org.jnosql.artemis.ConfigurationUnit)

Aggregations

Annotated (javax.enterprise.inject.spi.Annotated)1 ConfigurationSettingsUnit (org.jnosql.artemis.ConfigurationSettingsUnit)1 ConfigurationUnit (org.jnosql.artemis.ConfigurationUnit)1 DocumentConfigurationAsync (org.jnosql.diana.api.document.DocumentConfigurationAsync)1