Skip to content

Commit

Permalink
Order setter for DefaultSimpUserRegistry
Browse files Browse the repository at this point in the history
Issue: SPR-17023
  • Loading branch information
jhoeller committed Jul 24, 2018
1 parent 9b3d80c commit 4f9a18f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void setViewResolvers(List<ViewResolver> viewResolvers) {
* Set the order for this result handler relative to others.
* <p>By default set to 0. It is generally safe to place it early in the
* order as it looks for a concrete return type.
* @param order the order
*/
public void setOrder(int order) {
this.order = order;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
Expand Down Expand Up @@ -39,14 +39,16 @@

/**
* A default implementation of {@link SimpUserRegistry} that relies on
* {@link AbstractSubProtocolEvent} application context events to keep track of
* connected users and their subscriptions.
* {@link AbstractSubProtocolEvent} application context events to keep
* track of connected users and their subscriptions.
*
* @author Rossen Stoyanchev
* @since 4.2
*/
public class DefaultSimpUserRegistry implements SimpUserRegistry, SmartApplicationListener {

private int order = Ordered.LOWEST_PRECEDENCE;

/* Primary lookup that holds all users and their sessions */
private final Map<String, LocalSimpUser> users = new ConcurrentHashMap<>();

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


/**
* Specify the order value for this registry.
* <p>Default is {@link Ordered#LOWEST_PRECEDENCE}.
* @since 5.0.8
*/
public void setOrder(int order) {
this.order = order;
}

@Override
public int getOrder() {
return Ordered.LOWEST_PRECEDENCE;
return this.order;
}


Expand Down

0 comments on commit 4f9a18f

Please sign in to comment.