protected void onActivate()
{
Collection<Transport> transports = getTransports();
Set<AmqpProtocolVersion> supported = convertFromModelProtocolsToAmqp(getProtocols());
TransportProvider transportProvider = null;
final HashSet<Transport> transportSet = new HashSet<Transport>(transports);
for(TransportProviderFactory tpf : (new QpidServiceLoader<TransportProviderFactory>()).instancesOf(TransportProviderFactory.class))
{
if(tpf.getSupportedTransports().contains(transports))
{
transportProvider = tpf.getTransportProvider(transportSet);
}
}
if(transportProvider == null)
{
throw new IllegalConfigurationException("No transport providers found which can satisfy the requirement to support the transports: " + transports);
}
SSLContext sslContext = null;
if (transports.contains(Transport.SSL) || transports.contains(Transport.WSS))
{
sslContext = createSslContext();
}
AmqpProtocolVersion defaultSupportedProtocolReply = getDefaultAmqpSupportedReply();
_transport = transportProvider.createTransport(transportSet,
sslContext,
this,
supported,
defaultSupportedProtocolReply);