use of org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate in project jnosql-diana by eclipse.
the class ReactiveRepositoryKeyValueBean method create.
@Override
public ReactiveRepository<?, ?> create(CreationalContext<ReactiveRepository<?, ?>> creationalContext) {
KeyValueTemplate template = provider.isEmpty() ? getInstance(KeyValueTemplate.class) : getInstance(KeyValueTemplate.class, DatabaseQualifier.ofKeyValue(provider));
ReactiveKeyValueTemplate reactiveTemplate = provider.isEmpty() ? getInstance(ReactiveKeyValueTemplate.class) : getInstance(ReactiveKeyValueTemplate.class, DatabaseQualifier.ofKeyValue(provider));
ReactiveKeyValueRepositoryProxy<?> handler = new ReactiveKeyValueRepositoryProxy<>(template, reactiveTemplate, type);
return (ReactiveRepository<?, ?>) Proxy.newProxyInstance(type.getClassLoader(), new Class[] { type }, handler);
}
use of org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate in project jnosql-diana by eclipse.
the class ReactiveKeyValueTemplateConverterTest method shouldReturnTemplate.
@Test
public void shouldReturnTemplate() {
final String prefix = UUID.randomUUID().toString();
System.setProperty(prefix, prefix);
System.setProperty(prefix + ".settings.key", "value");
System.setProperty(prefix + ".settings.key2", "value2");
System.setProperty(prefix + ".provider", KeyValueConfigurationMock.class.getName());
System.setProperty(prefix + ".database", "bucket");
final ReactiveKeyValueTemplate template = config.getValue(prefix, ReactiveKeyValueTemplate.class);
Assertions.assertNotNull(template);
System.clearProperty(prefix);
System.clearProperty(prefix + ".settings.key");
System.clearProperty(prefix + ".settings.key2");
System.clearProperty(prefix + ".provider");
System.clearProperty(prefix + ".database");
}
use of org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate in project jnosql-diana by eclipse.
the class ReactiveKeyValueManagerConverter method success.
@Override
protected ReactiveKeyValueTemplate success(String value) {
Config config = BeanManagers.getInstance(Config.class);
final KeyValueTemplate template = config.getValue(value, KeyValueTemplate.class);
ReactiveKeyValueTemplateProducer producer = BeanManagers.getInstance(ReactiveKeyValueTemplateProducer.class);
return producer.get(template);
}
use of org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate in project jnosql-diana by eclipse.
the class ReactiveTemplateBean method create.
@Override
public ReactiveKeyValueTemplate create(CreationalContext<ReactiveKeyValueTemplate> creationalContext) {
ReactiveKeyValueTemplateProducer producer = getInstance(ReactiveKeyValueTemplateProducer.class);
KeyValueTemplate template = getManager();
return producer.get(template);
}
Aggregations