public AdaptiveMessageContainer create(ContainerConfiguration configuration) { ConnectionFactory factory = configuration.getFactory(); SessionType type = configuration.getSessionType(); boolean durable = configuration.isDurable(); int cacheLevel = configuration.getCacheLevel(); boolean cacheConnection = cacheLevel >= CACHE_CONNECTION; // set the receive timeout to half of the trx timeout - note receive timeout is in milliseconds and transaction timeout is in seconds int receiveTimeout = (transactionTimeout / 2) * 500; ContainerStatistics statistics = new ContainerStatistics(); URI uri = configuration.getUri(); ConnectionManager connectionManager = new ConnectionManager(factory, uri, cacheConnection, durable, containerMonitor); UnitOfWork work = createWork(uri, type, statistics); boolean javaEE = hostInfo.isJavaEEXAEnabled(); return new AdaptiveMessageContainer(configuration, receiveTimeout, connectionManager, work, statistics, executorService, javaEE, containerMonitor); }