    [uxbox.util.spec :as us]
    [uxbox.util.exceptions :as ex])
   (:import
+   clojure.lang.IDeref
+   clojure.lang.MapEntry
    java.util.Map
-   java.util.List
-   java.util.Map$Entry
    java.util.HashMap))
 
 (definterface IDispatcher

(deftype Dispatcher [reg attr interceptors]
  IDispatcher
  (add [this key f metadata]
    (.put ^Map reg key (Map/entry f metadata))
    nil)

  clojure.lang.IFn
  (invoke [_ params]

        (p/rejected (ex/error :type :not-found
                              :code :method-not-found
                              :hint "No method found for the current request."))
        (let [f (.key ^MapEntry entry)
              m (.val ^MapEntry entry)
              d (p/deferred)]

          (sp/execute (conj interceptors f)
