diff options
Diffstat (limited to 'java/common/src')
11 files changed, 22 insertions, 24 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java b/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java index 7d8a5b7b36..00ad5cf08a 100644 --- a/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java +++ b/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java @@ -51,7 +51,7 @@ public class ConsoleOutput implements Sender<ByteBuffer> System.out.println("CLOSED"); } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { // TODO Auto-generated method stub diff --git a/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java b/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java index 5e67b822db..4200a8352c 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java +++ b/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java @@ -200,20 +200,20 @@ public class ClientDelegate extends ConnectionDelegate */ private int calculateHeartbeatInterval(Connection conn,int min, int max) { - long l = conn.getIdleTimeout()/1000; - if (l == 0) + int i = conn.getIdleTimeout()/1000; + if (i == 0) { log.warn("Idle timeout is zero. Heartbeats are disabled"); return 0; // heartbeats are disabled. } - else if (l >= min && l <= max) + else if (i >= min && i <= max) { - return (int)l; + return i; } else { log.warn("Ignoring the idle timeout %s set by the connection," + - " using the brokers max value %s", l,max); + " using the brokers max value %s", i,max); return max; } } diff --git a/java/common/src/main/java/org/apache/qpid/transport/Connection.java b/java/common/src/main/java/org/apache/qpid/transport/Connection.java index 7d0010f34d..9f1916e1d1 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/Connection.java +++ b/java/common/src/main/java/org/apache/qpid/transport/Connection.java @@ -83,7 +83,7 @@ public class Connection extends ConnectionInvoker private String locale; private SaslServer saslServer; private SaslClient saslClient; - private long idleTimeout = 0; + private int idleTimeout = 0; private String _authorizationID; private String userID; @@ -522,16 +522,16 @@ public class Connection extends ConnectionInvoker } } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { - idleTimeout = l; + idleTimeout = i; if (sender != null) { - sender.setIdleTimeout(l); + sender.setIdleTimeout(i); } } - public long getIdleTimeout() + public int getIdleTimeout() { return idleTimeout; } diff --git a/java/common/src/main/java/org/apache/qpid/transport/Sender.java b/java/common/src/main/java/org/apache/qpid/transport/Sender.java index 475289c83f..6519702c76 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/Sender.java +++ b/java/common/src/main/java/org/apache/qpid/transport/Sender.java @@ -28,7 +28,7 @@ package org.apache.qpid.transport; public interface Sender<T> { - void setIdleTimeout(long l); + void setIdleTimeout(int i); void send(T msg); diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java b/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java index d99ee72d14..3759fa238a 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java +++ b/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java @@ -238,8 +238,8 @@ public final class Disassembler implements Sender<ProtocolEvent>, throw new IllegalArgumentException("" + error); } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { - sender.setIdleTimeout(l); + sender.setIdleTimeout(i); } } diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java b/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java index 00652e2927..30d7e52d33 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java +++ b/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java @@ -56,7 +56,6 @@ public final class IoSender implements Runnable, Sender<ByteBuffer> private final Object notEmpty = new Object(); private final AtomicBoolean closed = new AtomicBoolean(false); private final Thread senderThread; - private long idleTimeout; private volatile Throwable exception = null; @@ -294,12 +293,11 @@ public final class IoSender implements Runnable, Sender<ByteBuffer> } } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { try { - socket.setSoTimeout((int)l*2); - idleTimeout = l; + socket.setSoTimeout(i*2); } catch (Exception e) { diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java b/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java index 3838bf76be..b324cdd5a9 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java +++ b/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java @@ -285,7 +285,7 @@ public class MINANetworkDriver extends IoHandlerAdapter implements NetworkDriver _lastWriteFuture = _ioSession.write(minaBuf); } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { // MINA doesn't support setting SO_TIMEOUT } diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaSender.java b/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaSender.java index fbedf14312..22b9c5e784 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaSender.java +++ b/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaSender.java @@ -77,7 +77,7 @@ public class MinaSender implements Sender<java.nio.ByteBuffer> closed.join(); } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { //noop } diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioSender.java b/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioSender.java index 5196505c2d..2fa875f279 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioSender.java +++ b/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioSender.java @@ -119,7 +119,7 @@ public class NioSender implements Sender<java.nio.ByteBuffer> } } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { //noop } diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java b/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java index 0e785bb2ee..bd5662a5fb 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java +++ b/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java @@ -248,8 +248,8 @@ public class SSLSender implements Sender<ByteBuffer> return engineState; } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { - delegate.setIdleTimeout(l); + delegate.setIdleTimeout(i); } } diff --git a/java/common/src/test/java/org/apache/qpid/transport/TestNetworkDriver.java b/java/common/src/test/java/org/apache/qpid/transport/TestNetworkDriver.java index a4c4b59cdd..ffe6c63d96 100644 --- a/java/common/src/test/java/org/apache/qpid/transport/TestNetworkDriver.java +++ b/java/common/src/test/java/org/apache/qpid/transport/TestNetworkDriver.java @@ -109,7 +109,7 @@ public class TestNetworkDriver implements NetworkDriver } - public void setIdleTimeout(long l) + public void setIdleTimeout(int i) { } |