with-connection

clojure.contrib.jmx

  • (with-connection opts & body)
Execute body with JMX connection specified by opts. opts can also
include an optional :environment key which is passed as the
environment arg to JMXConnectorFactory/connect.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/jmx/client.clj:17 top

(defmacro with-connection
  "Execute body with JMX connection specified by opts. opts can also
   include an optional :environment key which is passed as the
   environment arg to JMXConnectorFactory/connect."
  [opts & body]
  `(let [opts# ~opts
         env# (get opts# :environment {})
         opts# (dissoc opts# :environment)]
     (with-open [connector# (javax.management.remote.JMXConnectorFactory/connect
                             (JMXServiceURL. (jmx-url opts#)) env#)]
       (binding [*connection* (.getMBeanServerConnection connector#)]
         ~@body))))
Vars in clojure.contrib.jmx/with-connection: with-connection defmacro apply binding concat dissoc get hash-map let list seq vector with-open
Used in 0 other vars

Comments top

No comments for with-connection. Log in to add a comment.