Skip to content

Commit 65438d2

Browse files
committed
Add support for custom JMX Protocols.
Patch for JMX-18 by Daniel Estevez
1 parent fd9db4b commit 65438d2

File tree

1 file changed

+3
-2
lines changed
  • src/main/clojure/clojure/java

1 file changed

+3
-2
lines changed

src/main/clojure/clojure/java/jmx.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595
"Build a JMX URL from options."
9696
([] (jmx-url {}))
9797
([overrides]
98-
(let [opts (merge {:host "localhost", :port "3000", :jndi-path "jmxrmi"} overrides)]
99-
(format "service:jmx:rmi:///jndi/rmi://%s:%s/%s" (opts :host) (opts :port) (opts :jndi-path)))))
98+
(let [opts (merge {:protocol "rmi:///jndi/rmi", :host "localhost", :port "3000", :jndi-path "jmxrmi"} overrides)]
99+
(format "service:jmx:%s://%s:%s/%s" (opts :protocol) (opts :host) (opts :port) (opts :jndi-path)))))
100100

101101
(defprotocol CoercionImpl
102102
(as-object-name [_]))
@@ -187,6 +187,7 @@
187187
(defmacro with-connection
188188
"Execute body with a JMX connection created based on opts. opts can include [default]:
189189
190+
:protocol The protocol to use [rmi:///jndi/rmi]
190191
:host The host to connect to [localhost]
191192
:port The port to connect to [3000]
192193
:jndi-path The jndi-path to use [jmxuri]

0 commit comments

Comments
 (0)