jolokia

WebJar for jolokia

License

License

MIT
Categories

Categories

Jolokia Application Testing & Monitoring Monitoring
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

jolokia
Last Version

Last Version

1.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

jolokia
WebJar for jolokia
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/janjakubnanista/jolokia-js-client

Download jolokia

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/jolokia/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>jolokia</artifactId>
    <version>1.0.7</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/jolokia/
implementation 'org.webjars.bower:jolokia:1.0.7'
// https://jarcasting.com/artifacts/org.webjars.bower/jolokia/
implementation ("org.webjars.bower:jolokia:1.0.7")
'org.webjars.bower:jolokia:jar:1.0.7'
<dependency org="org.webjars.bower" name="jolokia" rev="1.0.7">
  <artifact name="jolokia" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='jolokia', version='1.0.7')
)
libraryDependencies += "org.webjars.bower" % "jolokia" % "1.0.7"
[org.webjars.bower/jolokia "1.0.7"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Jolokia JavaScript client

JavaScript client for Jolokia server for both Node.js and browser.

Build Status

To install via npm, please run

npm install jolokia

Or via bower

bower install jolokia

Important If you use this library in browser without using browserify or equivalent tool, please use dist/jolokia.js (or dist/jolokia.min.js) instead of main file declared in package.json.

Important If you use this library in browser, you need to include your own jQuery.

Usage

For jolokia documentation please check their offical website.

// In Node.js or using Browserify
var Jolokia = require('jolokia');

// In browser
var Jolokia = window.Jolokia;

// Or using RequireJs
require(['./path/to/jolokia'], function(Jolokia) {
   // code below
});

var jolokia = new Jolokia({
    url: '/jmx', // use full url when in Node.js environment
    method: 'post', // force specific HTTP method
});

jolokia.list().then(function(value) {
   // do something with list of JMX domains
}, function(error) {
   // handle error
});

API

new Jolokia(options)

Constructor.

options String|Object [optional] Instance configuration. If String, it will be used as endpoint URL. You can rewrite these default options when calling individual methods.

options.url String [optional] Endpoint URL. You have to provide an URL either to constructor or when calling any method.

options.method String [optional] Force HTTP method to use. Must be one of GET, POST (case-insensitive). If not specified, HTTP method will be guessed base on JMX request:

  • GET for single requests
  • POST for multiple requests or requests for multiple attributes

options.query Object [optional] URL query parameters to add to query. Especially useful to pass jolokia configuration options such as maxCollectionSize. Please see official documentation for list of supported values.

options.auth Object [optional] Hash containing username and password Strings used for Basic authentication.

Other options will be passed to either jQuery.ajax() (in browser) or request (in Node.js).

jolokia.request(request, options)

Perform arbitrary JMX request or requests.

request Object|Array Definition of JMX requests.

request.type String Type of JMX request. Can be one of read, write, exec, search and list.

request.mbean String JMX bean name (or name regex for search requests).

request.attribute String|Array Name of bean attribute, used for read and write requests.

request.value Object Value of bean attribute, used for write requests.

request.operation String Name of bean operation, used for exec requests.

request.arguments Array Arguments for operation, used for exec requests.

request.path String Path to append to url to access inner attributes of responses. See official documentation for more information on accessing inner paths.

Returns Promise resolved with JMX responses.

jolokia.get(mbean, attribute, options)

Sharthand method for creating read requests.

Returns Promise resolved with attribute value.

jolokia.set(mbean, attribute, value, options)

Sharthand method for creating write requests.

Returns Promise.

jolokia.list(options)

Sharthand method for creating list requests.

Returns Promise resolved with hash containing available JMX domains.

jolokia.search(mbean, options)

Sharthand method for creating search requests.

Returns Promise resolved with array of available JMX beans.

jolokia.version(options)

Sharthand method for creating version requests.

Returns Promise resolved with Jolokia agent version definition.

Versions

Version
1.0.7