A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://clojure.github.io/java.jmx/index.html below:

clojure.java.jmx - java.jmx 1.1.0-SNAPSHOT API documentation

API for clojure.java.jmx -

Full namespace name:

clojure.java.jmx Overview
JMX support for Clojure

Usage
  (require '[clojure.java.jmx :as jmx])

What beans do I have?

  (jmx/mbean-names "*:*")
  -> #<HashSet [java.lang:type=MemoryPool,name=CMS Old Gen,
                java.lang:type=Memory, ...]

What attributes does a bean have?

  (jmx/attribute-names "java.lang:type=Memory")
  -> (:Verbose :ObjectPendingFinalizationCount
      :HeapMemoryUsage :NonHeapMemoryUsage)

What is the value of an attribute?

  (jmx/read "java.lang:type=Memory" :ObjectPendingFinalizationCount)
  -> 0
  (jmx/read "java.lang:type=Memory" [:HeapMemoryUsage :NonHeapMemoryUsage])
  ->
  {:NonHeapMemoryUsage
    {:used 16674024, :max 138412032, :init 24317952, :committed 24317952},
   :HeapMemoryUsage
    {:used 18619064, :max 85393408, :init 0, :committed 83230720}}

Can't I just have *all* the attributes in a Clojure map?

  (jmx/mbean "java.lang:type=Memory")
  -> {:NonHeapMemoryUsage
       {:used 16674024, :max 138412032, :init 24317952, :committed 24317952},
      :HeapMemoryUsage
       {:used 18619064, :max 85393408, :init 0, :committed 83230720},
      :ObjectPendingFinalizationCount 0,
      :Verbose false}

Can I find and invoke an operation?

  (jmx/operation-names "java.lang:type=Memory")
  -> (:gc)
  (jmx/invoke "java.lang:type=Memory" :gc)
  -> nil

What about some other process? Just run *any* of the above code
inside a with-connection:

  (jmx/with-connection {:host "localhost", :port 3000}
    (jmx/mbean "java.lang:type=Memory"))
  -> {:ObjectPendingFinalizationCount 0,
      :HeapMemoryUsage ... etc.}

Can I serve my own beans?  Sure, just drop a Clojure ref
into an instance of clojure.java.jmx.Bean, and the bean
will expose read-only attributes for every key/value pair
in the ref:

  (jmx/register-mbean
     (create-bean
     (ref {:string-attribute "a-string"}))
     "my.namespace:name=Value")

Protocols
DestractProtocol

Known implementations:

clojure.lang.Associative, java.lang.Boolean, javax.management.openmbean.CompositeData, javax.management.openmbean.TabularData, nil, Object
objects->datafunction
Usage: (objects->data _)
Convert JMX object model into data. Handles CompositeData, TabularData, maps, and atoms.
Source Types 

Beantype

Fields:

[state-ref]

Protocols:

Interfaces:

javax.management.DynamicMBean
Public Variables and Functions
->Beanfunction
Usage: (->Bean state-ref)
Positional factory function for class clojure.java.jmx.Bean.
Source

attribute-namesfunction
Usage: (attribute-names n)
All attribute names available on an MBean.
Source

create-beanfunction
Usage: (create-bean state-ref)
Expose a reference as a JMX bean. state-ref should be a Clojure
reference (ref, atom, agent) containing a map.

Using an agent for the state-ref is not recommended when the bean may
be modified with the setAttribute(s) methods. The setAttribute(s) methods
will block on the agent to complete all submitted actions (via await).
Source

invokefunction
Usage: (invoke n op & args)
Invoke an operation an an MBean. See also: invoke-signature
Source

invoke-signaturefunction
Usage: (invoke-signature n op signature & args)
Invoke an operation an an MBean. You must also supply
the signature of the operation. This is useful in cases
where the operation is overloaded. Otherwise you should
use the 'invoke' operation which will determine the
signature for you.

The signature parameter is a sequence of strings that
describes the method parameter types in order.
Source

mbeanfunction
Usage: (mbean n)
Like clojure.core/bean, but for JMX beans. Returns a read-only map of
a JMX bean's attributes. If an attribute it not supported, value is
set to the exception thrown.
Source

mbean-namesfunction
Usage: (mbean-names n)
Finds all MBeans matching a name on the current *connection*.
Source

operation-namesfunction
Usage: (operation-names n)
All operation names available on an MBean.
Source

readvar

Read one or more mbean properties.
Source

readable?function
Usage: (readable? n attr)
Is attribute readable?
Source

register-mbeanfunction
Usage: (register-mbean mbean mbean-name)
Register an mbean with the current *connection*.
Source

unregister-mbeanfunction
Usage: (unregister-mbean mbean-name)
Unregister mbean named mbean-name with the current *connection*.
Source

with-connectionmacro
Usage: (with-connection opts & body)
Execute body with a JMX connection created based on opts. opts can include [default]:

:protocol    The protocol to use [rmi:///jndi/rmi]
:host        The host to connect to [localhost]
:port        The port to connect to [3000]
:jndi-path   The jndi-path to use [jmxuri]
:url         The full url (as a String) to use instead of generating a rmi url from
             the above options [nil]
:environment A map representing the environment used for the connection.
             See JMXConnectorFactory/connect for details [{}]
Source

write!function
Usage: (write! n attr value)
Write an attribute value.
Source


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4