private ClusterConnection lookupClusterConnection(TransportConfiguration acceptorConfig) { String clusterConnectionName = (String) acceptorConfig.getParams().get(org.hornetq.core.remoting.impl.netty.TransportConstants.CLUSTER_CONNECTION); ClusterConnection clusterConnection = null; if (clusterConnectionName != null) { clusterConnection = clusterManager.getClusterConnection(clusterConnectionName); } // if not found we will still use the default name, even if a name was provided if (clusterConnection == null) { clusterConnection = clusterManager.getDefaultConnection(acceptorConfig); } return clusterConnection; }
public Map<String, Object> getParameters() { clearIO(); try { return configuration.getParams(); } finally { blockOnIO(); } }
public Map<String, Object> getParameters() { clearIO(); try { return configuration.getParams(); } finally { blockOnIO(); } }
private ClusterConnection lookupClusterConnection(TransportConfiguration acceptorConfig) { String clusterConnectionName = (String)acceptorConfig.getParams().get(org.hornetq.core.remoting.impl.netty.TransportConstants.CLUSTER_CONNECTION); ClusterConnection clusterConnection = null; if (clusterConnectionName != null) { clusterConnection = clusterManager.getClusterConnection(clusterConnectionName); } // if not found we will still use the default name, even if a name was provided if (clusterConnection == null) { clusterConnection = clusterManager.getDefaultConnection(acceptorConfig); } return clusterConnection; }
public static void encode(HornetQBuffer buffer, TransportConfiguration config) { BufferHelper.writeAsNullableSimpleString(buffer, config.getName()); BufferHelper.writeAsSimpleString(buffer, config.getFactoryClassName()); buffer.writeInt(config.getParams().size()); for (Entry<String, Object> param : config.getParams().entrySet()) { BufferHelper.writeAsSimpleString(buffer, param.getKey()); BufferHelper.writeAsSimpleString(buffer, param.getValue().toString()); } }
private void correctInvalidNettyConnectorHost(TransportConfiguration transportConfiguration) { Map<String, Object> params = transportConfiguration.getParams(); if (transportConfiguration.getFactoryClassName().equals(NettyConnectorFactory.class.getCanonicalName()) && params.containsKey(TransportConstants.HOST_PROP_NAME) && params.get(TransportConstants.HOST_PROP_NAME).equals("0.0.0.0")) { try { String newHost = InetAddress.getLocalHost().getHostName(); log.info("Invalid \"host\" value \"0.0.0.0\" detected for \"" + transportConfiguration.getName() + "\" connector. Switching to \"" + newHost + "\". If this new address is incorrect please manually configure the connector to use the proper one."); params.put(TransportConstants.HOST_PROP_NAME, newHost); } catch (UnknownHostException e) { log.warn("Tried to correct invalid \"host\" value \"0.0.0.0\" for \"" + transportConfiguration.getName() + "\" connector, but received an exception.", e); } } }
public static int getEncodeSize(TransportConfiguration config) { int size = BufferHelper.sizeOfNullableSimpleString(config.getName()) + BufferHelper.sizeOfSimpleString(config.getFactoryClassName()); size += DataConstants.SIZE_INT; // number of params for (Entry<String, Object> param : config.getParams().entrySet()) { size += BufferHelper.sizeOfSimpleString(param.getKey()); size += BufferHelper.sizeOfSimpleString(param.getValue().toString()); } return size; }
public TransportConfiguration getBackupForConnector(final Connector connector) { for (TopologyMemberImpl member : topology.values()) { if (member.getLive() != null && connector.isEquivalent(member.getLive().getParams())) { return member.getBackup(); } } return null; }
public Object[] getConnectors() throws Exception { checkStarted(); clearIO(); try { Collection<TransportConfiguration> connectorConfigurations = configuration.getConnectorConfigurations() .values(); Object[] ret = new Object[connectorConfigurations.size()]; int i = 0; for (TransportConfiguration config : connectorConfigurations) { Object[] tc = new Object[3]; tc[0] = config.getName(); tc[1] = config.getFactoryClassName(); tc[2] = config.getParams(); ret[i++] = tc; } return ret; } finally { blockOnIO(); } }
public Object[] getConnectors() throws Exception { checkStarted(); clearIO(); try { Collection<TransportConfiguration> connectorConfigurations = configuration.getConnectorConfigurations() .values(); Object[] ret = new Object[connectorConfigurations.size()]; int i = 0; for (TransportConfiguration config : connectorConfigurations) { Object[] tc = new Object[3]; tc[0] = config.getName(); tc[1] = config.getFactoryClassName(); tc[2] = config.getParams(); ret[i++] = tc; } return ret; } finally { blockOnIO(); } }
checkTransportKeys(connectorFactory, connectorConfig.getParams());
checkTransportKeys(connectorFactory, connectorConfig.getParams());