You can use get on Properties. Use .foo for method calls. Use literal vec syntax, not list. Use or for conditional branches instead of (if foo foo ...).

Untested:

(defn obtain-local-connection [vmid]
  (let [vm (VirtualMachine/attach vmid)
        props (.getSystemProperties vm)
        acquire-connector (fn [] (get (.getAgentProperties vm)
"com.sun.management.jmxremote.localConnectorAddress"))]
    (or (acquire-connector)
        (do
          (.loadAgent vm
            (apply str
                   (interpose java.io.File/separator
[(get props "java.home") "lib" "management-agent.jar"])))
          (acquire-connector))))

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to