private void openAsync()

in iothub/device/iot-device-client/src/main/java/com/microsoft/azure/sdk/iot/device/transport/amqps/AmqpsIotHubConnection.java [1244:1316]


    private void openAsync() throws TransportException
    {
        log.trace("OpenAsnyc called for amqp connection");

        synchronized (this.executorServiceLock)
        {
            if (executorService == null)
            {
                log.trace("Creating new executor service");
                executorService = Executors.newFixedThreadPool(1);
            }
        }

        this.reactor = createReactor();

        String runnerUniqueIdentifier = this.isMultiplexing
                ? "Multiplexed-" + this.transportUniqueIdentifier
                : this.clientConfiguration.getDeviceClientUniqueIdentifier();
        String reactorRunnerPrefix = this.hostName + "-" + runnerUniqueIdentifier + "-" + "Cnx" + this.connectionId;

        String threadName = "";
        if (this.isMultiplexing)
        {
            if (this.useIdentifiableThreadNames)
            {
                threadName += reactorRunnerPrefix + "-" + ReactorRunner.THREAD_NAME + "-ConnectionOwner";
            }
            else
            {
                if (this.threadNamePrefix != null && !this.threadNamePrefix.isEmpty())
                {
                    threadName += this.threadNamePrefix;
                }

                threadName += ReactorRunner.THREAD_NAME;

                if (this.threadNameSuffix != null && !this.threadNameSuffix.isEmpty())
                {
                    threadName += this.threadNameSuffix;
                }
            }
        }
        else
        {
            if (this.useIdentifiableThreadNames)
            {
                threadName += reactorRunnerPrefix + "-" + ReactorRunner.THREAD_NAME + "-ConnectionOwner";
            }
            else
            {
                if (this.threadNamePrefix != null && !this.threadNamePrefix.isEmpty())
                {
                    threadName += this.threadNamePrefix;
                }

                threadName += ReactorRunner.THREAD_NAME;

                if (this.threadNameSuffix != null && !this.threadNameSuffix.isEmpty())
                {
                    threadName += this.threadNameSuffix;
                }
            }
        }

        ReactorRunner reactorRunner = new ReactorRunner(
            this.reactor,
            this.listener,
            this.connectionId,
            threadName,
            this);

        executorService.submit(reactorRunner);
    }