BATCH-2567: Allow to access MongoItemWriter.template from a subclass

JIRA: https://jira.spring.io/browse/BATCH-2567
This commit is contained in:
Takaaki Iida
2017-01-09 21:28:14 +09:00
committed by Michael Minella
parent b2f91ae395
commit cae2cabdce

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -76,6 +76,16 @@ public class MongoItemWriter<T> implements ItemWriter<T>, InitializingBean {
this.template = template;
}
/**
* Get the {@link MongoOperations} to be used to save items to be written.
* This can be called by a subclass if necessary.
*
* @return template the template implementation to be used.
*/
protected MongoOperations getTemplate() {
return template;
}
/**
* Set the name of the Mongo collection to be written to.
*