     PersistentJobImpl []
   Job
   (execute [_ context]
-    (let [data (.. context getJobDetail getJobDataMap)
-          callable (.get ^JobDataMap data "callable")
-          state (.get ^JobDataMap data "state")
-          result (callable state)]
+    (let [^JobDataMap data (.. context getJobDetail getJobDataMap)
+          callable (.get data "callable")
+          state (.get data "state")
+          args (.get data "args")
+          result (apply callable state args)]
       (.put ^JobDataMap data "state" result))))
 
 (deftype JobImpl []
   Job
   (execute [_ context]
-    (let [data (.. context getJobDetail getJobDataMap)
-          callable (.get ^JobDataMap data "callable")]
-      (callable))))
+    (let [^JobDataMap data (.. context getJobDetail getJobDataMap)
+          args (.get data "args")
+          callable (.get data "callable")]
+      (apply callable args))))
 
 (defn- build-trigger
   [{:keys [cron group name repeat? interval]

    (.build builder)))

(defn- build-job-detail
  [f {:keys [group name state] :or {group "uxbox"} :as opts}]
  (let [name (or name (str (gensym "uxbox-job")))
        data (JobDataMap. {"callable" f "state" state})
        builder (doto (JobBuilder/newJob (if state PersistentJobImpl JobImpl))
                  (.storeDurably true)
                  (.usingJobData data)
                  (.withIdentity name group))]
    (.build builder)))

;; --- Public Api



(defn schedule!
  ([schd f] (schedule! schd f nil))
  ([schd f opts]
   (let [[f opts] (resolve-fn f opts)
         job (build-job-detail f opts)
         trigger (build-trigger opts)]
     (.scheduleJob ^Scheduler schd job trigger))))
