我真的不明白bean
函數在bean上的使用方式。這裏該代碼會拋出異常:如何在clojure中使用bean函數
(import java.lang.management.ManagementFactory) (def runtime (bean (ManagementFactory/getRuntimeMXBean)) (:name runtime) ;; => Class clojure.core$bean$fn__5177$fn__5178 can not access a member of class sun.management.RuntimeImpl with modifiers "public" [Thrown class java.lang.IllegalAccessException]
但類確實有一個叫getName()
方法。 http://docs.oracle.com/javase/6/docs/api/java/lang/management/RuntimeMXBean.html
BTW - https://github.com/clojure/java.jmx – noahlz
我寫了這個包裝改進系統分析https://github.com/zcaudate/sigmund – zcaudate