@@ -294,7 +294,7 @@ public class Session implements Closeable {
294
294
295
295
/**
296
296
* Requests that state and message data be refreshed from the message store at
297
- * logon, if possible. This supports simple failover behavior for acceptors
297
+ * logon, if possible. This supports simple failover behavior for acceptors.
298
298
*/
299
299
public static final String SETTING_REFRESH_ON_LOGON = "RefreshOnLogon" ;
300
300
@@ -405,7 +405,7 @@ public class Session implements Closeable {
405
405
private final boolean resetOnError ;
406
406
private final boolean disconnectOnError ;
407
407
private final UtcTimestampPrecision timestampPrecision ;
408
- private final boolean refreshMessageStoreAtLogon ;
408
+ private final boolean refreshOnLogon ;
409
409
private final boolean redundantResentRequestsAllowed ;
410
410
private final boolean persistMessages ;
411
411
private final boolean checkCompID ;
@@ -468,7 +468,7 @@ public class Session implements Closeable {
468
468
LogFactory logFactory , MessageFactory messageFactory , int heartbeatInterval ,
469
469
boolean checkLatency , int maxLatency , UtcTimestampPrecision timestampPrecision ,
470
470
boolean resetOnLogon , boolean resetOnLogout , boolean resetOnDisconnect ,
471
- boolean refreshMessageStoreAtLogon , boolean checkCompID ,
471
+ boolean refreshOnLogon , boolean checkCompID ,
472
472
boolean redundantResentRequestsAllowed , boolean persistMessages ,
473
473
boolean useClosedRangeForResend , double testRequestDelayMultiplier ,
474
474
DefaultApplVerID senderDefaultApplVerID , boolean validateSequenceNumbers ,
@@ -488,7 +488,7 @@ public class Session implements Closeable {
488
488
this .resetOnLogout = resetOnLogout ;
489
489
this .resetOnDisconnect = resetOnDisconnect ;
490
490
this .timestampPrecision = timestampPrecision ;
491
- this .refreshMessageStoreAtLogon = refreshMessageStoreAtLogon ;
491
+ this .refreshOnLogon = refreshOnLogon ;
492
492
this .dataDictionaryProvider = dataDictionaryProvider ;
493
493
this .messageFactory = messageFactory ;
494
494
this .checkCompID = checkCompID ;
@@ -1254,10 +1254,6 @@ private boolean resetOrDisconnectIfRequired(Message msg) {
1254
1254
return false ;
1255
1255
}
1256
1256
1257
- private boolean isStateRefreshNeeded (String msgType ) {
1258
- return refreshMessageStoreAtLogon && !state .isInitiator () && MsgType .LOGON .equals (msgType );
1259
- }
1260
-
1261
1257
private void nextReject (Message reject ) throws FieldNotFound , RejectLogon , IncorrectDataFormat ,
1262
1258
IncorrectTagValue , UnsupportedMessageType , IOException , InvalidMessage {
1263
1259
if (!verify (reject , false , validateSequenceNumbers )) {
@@ -2013,10 +2009,8 @@ private boolean generateLogon() throws IOException {
2013
2009
if (sessionID .isFIXT ()) {
2014
2010
logon .setField (DefaultApplVerID .FIELD , senderDefaultApplVerID );
2015
2011
}
2016
- if (isStateRefreshNeeded (MsgType .LOGON )) {
2017
- getLog ().onEvent ("Refreshing message/state store at logon" );
2018
- getStore ().refresh ();
2019
- stateListener .onRefresh ();
2012
+ if (refreshOnLogon ) {
2013
+ refreshState ();
2020
2014
}
2021
2015
if (resetOnLogon ) {
2022
2016
resetState ();
@@ -2117,10 +2111,8 @@ private void nextLogon(Message logon) throws FieldNotFound, RejectLogon, Incorre
2117
2111
// QFJ-926 - reset session before accepting Logon
2118
2112
resetIfSessionNotCurrent (sessionID , SystemTime .currentTimeMillis ());
2119
2113
2120
- if (isStateRefreshNeeded (MsgType .LOGON )) {
2121
- getLog ().onEvent ("Refreshing message/state store at logon" );
2122
- getStore ().refresh ();
2123
- stateListener .onRefresh ();
2114
+ if (refreshOnLogon ) {
2115
+ refreshState ();
2124
2116
}
2125
2117
2126
2118
if (logon .isSetField (ResetSeqNumFlag .FIELD )) {
@@ -2803,7 +2795,7 @@ public boolean getRedundantResentRequestsAllowed() {
2803
2795
}
2804
2796
2805
2797
public boolean getRefreshOnLogon () {
2806
- return refreshMessageStoreAtLogon ;
2798
+ return refreshOnLogon ;
2807
2799
}
2808
2800
2809
2801
public boolean getResetOnDisconnect () {
@@ -3033,4 +3025,10 @@ private void setLogonTags(final Message logon) {
3033
3025
}
3034
3026
}
3035
3027
3028
+ private void refreshState () throws IOException {
3029
+ getLog ().onEvent ("Refreshing message/state store on Logon" );
3030
+ getStore ().refresh ();
3031
+ stateListener .onRefresh ();
3032
+ }
3033
+
3036
3034
}
0 commit comments