         (transactionMode TransactionMode/TRANSACTIONAL))
     (.. builder clustering
         (cacheMode (cache-mode opts)))
+    (if persist
+      (let [store (.. builder loaders addFileCacheStore)]
+        (.. store (location (if (string? persist) persist file-store-path)))))
     (cond
       (= locking :pessimistic) (set-pessimistic-locking! builder)
       (= locking :optimistic) (set-optimistic-locking! builder)


(def clustered-manager (registry/get "jboss.infinispan.web"))
(def local-manager (delay (DefaultCacheManager.)))

(defn cache-mode
  [{:keys [mode sync]}]

  builder)

(defn build-config
  [{:keys [locking template persist] :as opts}]
  (let [builder (ConfigurationBuilder.)]
    (if template (.read builder template))
    (.classLoader builder (.getContextClassLoader (Thread/currentThread)))
