class WireStorePool extends SimpleCloseable {
    @NotNull
    private final WireStoreSupplier supplier;
    private final StoreFileListener storeFileListener;

    private WireStorePool(@NotNull WireStoreSupplier supplier, StoreFileListener storeFileListener) {
        this.supplier = supplier;
        this.storeFileListener = storeFileListener;
    }

    @NotNull
    public static WireStorePool withSupplier(@NotNull WireStoreSupplier supplier, StoreFileListener storeFileListener) {
        return new WireStorePool(supplier, storeFileListener);
    }

    @Nullable
    public SingleChronicleQueueStore acquire(
            final int cycle,
            WireStoreSupplier.CreateStrategy createStrategy,
            SingleChronicleQueueStore oldStore) {<FILL_FUNCTION_BODY>}

    public int nextCycle(final int currentCycle, @NotNull TailerDirection direction) throws ParseException {
        throwExceptionIfClosed();
        return supplier.nextCycle(currentCycle, direction);
    }

    public void closeStore(@NotNull SingleChronicleQueueStore store) {
        BackgroundResourceReleaser.release(store);
        if (storeFileListener.isActive())
            BackgroundResourceReleaser.run(() -> storeFileListener.onReleased(store.cycle(), store.file()));
    }

    /**
     * list cycles between ( inclusive )
     *
     * @param lowerCycle the lower cycle
     * @param upperCycle the upper cycle
     * @return an array including these cycles and all the intermediate cycles
     */
    public NavigableSet<Long> listCyclesBetween(int lowerCycle, int upperCycle) {
        throwExceptionIfClosed();

        return supplier.cycles(lowerCycle, upperCycle);
    }
}

        throwExceptionIfClosed();

        // reuse cycle store when applicable
        if (oldStore != null && oldStore.cycle() == cycle && !oldStore.isClosed())
            return oldStore;

        SingleChronicleQueueStore store = this.supplier.acquire(cycle, createStrategy);
        if (store != null) {
            store.cycle(cycle);
            if (store != oldStore && storeFileListener.isActive())
                BackgroundResourceReleaser.run(() -> storeFileListener.onAcquired(cycle, store.file()));
        }
        return store;
    
<methods>public final void close() ,public boolean isClosed() <variables>private volatile transient boolean closed