本文整理匯總了Java中org.quickfixj.jmx.JmxExporter類的典型用法代碼示例。如果您正苦於以下問題:Java JmxExporter類的具體用法?Java JmxExporter怎麽用?Java JmxExporter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JmxExporter類屬於org.quickfixj.jmx包,在下文中一共展示了JmxExporter類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: clientInitiatorMBean
import org.quickfixj.jmx.JmxExporter; //導入依賴的package包/類
@Bean
@ConditionalOnProperty(prefix = "quickfixj.client", name = "jmx-enabled", havingValue = "true")
@ConditionalOnClass(JmxExporter.class)
@ConditionalOnSingleCandidate(Initiator.class)
@ConditionalOnMissingBean(name = "clientInitiatorMBean")
public ObjectName clientInitiatorMBean(Initiator clientInitiator) {
try {
JmxExporter exporter = new JmxExporter();
return exporter.register(clientInitiator);
} catch (JMException e) {
throw new ConfigurationException(e.getMessage(), e);
}
}
開發者ID:esanchezros,項目名稱:quickfixj-spring-boot-starter,代碼行數:14,代碼來源:QuickFixJClientAutoConfiguration.java
示例2: serverInitiatorMBean
import org.quickfixj.jmx.JmxExporter; //導入依賴的package包/類
@Bean
@ConditionalOnProperty(prefix = "quickfixj.server", name = "jmx-enabled", havingValue = "true")
@ConditionalOnClass(JmxExporter.class)
@ConditionalOnSingleCandidate(Acceptor.class)
@ConditionalOnMissingBean(name = "serverInitiatorMBean")
public ObjectName serverInitiatorMBean(Acceptor serverAcceptor) {
try {
JmxExporter exporter = new JmxExporter();
return exporter.register(serverAcceptor);
} catch (JMException e) {
throw new ConfigurationException(e.getMessage(), e);
}
}
開發者ID:esanchezros,項目名稱:quickfixj-spring-boot-starter,代碼行數:14,代碼來源:QuickFixJServerAutoConfiguration.java
示例3: initializeEngine
import org.quickfixj.jmx.JmxExporter; //導入依賴的package包/類
/**
* Initializes the engine on demand. May be called immediately in constructor or when needed.
* If initializing later, it should be started afterwards.
*/
void initializeEngine() throws ConfigError,
FieldConvertError, JMException {
if (messageFactory == null) {
messageFactory = new DefaultMessageFactory();
}
if (sessionLogFactory == null) {
sessionLogFactory = inferLogFactory(settings);
}
if (messageStoreFactory == null) {
messageStoreFactory = inferMessageStoreFactory(settings);
}
// Set default session schedule if not specified in configuration
if (!settings.isSetting(Session.SETTING_START_TIME)) {
settings.setString(Session.SETTING_START_TIME, DEFAULT_START_TIME);
}
if (!settings.isSetting(Session.SETTING_END_TIME)) {
settings.setString(Session.SETTING_END_TIME, DEFAULT_END_TIME);
}
// Default heartbeat interval
if (!settings.isSetting(Session.SETTING_HEARTBTINT)) {
settings.setLong(Session.SETTING_HEARTBTINT, DEFAULT_HEARTBTINT);
}
// Allow specification of the QFJ threading model
ThreadModel threadModel = ThreadModel.ThreadPerConnector;
if (settings.isSetting(SETTING_THREAD_MODEL)) {
threadModel = ThreadModel.valueOf(settings.getString(SETTING_THREAD_MODEL));
}
if (settings.isSetting(SETTING_USE_JMX) && settings.getBool(SETTING_USE_JMX)) {
LOG.info("Enabling JMX for QuickFIX/J");
jmxExporter = new JmxExporter();
} else {
jmxExporter = null;
}
// From original component implementation...
// To avoid this exception in OSGi platform
// java.lang.NoClassDefFoundError: quickfix/fix41/MessageFactory
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
if (isConnectorRole(settings, SessionFactory.ACCEPTOR_CONNECTION_TYPE)) {
acceptor = createAcceptor(new Dispatcher(), settings, messageStoreFactory,
sessionLogFactory, messageFactory, threadModel);
} else {
acceptor = null;
}
if (isConnectorRole(settings, SessionFactory.INITIATOR_CONNECTION_TYPE)) {
initiator = createInitiator(new Dispatcher(), settings, messageStoreFactory,
sessionLogFactory, messageFactory, threadModel);
} else {
initiator = null;
}
if (acceptor == null && initiator == null) {
throw new ConfigError("No connector role");
}
} finally {
Thread.currentThread().setContextClassLoader(ccl);
}
initialized.set(true);
}
示例4: FixClient
import org.quickfixj.jmx.JmxExporter; //導入依賴的package包/類
public FixClient() throws Exception {
if (!simulation) {
InputStream inputStream = this.getClass().getResourceAsStream("/fix.cfg");
SessionSettings settings = new SessionSettings(inputStream);
inputStream.close();
FixApplicationFactory applicationFactory = new FixApplicationFactory(settings);
MessageStoreFactory messageStoreFactory = new FileStoreFactory(settings);
LogFactory logFactory = new CompositeLogFactory(new LogFactory[] { new SLF4JLogFactory(settings), new FileLogFactory(settings) });
MessageFactory messageFactory = new DefaultMessageFactory();
SessionFactory sessionFactory = new FixMultiApplicationSessionFactory(applicationFactory, messageStoreFactory, logFactory, messageFactory);
this.initiator = new SocketInitiator(sessionFactory, settings);
JmxExporter exporter = new JmxExporter();
exporter.register(this.initiator);
logon();
}
}