 
 
 (defn make-event-handler
+  "Make a preflex.instrument.EventHandler instance from given options:
+  :before    (fn [])
+  :on-return (fn [] [result])
+  :on-throw  (fn [thrown])
+  :after     (fn [])"
   [{:keys [before
            on-return
            on-throw



(defn make-wrapper
  "Given an instrumenting caller f (arity-2 fn that accepts context and no-arg fn as args), return a Wrapper instance."
  [f]
  (reify Wrapper
    (run  [_ context task]         (f context #(.run  task)))



(defn make-event-handler-factory
  "Given (fn [event]) -> EventHandler, create and return a preflex.instrument.EventHandlerFactory object."
  [f]
  (reify EventHandlerFactory
    (createHandler [_ event] (f event))))


(defmacro wrap-proxy
  "Given an instrumenting caller (fn [context (fn task [])), a target object and proxy class/interfaces and
  constructor args, return an instrumented proxy."
  [f object class-and-interfaces args {:keys [method-pred]
                                       :or {method-pred i/public-method?}
                                       :as options}]
