Skip to content

Commit 4f9a18f

Browse files
committed
Order setter for DefaultSimpUserRegistry
Issue: SPR-17023
1 parent 9b3d80c commit 4f9a18f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/function/server/support/ServerResponseResultHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public void setViewResolvers(List<ViewResolver> viewResolvers) {
6464
* Set the order for this result handler relative to others.
6565
* <p>By default set to 0. It is generally safe to place it early in the
6666
* order as it looks for a concrete return type.
67-
* @param order the order
6867
*/
6968
public void setOrder(int order) {
7069
this.order = order;

spring-websocket/src/main/java/org/springframework/web/socket/messaging/DefaultSimpUserRegistry.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,14 +39,16 @@
3939

4040
/**
4141
* A default implementation of {@link SimpUserRegistry} that relies on
42-
* {@link AbstractSubProtocolEvent} application context events to keep track of
43-
* connected users and their subscriptions.
42+
* {@link AbstractSubProtocolEvent} application context events to keep
43+
* track of connected users and their subscriptions.
4444
*
4545
* @author Rossen Stoyanchev
4646
* @since 4.2
4747
*/
4848
public class DefaultSimpUserRegistry implements SimpUserRegistry, SmartApplicationListener {
4949

50+
private int order = Ordered.LOWEST_PRECEDENCE;
51+
5052
/* Primary lookup that holds all users and their sessions */
5153
private final Map<String, LocalSimpUser> users = new ConcurrentHashMap<>();
5254

@@ -56,9 +58,18 @@ public class DefaultSimpUserRegistry implements SimpUserRegistry, SmartApplicati
5658
private final Object sessionLock = new Object();
5759

5860

61+
/**
62+
* Specify the order value for this registry.
63+
* <p>Default is {@link Ordered#LOWEST_PRECEDENCE}.
64+
* @since 5.0.8
65+
*/
66+
public void setOrder(int order) {
67+
this.order = order;
68+
}
69+
5970
@Override
6071
public int getOrder() {
61-
return Ordered.LOWEST_PRECEDENCE;
72+
return this.order;
6273
}
6374

6475

0 commit comments

Comments
 (0)