Skip to content

Commit b59a563

Browse files
authored
Merge pull request #1018 from quickfix-j/jetbrains-junie/issue-1011-run-dd90fea9-b817-42c4-9ec5-03d0b7ef5b6c
[Junie]: feat: add `start()` method to JMX Connector operations
2 parents 571c658 + 2609035 commit b59a563

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

quickfixj-core/src/main/java/org/quickfixj/jmx/mbean/connector/ConnectorAdmin.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
import org.slf4j.Logger;
2626
import org.slf4j.LoggerFactory;
2727
import quickfix.Acceptor;
28+
import quickfix.ConfigError;
2829
import quickfix.Connector;
2930
import quickfix.Initiator;
31+
import quickfix.RuntimeError;
3032
import quickfix.Session;
3133
import quickfix.SessionID;
3234
import quickfix.SessionSettings;
@@ -142,6 +144,15 @@ private ObjectName[] toObjectNameArray(List<ObjectName> sessions) {
142144
return sessions.toArray(new ObjectName[sessions.size()]);
143145
}
144146

147+
public void start() throws IOException {
148+
log.info("JMX operation: start {} {}", getRole(), this);
149+
try {
150+
connector.start();
151+
} catch (ConfigError | RuntimeError e) {
152+
throw JmxSupport.toIOException(e);
153+
}
154+
}
155+
145156
public void stop(boolean force) {
146157
log.info("JMX operation: stop {} {}", getRole(), this);
147158
connector.stop(force);

quickfixj-core/src/main/java/org/quickfixj/jmx/mbean/connector/ConnectorAdminMBean.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ public interface ConnectorAdminMBean {
3030
*/
3131
String getRole() throws IOException;
3232

33+
/**
34+
* Start the connector.
35+
*
36+
* @throws IOException if there is a problem starting the connector
37+
*/
38+
void start() throws IOException;
39+
3340
/**
3441
* Stop the connector.
3542
*

0 commit comments

Comments
 (0)