@Override public boolean isEquivalent(Map<String, Object> configuration) { Boolean httpUpgradeEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_UPGRADE_ENABLED, configuration); if (httpUpgradeEnabled) { // we need to look at the activemqServerName to distinguish between ActiveMQ servers that could be proxied behind the same // HTTP upgrade handler in the Web server String otherActiveMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, configuration); String activeMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, this.configuration); boolean equivalent = isSameHostAndPort(configuration) && otherActiveMQServerName != null && otherActiveMQServerName.equals(activeMQServerName); return equivalent; } else { return isSameHostAndPort(configuration); } }
public URI toBackupURI() { TransportConfiguration backupConnector = getBackup(); if (backupConnector == null) { return null; } Map<String, Object> props = backupConnector.getParams(); String host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME, "localhost", props); int port = ConfigurationHelper.getIntProperty(TransportConstants.PORT_PROP_NAME, 0, props); boolean sslEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME, false, props); try { return new URI("tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=" + sslEnabled); } catch (URISyntaxException e) { return null; } }
sslEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME, TransportConstants.DEFAULT_SSL_ENABLED, configuration); httpEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_ENABLED, configuration); servletPath = ConfigurationHelper.getStringProperty(TransportConstants.SERVLET_PATH, TransportConstants.DEFAULT_SERVLET_PATH, configuration); if (httpEnabled) { httpMaxClientIdleTime = ConfigurationHelper.getLongProperty(TransportConstants.HTTP_CLIENT_IDLE_PROP_NAME, TransportConstants.DEFAULT_HTTP_CLIENT_IDLE_TIME, configuration); httpClientIdleScanPeriod = ConfigurationHelper.getLongProperty(TransportConstants.HTTP_CLIENT_IDLE_SCAN_PERIOD, TransportConstants.DEFAULT_HTTP_CLIENT_SCAN_PERIOD, configuration); httpRequiresSessionId = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_REQUIRES_SESSION_ID, TransportConstants.DEFAULT_HTTP_REQUIRES_SESSION_ID, configuration); } else { httpMaxClientIdleTime = 0; httpUpgradeEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_UPGRADE_ENABLED, configuration); useGlobalWorkerPool = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_NIO_GLOBAL_WORKER_POOL_PROP_NAME, TransportConstants.DEFAULT_USE_GLOBAL_WORKER_POOL, configuration); useGlobalWorkerPool = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_GLOBAL_WORKER_POOL_PROP_NAME, useGlobalWorkerPool, configuration); useEpoll = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_EPOLL_PROP_NAME, TransportConstants.DEFAULT_USE_EPOLL, configuration); useKQueue = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_KQUEUE_PROP_NAME, TransportConstants.DEFAULT_USE_KQUEUE, configuration); useServlet = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_SERVLET_PROP_NAME, TransportConstants.DEFAULT_USE_SERVLET, configuration); host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME, TransportConstants.DEFAULT_HOST, configuration); port = ConfigurationHelper.getIntProperty(TransportConstants.PORT_PROP_NAME, TransportConstants.DEFAULT_PORT, configuration); verifyHost = ConfigurationHelper.getBooleanProperty(TransportConstants.VERIFY_HOST_PROP_NAME, TransportConstants.DEFAULT_VERIFY_HOST, configuration); trustAll = ConfigurationHelper.getBooleanProperty(TransportConstants.TRUST_ALL_PROP_NAME, TransportConstants.DEFAULT_TRUST_ALL, configuration); useDefaultSslContext = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_DEFAULT_SSL_CONTEXT_PROP_NAME, TransportConstants.DEFAULT_USE_DEFAULT_SSL_CONTEXT, configuration); } else { keyStoreProvider = TransportConstants.DEFAULT_KEYSTORE_PROVIDER;
public InVMAcceptor(final String name, final ClusterConnection clusterConnection, final Map<String, Object> configuration, final BufferHandler handler, final ServerConnectionLifeCycleListener listener, final Map<String, ProtocolManager> protocolMap, final Executor threadPool) { super(protocolMap); this.name = name; this.clusterConnection = clusterConnection; this.configuration = configuration; this.handler = handler; this.listener = listener; id = ConfigurationHelper.getIntProperty(TransportConstants.SERVER_ID_PROP_NAME, 0, configuration); executorFactory = new OrderedExecutorFactory(threadPool); connectionsAllowed = ConfigurationHelper.getLongProperty(TransportConstants.CONNECTIONS_ALLOWED, TransportConstants.DEFAULT_CONNECTIONS_ALLOWED, configuration); enableBufferPooling = ConfigurationHelper.getBooleanProperty(TransportConstants.BUFFER_POOLING, TransportConstants.DEFAULT_BUFFER_POOLING, configuration); directDeliver = ConfigurationHelper.getBooleanProperty(TransportConstants.DIRECT_DELIVER, TransportConstants.DEFAULT_DIRECT_DELIVER, configuration); }
@Override public boolean isEquivalent(Map<String, Object> configuration) { Boolean httpUpgradeEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_UPGRADE_ENABLED, configuration); if (httpUpgradeEnabled) { // we need to look at the activemqServerName to distinguish between ActiveMQ servers that could be proxied behind the same // HTTP upgrade handler in the Web server String otherActiveMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, configuration); String activeMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, this.configuration); boolean equivalent = isSameHostAndPort(configuration) && otherActiveMQServerName != null && otherActiveMQServerName.equals(activeMQServerName); return equivalent; } else { return isSameHostAndPort(configuration); } }
StompConnection(final Acceptor acceptorUsed, final Connection transportConnection, final StompProtocolManager manager, final ScheduledExecutorService scheduledExecutorService, final ExecutorFactory factory) { this.scheduledExecutorService = scheduledExecutorService; this.factory = factory; this.transportConnection = transportConnection; this.manager = manager; this.frameHandler = new StompFrameHandlerV10(this, scheduledExecutorService, factory); this.creationTime = System.currentTimeMillis(); this.acceptorUsed = acceptorUsed; this.enableMessageID = ConfigurationHelper.getBooleanProperty(TransportConstants.STOMP_ENABLE_MESSAGE_ID, false, acceptorUsed.getConfiguration()); this.minLargeMessageSize = ConfigurationHelper.getIntProperty(TransportConstants.STOMP_MIN_LARGE_MESSAGE_SIZE, ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, acceptorUsed.getConfiguration()); }
@Override public boolean isEquivalent(Map<String, Object> configuration) { boolean httpUpgradeEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_UPGRADE_ENABLED, configuration); if (httpUpgradeEnabled) { // we need to look at the activemqServerName to distinguish between ActiveMQ servers that could be proxied behind the same // HTTP upgrade handler in the Web server String otherActiveMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, configuration); String activeMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, this.configuration); boolean equivalent = isSameHostAndPort(configuration) && otherActiveMQServerName != null && otherActiveMQServerName.equals(activeMQServerName); return equivalent; } else { return isSameHostAndPort(configuration); } }
@Override public boolean isEquivalent(Map<String, Object> configuration) { boolean httpUpgradeEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_UPGRADE_ENABLED, configuration); if (httpUpgradeEnabled) { // we need to look at the activemqServerName to distinguish between ActiveMQ servers that could be proxied behind the same // HTTP upgrade handler in the Web server String otherActiveMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, configuration); String activeMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, this.configuration); boolean equivalent = isSameHostAndPort(configuration) && otherActiveMQServerName != null && otherActiveMQServerName.equals(activeMQServerName); return equivalent; } else { return isSameHostAndPort(configuration); } }
@Override public boolean isEquivalent(Map<String, Object> configuration) { boolean httpUpgradeEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_UPGRADE_ENABLED, configuration); if (httpUpgradeEnabled) { // we need to look at the activemqServerName to distinguish between ActiveMQ servers that could be proxied behind the same // HTTP upgrade handler in the Web server String otherActiveMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, configuration); String activeMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, this.configuration); boolean equivalent = isSameHostAndPort(configuration) && otherActiveMQServerName != null && otherActiveMQServerName.equals(activeMQServerName); return equivalent; } else { return isSameHostAndPort(configuration); } }
@Override public boolean isEquivalent(Map<String, Object> configuration) { Boolean httpUpgradeEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_UPGRADE_ENABLED, configuration); if (httpUpgradeEnabled) { // we need to look at the activemqServerName to distinguish between ActiveMQ servers that could be proxied behind the same // HTTP upgrade handler in the Web server String otherActiveMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, configuration); String activeMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, this.configuration); boolean equivalent = isSameHostAndPort(configuration) && otherActiveMQServerName != null && otherActiveMQServerName.equals(activeMQServerName); return equivalent; } else { return isSameHostAndPort(configuration); } }
@Override public boolean isEquivalent(Map<String, Object> configuration) { Boolean httpUpgradeEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, TransportConstants.DEFAULT_HTTP_UPGRADE_ENABLED, configuration); if (httpUpgradeEnabled) { // we need to look at the activemqServerName to distinguish between ActiveMQ servers that could be proxied behind the same // HTTP upgrade handler in the Web server String otherActiveMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, configuration); String activeMQServerName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME, null, this.configuration); boolean equivalent = isSameHostAndPort(configuration) && otherActiveMQServerName != null && otherActiveMQServerName.equals(activeMQServerName); return equivalent; } else { return isSameHostAndPort(configuration); } }
public URI toBackupURI() { TransportConfiguration backupConnector = getBackup(); if (backupConnector == null) { return null; } Map<String, Object> props = backupConnector.getParams(); String host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME, "localhost", props); int port = ConfigurationHelper.getIntProperty(TransportConstants.PORT_PROP_NAME, 0, props); boolean sslEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME, false, props); try { return new URI("tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=" + sslEnabled); } catch (URISyntaxException e) { return null; } }
public URI toBackupURI() { TransportConfiguration backupConnector = getBackup(); if (backupConnector == null) { return null; } Map<String, Object> props = backupConnector.getParams(); String host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME, "localhost", props); int port = ConfigurationHelper.getIntProperty(TransportConstants.PORT_PROP_NAME, 0, props); boolean sslEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME, false, props); try { return new URI("tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=" + sslEnabled); } catch (URISyntaxException e) { return null; } }
StompConnection(final Acceptor acceptorUsed, final Connection transportConnection, final StompProtocolManager manager, final ScheduledExecutorService scheduledExecutorService, final ExecutorFactory factory) { this.scheduledExecutorService = scheduledExecutorService; this.factory = factory; this.transportConnection = transportConnection; this.manager = manager; this.frameHandler = new StompFrameHandlerV10(this, scheduledExecutorService, factory); this.creationTime = System.currentTimeMillis(); this.acceptorUsed = acceptorUsed; this.enableMessageID = ConfigurationHelper.getBooleanProperty(TransportConstants.STOMP_ENABLE_MESSAGE_ID, false, acceptorUsed.getConfiguration()); this.minLargeMessageSize = ConfigurationHelper.getIntProperty(TransportConstants.STOMP_MIN_LARGE_MESSAGE_SIZE, ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, acceptorUsed.getConfiguration()); }
public URI toBackupURI() { TransportConfiguration backupConnector = getBackup(); if (backupConnector == null) { return null; } Map<String, Object> props = backupConnector.getParams(); String host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME, "localhost", props); int port = ConfigurationHelper.getIntProperty(TransportConstants.PORT_PROP_NAME, 0, props); boolean sslEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME, false, props); try { return new URI("tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=" + sslEnabled); } catch (URISyntaxException e) { return null; } }
public URI toBackupURI() { TransportConfiguration backupConnector = getBackup(); if (backupConnector == null) { return null; } Map<String, Object> props = backupConnector.getParams(); String host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME, "localhost", props); int port = ConfigurationHelper.getIntProperty(TransportConstants.PORT_PROP_NAME, 0, props); boolean sslEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME, false, props); try { return new URI("tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=" + sslEnabled); } catch (URISyntaxException e) { return null; } }
public URI toBackupURI() { TransportConfiguration backupConnector = getBackup(); if (backupConnector == null) { return null; } Map<String, Object> props = backupConnector.getParams(); String host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME, "localhost", props); int port = ConfigurationHelper.getIntProperty(TransportConstants.PORT_PROP_NAME, 0, props); boolean sslEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME, false, props); try { return new URI("tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=" + sslEnabled); } catch (URISyntaxException e) { return null; } }
public URI toBackupURI() { TransportConfiguration backupConnector = getBackup(); if (backupConnector == null) { return null; } Map<String, Object> props = backupConnector.getParams(); String host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME, "localhost", props); int port = ConfigurationHelper.getIntProperty(TransportConstants.PORT_PROP_NAME, 0, props); boolean sslEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME, false, props); try { return new URI("tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=" + sslEnabled); } catch (URISyntaxException e) { return null; } }
public InVMConnector(final Map<String, Object> configuration, final BufferHandler handler, final ClientConnectionLifeCycleListener listener, final Executor closeExecutor, final Executor threadPool, ClientProtocolManager protocolManager) { super(configuration); this.listener = listener; id = ConfigurationHelper.getIntProperty(TransportConstants.SERVER_ID_PROP_NAME, 0, configuration); bufferPoolingEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.BUFFER_POOLING, TransportConstants.DEFAULT_BUFFER_POOLING, configuration); this.handler = handler; this.closeExecutor = closeExecutor; executorFactory = new OrderedExecutorFactory(getInVMExecutor()); InVMRegistry registry = InVMRegistry.instance; acceptor = registry.getAcceptor(id); this.protocolManager = protocolManager; }
OutgoingVertxEventHandler(String connectorName, Map<String, Object> configuration, PostOffice postOffice) { this.connectorName = connectorName; this.queueName = ConfigurationHelper.getStringProperty(VertxConstants.QUEUE_NAME, null, configuration); this.postOffice = postOffice; this.port = ConfigurationHelper.getIntProperty(VertxConstants.PORT, 0, configuration); this.host = ConfigurationHelper.getStringProperty(VertxConstants.HOST, "localhost", configuration); this.quorumSize = ConfigurationHelper.getIntProperty(VertxConstants.VERTX_QUORUM_SIZE, -1, configuration); this.haGroup = ConfigurationHelper.getStringProperty(VertxConstants.VERTX_HA_GROUP, "activemq", configuration); this.vertxAddress = ConfigurationHelper.getStringProperty(VertxConstants.VERTX_ADDRESS, "org.apache.activemq", configuration); this.publish = ConfigurationHelper.getBooleanProperty(VertxConstants.VERTX_PUBLISH, false, configuration); }