public Double getDouble(T key) { return getDouble(key, null); }
protected ConnectionFactory createRemoteConnectionFactory(final Options<CreateContextOption> options) { //TODO: possibly cache the remote cf's? Map<String, Object> transportOpts = new HashMap<>(); transportOpts.put("host", options.getString(CreateContextOption.HOST)); transportOpts.put("port", options.getInt(CreateContextOption.PORT)); if (REMOTE_TYPE_WILDFLY.equals(options.getString(CreateContextOption.REMOTE_TYPE))) { transportOpts.put("http-upgrade-enabled", true); } TransportConfiguration config = new TransportConfiguration("org.hornetq.core.remoting.impl.netty.NettyConnectorFactory", transportOpts); HornetQConnectionFactory hornetQcf = HornetQJMSClient .createConnectionFactoryWithoutHA(options.has(CreateContextOption.XA) ? JMSFactoryType.XA_CF : JMSFactoryType.CF, config); hornetQcf.setReconnectAttempts(options.getInt(CreateContextOption.RECONNECT_ATTEMPTS)); hornetQcf.setRetryInterval(options.getLong(CreateContextOption.RECONNECT_RETRY_INTERVAL)); hornetQcf.setRetryIntervalMultiplier(options.getDouble(CreateContextOption.RECONNECT_RETRY_INTERVAL_MULTIPLIER)); hornetQcf.setMaxRetryInterval(options.getLong(CreateContextOption.RECONNECT_MAX_RETRY_INTERVAL)); // We have to cast for HornetQ 2.3 - the factory object that is returned is both a HornetQConnectionFactory // and a javax.jms.ConnectionFactory, but HornetQConnectionFactory doesn't implement j.j.ConnectionFactory. // With HornetQ 2.4, this cast is redundant. return (ConnectionFactory)hornetQcf; }