to get rid of "magic" time constants
This commit is contained in:
committed by
Juergen Hoeller
parent
ed7684d2b2
commit
407ecf7334
@@ -25,6 +25,7 @@ import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -87,7 +88,7 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
|
||||
@Nullable
|
||||
private TaskScheduler taskScheduler;
|
||||
|
||||
private long receiptTimeLimit = 15 * 1000;
|
||||
private long receiptTimeLimit = TimeUnit.SECONDS.toMillis(15);
|
||||
|
||||
private volatile boolean autoReceiptEnabled;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.messaging.simp.stomp;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.converter.MessageConverter;
|
||||
@@ -48,7 +49,7 @@ public abstract class StompClientSupport {
|
||||
|
||||
private long[] defaultHeartbeat = new long[] {10000, 10000};
|
||||
|
||||
private long receiptTimeLimit = 15 * 1000;
|
||||
private long receiptTimeLimit = TimeUnit.SECONDS.toMillis(15);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.messaging.simp.user;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -56,7 +57,7 @@ public class UserRegistryMessageHandler implements MessageHandler, ApplicationLi
|
||||
@Nullable
|
||||
private volatile ScheduledFuture<?> scheduledFuture;
|
||||
|
||||
private long registryExpirationPeriod = 20 * 1000;
|
||||
private long registryExpirationPeriod = TimeUnit.SECONDS.toMillis(20);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user