Skip to content

Commit

Permalink
feat(com.mmnaseri.utils.spring.data.dsl.factory): add .configure()
Browse files Browse the repository at this point in the history
…method to the DSL to expose the configuration created thus far

Closes #97
  • Loading branch information
mmnaseri committed Jun 13, 2016
1 parent fa343cd commit cc28fbb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mmnaseri.utils.spring.data.dsl.mock.KeyGeneration;
import com.mmnaseri.utils.spring.data.proxy.RepositoryFactory;
import com.mmnaseri.utils.spring.data.proxy.RepositoryFactoryConfiguration;

/**
* Finalizes the DSL by providing a way to either choose to {@link #build() build} the factory or to
Expand All @@ -20,4 +21,10 @@ public interface End extends KeyGeneration {
*/
RepositoryFactory build();

/**
* @return the {@link RepositoryFactoryConfiguration repository factory configuration} instance that has
* been created as a result of method calls via this DSL
*/
RepositoryFactoryConfiguration configure();

}
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ public <E> ResultAdaptersAnd and(ResultAdapter<E> adapter) {

@Override
public RepositoryFactory build() {
return new DefaultRepositoryFactory(new ImmutableRepositoryFactoryConfiguration(metadataResolver, queryDescriptionExtractor, functionRegistry, dataStoreRegistry, resultAdapterContext, typeMappingContext, eventListenerContext, operationInvocationHandler));
return new DefaultRepositoryFactory(configure());
}

@Override
public RepositoryFactoryConfiguration configure() {
return new ImmutableRepositoryFactoryConfiguration(metadataResolver, queryDescriptionExtractor, functionRegistry, dataStoreRegistry, resultAdapterContext, typeMappingContext, eventListenerContext, operationInvocationHandler);
}

@Override
Expand Down

0 comments on commit cc28fbb

Please sign in to comment.