Skip to content

Commit ee4b8ea

Browse files
authored
removed no longer needed flag in connectors (#190)
* removed no longer supported boolean flag blockInThread * made method SingleThreadedEventHandlingStrategy.block() private since its external usage is not supported anymore
1 parent fd4aac8 commit ee4b8ea

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

quickfixj-core/src/main/java/quickfix/SocketAcceptor.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,15 @@ public SocketAcceptor(SessionFactory sessionFactory, SessionSettings settings) t
9999

100100
@Override
101101
public void start() throws ConfigError, RuntimeError {
102-
initialize(true);
102+
initialize();
103103
}
104104

105-
private void initialize(boolean blockInThread) throws ConfigError {
105+
private void initialize() throws ConfigError {
106106
if (isStarted.equals(Boolean.FALSE)) {
107107
eventHandlingStrategy.setExecutor(longLivedExecutor);
108108
startAcceptingConnections();
109109
isStarted = Boolean.TRUE;
110-
if (blockInThread) {
111-
eventHandlingStrategy.blockInThread();
112-
} else {
113-
eventHandlingStrategy.block();
114-
}
110+
eventHandlingStrategy.blockInThread();
115111
} else {
116112
log.warn("Ignored attempt to start already running SocketAcceptor.");
117113
}

quickfixj-core/src/main/java/quickfix/SocketInitiator.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public SocketInitiator(SessionFactory sessionFactory, SessionSettings settings,
108108

109109
@Override
110110
public void start() throws ConfigError, RuntimeError {
111-
initialize(true);
111+
initialize();
112112
}
113113

114114
@Override
@@ -131,7 +131,7 @@ public void stop(boolean forceDisconnect) {
131131
}
132132
}
133133

134-
private void initialize(boolean blockInThread) throws ConfigError {
134+
private void initialize() throws ConfigError {
135135
if (isStarted.equals(Boolean.FALSE)) {
136136
eventHandlingStrategy.setExecutor(longLivedExecutor);
137137
createSessionInitiators();
@@ -140,11 +140,7 @@ private void initialize(boolean blockInThread) throws ConfigError {
140140
}
141141
startInitiators();
142142
isStarted = Boolean.TRUE;
143-
if (blockInThread) {
144-
eventHandlingStrategy.blockInThread();
145-
} else {
146-
eventHandlingStrategy.block();
147-
}
143+
eventHandlingStrategy.blockInThread();
148144
} else {
149145
log.warn("Ignored attempt to start already running SocketInitiator.");
150146
}

quickfixj-core/src/main/java/quickfix/mina/SingleThreadedEventHandlingStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public SessionConnector getSessionConnector() {
8181
return sessionConnector;
8282
}
8383

84-
public void block() {
84+
private void block() {
8585
while (true) {
8686
synchronized (this) {
8787
if (isStopped) {

0 commit comments

Comments
 (0)