{
try
{
Class<?> clazz = loader.loadClass(info.getFactoryClassName());
AcceptorFactory factory = (AcceptorFactory) clazz.newInstance();
// Check valid properties
if (info.getParams() != null)
{
Set<String> invalid = ConfigurationHelper.checkKeys(factory.getAllowableProperties(), info.getParams()
.keySet());
if (!invalid.isEmpty())
{
HornetQServerLogger.LOGGER.invalidAcceptorKeys(ConfigurationHelper.stringSetToCommaListString(invalid));
continue;
}
}
Map<String, ProtocolManager> supportedProtocols = new ConcurrentHashMap();
String protocol = ConfigurationHelper.getStringProperty(TransportConstants.PROTOCOL_PROP_NAME, null,
info.getParams());
if (protocol != null)
{
HornetQServerLogger.LOGGER.warnDeprecatedProtocol();
ProtocolManager protocolManager = protocolMap.get(protocol);
if (protocolManager == null)
{
throw HornetQMessageBundle.BUNDLE.noProtocolManagerFound(protocol);
}
else
{
supportedProtocols.put(protocol, protocolManager);
}
}
String protocols = ConfigurationHelper.getStringProperty(TransportConstants.PROTOCOLS_PROP_NAME, null,
info.getParams());
if (protocols != null)
{
String[] actualProtocols = protocols.split(",");
if (actualProtocols != null)
{
for (String actualProtocol : actualProtocols)
{
ProtocolManager protocolManager = protocolMap.get(actualProtocol);
if (protocolManager == null)
{
throw HornetQMessageBundle.BUNDLE.noProtocolManagerFound(actualProtocol);
}
else
{
supportedProtocols.put(actualProtocol, protocolManager);
}
}
}
}
ClusterConnection clusterConnection = lookupClusterConnection(info);
Acceptor acceptor = factory.createAcceptor(info.getName(),
clusterConnection,
info.getParams(),
new DelegatingBufferHandler(),
this,
threadPool,