protected void conclude()

in gflog-core/src/main/java/com/epam/deltix/gflog/core/service/AsyncLogServiceFactory.java [72:115]


    protected void conclude() {
        super.conclude();

        if (threadFactory == null) {
            threadFactory = r -> new Thread(r, "gflog");
        }

        if (idleStrategy == null) {
            idleStrategy = new IdleStrategyFactory().create();
        }

        if (overflowStrategy == null) {
            overflowStrategy = OverflowStrategy.WAIT;
        }

        if (bufferCapacity <= LogBuffer.MIN_CAPACITY) {
            bufferCapacity = LogBuffer.MIN_CAPACITY;
        }

        if (bufferCapacity >= LogBuffer.MAX_CAPACITY) {
            bufferCapacity = LogBuffer.MAX_CAPACITY;
        }

        bufferCapacity = Util.nextPowerOfTwo(bufferCapacity);

        if (exceptionIndexCapacity > 0) {
            final int maxCapacity = bufferCapacity / ExceptionIndex.MIN_SEGMENT;
            final int minCapacity = ExceptionIndex.MIN_CAPACITY;

            if (exceptionIndexCapacity < minCapacity) {
                exceptionIndexCapacity = minCapacity;
            }

            if (exceptionIndexCapacity > maxCapacity) {
                exceptionIndexCapacity = maxCapacity;
            }

            exceptionIndexCapacity = Util.nextPowerOfTwo(exceptionIndexCapacity);
        }

        if (failedOffersCounter == null) {
            failedOffersCounter = NoOpCounter.INSTANCE;
        }
    }