/** * There's a case on ClusterConnections that we need to find an equivalent Connector * and we can't use a Netty Cluster Connection on an InVM ClusterConnection (inVM used on tests) * for that reason I need to test if the two instances of the TransportConfiguration are equivalent * while a test a connector against an acceptor * @param otherConfig * @return */ public boolean isEquivalent(TransportConfiguration otherConfig) { if (this.getFactoryClassName().equals(otherConfig.getFactoryClassName())) { return true; } else if (this.getFactoryClassName().contains("Netty") && otherConfig.getFactoryClassName().contains("Netty")) { return true; } else if (this.getFactoryClassName().contains("InVM") && otherConfig.getFactoryClassName().contains("InVM")) { return true; } else { return false; } }
/** * There's a case on ClusterConnections that we need to find an equivalent Connector and we can't * use a Netty Cluster Connection on an InVM ClusterConnection (inVM used on tests) for that * reason I need to test if the two instances of the TransportConfiguration are equivalent while * a test a connector against an acceptor * @param otherConfig * @return {@code true} if the factory class names are equivalents */ public boolean isEquivalent(TransportConfiguration otherConfig) { if (this.getFactoryClassName().equals(otherConfig.getFactoryClassName())) { return true; } else if (this.getFactoryClassName().contains("Netty") && otherConfig.getFactoryClassName().contains("Netty")) { return true; } else if (this.getFactoryClassName().contains("InVM") && otherConfig.getFactoryClassName().contains("InVM")) { return true; } else { return false; } }
public String getFactoryClassName() { clearIO(); try { return configuration.getFactoryClassName(); } finally { blockOnIO(); } }
public String getFactoryClassName() { clearIO(); try { return configuration.getFactoryClassName(); } finally { blockOnIO(); } }
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 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()); } }
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(); } }
connectorFactory = instantiateConnectorFactory(connectorConfig.getFactoryClassName());
Class<?> clazz = loader.loadClass(info.getFactoryClassName()); RemotingServiceImpl.log.warn("Error instantiating acceptor \"" + info.getFactoryClassName() + "\"", e);
Class<?> clazz = loader.loadClass(info.getFactoryClassName()); HornetQServerLogger.LOGGER.errorCreatingAcceptor(e, info.getFactoryClassName());
connectorFactory = instantiateConnectorFactory(connectorConfig.getFactoryClassName());
ConnectorFactory backupConnectorFactory = instantiateConnectorFactory(backupConfig.getFactoryClassName()); connector = backupConnectorFactory.createConnector(backupConfig.getParams(), handler,
ConnectorFactory backupConnectorFactory = instantiateConnectorFactory(backupConfig.getFactoryClassName()); connector = backupConnectorFactory.createConnector(backupConfig.getParams(), handler,