
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
JavaScript client for Jolokia server for both Node.js and browser.
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.
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
});
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 requestsPOST
for multiple requests or requests for multiple attributesoptions.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.
FAQs
Implementation of jolokia JMX client
We found that jolokia demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.