INT-3495 Add FileTailInChAFBean#setErrorChannel

JIRA: https://jira.spring.io/browse/INT-3495

**Cherry-pick to 4.0.x & 3.0.x**

Conflicts:
	spring-integration-file/src/main/java/org/springframework/integration/file/config/FileTailInboundChannelAdapterFactoryBean.java

Resolved.
This commit is contained in:
Artem Bilan
2014-08-13 14:55:08 +03:00
committed by Gary Russell
parent 1af13c0293
commit ffa352fbca

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.file.config;
import java.io.File;
@@ -33,6 +34,7 @@ import org.springframework.util.StringUtils;
/**
* @author Gary Russell
* @author Artem Bilan
* @since 3.0
*
*/
@@ -61,6 +63,8 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
private volatile MessageChannel outputChannel;
private volatile MessageChannel errorChannel;
private volatile Boolean autoStartup;
private volatile Integer phase;
@@ -110,6 +114,10 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
this.outputChannel = outputChannel;
}
public void setErrorChannel(MessageChannel errorChannel) {
this.errorChannel = errorChannel;
}
public void setAutoStartup(boolean autoStartup) {
this.autoStartup = autoStartup;
}
@@ -139,10 +147,7 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
@Override
public boolean isRunning() {
if (this.adapter != null) {
return this.adapter.isRunning();
}
return false;
return this.adapter != null && this.adapter.isRunning();
}
@Override
@@ -155,10 +160,7 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
@Override
public boolean isAutoStartup() {
if (this.adapter != null) {
return this.adapter.isAutoStartup();
}
return false;
return this.adapter != null && this.adapter.isAutoStartup();
}
@Override
@@ -206,7 +208,8 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
if (this.fileDelay != null) {
adapter.setTailAttemptsDelay(this.fileDelay);
}
adapter.setOutputChannel(outputChannel);
adapter.setOutputChannel(this.outputChannel);
adapter.setErrorChannel(this.errorChannel);
adapter.setBeanName(this.beanName);
if (this.autoStartup != null) {
adapter.setAutoStartup(this.autoStartup);
@@ -217,6 +220,9 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
if (this.applicationEventPublisher != null) {
adapter.setApplicationEventPublisher(this.applicationEventPublisher);
}
if (getBeanFactory() != null) {
adapter.setBeanFactory(getBeanFactory());
}
adapter.afterPropertiesSet();
this.adapter = adapter;
return adapter;