INT-3628: Use SchedulingAwareRunner for Long Tasks
JIRA: https://jira.spring.io/browse/INT-3628 Certain tasks in Spring Integration are long running. Indicate so for the benefit of platforms such as WebLogic that can log warnings for long running tasks otherwise. Also fix conflicting versions of commons-io.
This commit is contained in:
committed by
Artem Bilan
parent
beeb49d55b
commit
80a45715ac
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -22,6 +22,7 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
import org.springframework.scheduling.SchedulingAwareRunnable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -32,7 +33,7 @@ import org.springframework.util.Assert;
|
||||
* @since 2.0
|
||||
*/
|
||||
public abstract class AbstractInternetProtocolReceivingChannelAdapter
|
||||
extends MessageProducerSupport implements Runnable, CommonSocketOptions {
|
||||
extends MessageProducerSupport implements SchedulingAwareRunnable, CommonSocketOptions {
|
||||
|
||||
private final int port;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
|
||||
import org.springframework.integration.context.OrderlyShutdownCapable;
|
||||
import org.springframework.scheduling.SchedulingAwareRunnable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -32,7 +33,7 @@ import org.springframework.util.Assert;
|
||||
* @since 2.0
|
||||
*/
|
||||
public abstract class AbstractServerConnectionFactory
|
||||
extends AbstractConnectionFactory implements Runnable, OrderlyShutdownCapable {
|
||||
extends AbstractConnectionFactory implements SchedulingAwareRunnable, OrderlyShutdownCapable {
|
||||
|
||||
private static final int DEFAULT_BACKLOG = 5;
|
||||
|
||||
@@ -54,6 +55,11 @@ public abstract class AbstractServerConnectionFactory
|
||||
super(port);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLongLived() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
synchronized (this.lifecycleMonitor) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2014 the original author or authors.
|
||||
* Copyright 2001-2015 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.
|
||||
@@ -27,6 +27,7 @@ import org.springframework.core.serializer.Deserializer;
|
||||
import org.springframework.core.serializer.Serializer;
|
||||
import org.springframework.integration.ip.tcp.serializer.SoftEndOfStreamException;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.scheduling.SchedulingAwareRunnable;
|
||||
|
||||
/**
|
||||
* A TcpConnection that uses and underlying {@link Socket}.
|
||||
@@ -35,7 +36,7 @@ import org.springframework.messaging.Message;
|
||||
* @since 2.0
|
||||
*
|
||||
*/
|
||||
public class TcpNetConnection extends TcpConnectionSupport {
|
||||
public class TcpNetConnection extends TcpConnectionSupport implements SchedulingAwareRunnable {
|
||||
|
||||
private final Socket socket;
|
||||
|
||||
@@ -63,6 +64,11 @@ public class TcpNetConnection extends TcpConnectionSupport {
|
||||
this.socket = socket;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLongLived() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes this connection.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -30,6 +30,7 @@ import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import org.springframework.scheduling.SchedulingAwareRunnable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -41,7 +42,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
*/
|
||||
public class TcpNioClientConnectionFactory extends
|
||||
AbstractClientConnectionFactory implements Runnable {
|
||||
AbstractClientConnectionFactory implements SchedulingAwareRunnable {
|
||||
|
||||
private volatile boolean usingDirectBuffers;
|
||||
|
||||
@@ -113,6 +114,11 @@ public class TcpNioClientConnectionFactory extends
|
||||
this.tcpNioConnectionSupport = tcpNioSupport;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLongLived() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (this.selector != null) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -72,6 +72,11 @@ public class UnicastReceivingChannelAdapter extends AbstractInternetProtocolRece
|
||||
this.mapper.setLengthCheck(lengthCheck);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLongLived() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInit() {
|
||||
super.onInit();
|
||||
|
||||
Reference in New Issue
Block a user