Skip to content

Instantly share code, notes, and snippets.

@ivos
Last active May 2, 2020 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivos/92bda51c2f5ae857169065900f8e24c9 to your computer and use it in GitHub Desktop.
Save ivos/92bda51c2f5ae857169065900f8e24c9 to your computer and use it in GitHub Desktop.
(ns backend.support.java-melody
(:import (net.bull.javamelody MonitoringProxy)
(net.bull.javamelody.internal.model Counter)))
(defn- call-method
[klass method-name params obj & args]
(-> klass
(.getDeclaredMethod (name method-name)
(into-array Class params))
(doto (.setAccessible true))
(.invoke obj (into-array Object args))))
(def ^Counter ejb-counter
(let [ejb-counter (call-method MonitoringProxy "getEjbCounter" [] nil)]
(doto ejb-counter
(.setDisplayed true)
(.setUsed true))
ejb-counter))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment