Jolokia Maven modules

This page describes available Maven artifacts and shows changes introduced in Jolokia 2.0

Jolokia 1.x modules

In Jolokia 1.x, there are two groups of Maven modules:

Agent modules

By Jolokia agent we mean an entity that exposes internal structure o the application (JMX) to outside world (HTTP clients). Assuming this analogy, the agent modules include (groupId is org.jolokia, artifactId is shown in the table):

Artifact ID Description

jolokia-core

Core agent functionality which is sufficient to run Jolokia agent with JMX access and JSON serialization

jolokia-jmx

Helper module that makes it easier to register MBean using Jolokia own JMX MBean Server

jolokia-jsr160

Agent module that adds JSR 160 request dispatcher which allows Jolokia to operate on MBeans registered in remote MBean Servers using JSR-160 JMX Remote protocol.

jolokia-jvm

A standalone Jolokia agent that can be configured using -javaagent JVM argument and uses JDK own HTTP server to expose JMX over HTTP

jolokia-spring

Spring agent that extends jolokia-jvm by adding Spring Framework integration (e.g., dedicated Spring XML namespace handler)

jolokia-osgi

OSGi agent that uses OSGi CMPN Http Service API to register Jolokia Agent Servlet within OSGi runtime

jolokia-osgi-bundle

OSGi agent which is packaged with Felix HTTP service

jolokia-war

WAR agent which is packaged as standard Web Application compliant with Servlet API 4

jolokia-war-unsecured

WAR agent without security enabled

Client modules

Client modules are used to connect to available Jolokia Agent over HTTP protocol:

Artifact ID Description

jolokia-client-java

Dedicated client based on Apache HTTP Client 4

jolokia-client-javascript

Maven module containing Javascript libraries

jolokia-jmx-adapter

Special reversed client library. It contains implementation of javax.management.remote.JMXConnectorProvider allowing to use standard JMX Remote API to access external Jolokia Agent. It can be used in tools like JConsole or Java Mission Control. It uses JMX URIs in the form of service:jmx:jolokia://<host>:<port>/jolokia/<path>.

jolokia-kubernetes

An implementation of javax.management.remote.JMXConnectorProvider handling JMX URIs in the form of service:jmx:kubernetes///<namespace>/http(s):<pod>:port/jolokia to access JMX Agents exposed inside accessible Kubernetes cluster. It uses Kubernetes Proxy URLs.

Jolokia 2.0 modules

Jolokia 2 is fully restructured to embrace modularization and pluggability. This makes the core library slimmer. However more libraries than just core are required to provide basic functionality.

Maven artifacts are also renamed. We follow a convention where artifact ID (which physically is all we get in the resulting file/jar name) fully identifies the contained functionality. That’s why for example we’ve renamed:

  • jolokia-core to jolokia-server-core

  • jolokia-jvm to jolokia-agent-jvm

  • jolokia-jsr160 to jolokia-service-jsr160

We have now 6 groups of modules:

JSON module

Single module which implements JSON parser/serializer, which replaces long-time used json-simple library.

Artifact ID Description

jolokia-json

More flexible (from Jolokia perspective) and faster implementation of json-simple.

Server modules

One module provides core Jolokia functionality:

Artifact ID Description

jolokia-server-core

It’s roughly the same as Jolokia 1 jolokia-core but without serializers, request dispatchers and additional services (like history or discovery)

Core Jolokia library is extended with pluggable services which are implemented in service modules and discovered using a method similar to java.util.ServiceLoader with additional features.

These services are declared in /META-INF/jolokia/<kind>[-default] files:

kind interface description

services

org.jolokia.server.core.service.api.JolokiaService

Generic Jolokia service which is looked-up using more specific interface and use in Jolokia core.

detectors

org.jolokia.server.core.detector.ServerDetector

A service used to find appserver specific MBeanServer instances

simplifiers

org.jolokia.service.serializer.json.simplifier.SimplifierExtractor

A service used by org.jolokia.service.serializer.json.ObjectToJsonConverter to convert specific Java objects to JSON representation (for example java.io.File is changed into JSON containing name, exists, length, …​ properties)

Service modules

Core Jolokia library discovers services in libraries available on CLASSPATH.

Artifact ID Description

jolokia-server-detector

S set of built-in services which can be used to detect extra, non-discoverable (see javax.management.MBeanServerFactory.findMBeanServer()) MBeanServer instances, specific to given application server

jolokia-service-discovery

Registers jolokia:type=Discovery MBean and starts UDP multicast listener to detect other Jolokia Agent processes

jolokia-service-history

Registers jolokia:type=Config MBean which is also a org.jolokia.server.core.service.request.RequestInterceptor service. This is used to keep a configurable history of agent invocations.

jolokia-service-jmx

Mandatory service that adds org.jolokia.service.jmx.LocalRequestHandler handler and set of commands. Without this service we wouldn’t even be able to access any MBean available within JVM.

jolokia-service-jsr160

A service that adds org.jolokia.service.jsr160.Jsr160RequestHandler that can be used to access remotely-available MBeans (using JSR-160 Remote JMX).

jolokia-service-notif-pull

A notification service using pulling method

jolokia-service-notif-sse

A notification service using Server-Sent Events

jolokia-service-serializer

Mandatory service that is used to convert Java objects into JSON representation.

Sometimes we want to select which detected services are actually enabled. We can configure which services to use with the help if these configuration options:

  • enabledServices - a comma-separated list of fully-qualified class names. If this configuration option is specified and is not empty, only the services from this list will be actually used.

  • disabledServices - a comma-separated list of fully-qualified class names. If this configuration option is specified and is not empty, all detected services (from /META-INF/jolokia/services(-default)) will be filtered to not include the disabled services.

This additional configuration (since 2.1.0) allows to use existing jolokia-agent-jvm-2.1.1-javaagent.jar with all services declared in /META-INF/jolokia/services-default and select what is actually needed in specific scenario.

NOTE

disabledServices option takes precedence (because the default behavior is to use all detected services). And we rather want to narrow down detected services, than pick up the ones we want.

Since Jolokia 2.1.0, server detectors (which help locating javax.management.MBeanServer instances in several application servers) can be disabled using disableDetectors option, because we may simply run Jolokia agent for standalone Java application.

Agent modules

Agent modules are used in various runtime environments to configure and start Jolokia Agent.

Artifact ID Description

jolokia-agent-jvm

A standalone Jolokia agent that can be configured using -javaagent JVM argument and uses JDK own HTTP server to expose JMX over HTTP

jolokia-agent-osgi

OSGi agent that uses OSGi CMPN Whiteboard Specification for Jakarta™ Servlet to register Jolokia Agent Servlet within OSGi runtime

jolokia-agent-war

WAR agent which is packaged as standard Web Application compliant with Servlet API 5+ (JakartaEE 9+)

jolokia-agent-war-unsecured

WAR agent without security enabled

Client modules

Client modules are used to connect to running Jolokia Agents.

Artifact ID Description

jolokia-client-java

dedicated client based on Apache HTTP Client 4

jolokia-client-javascript

Maven module containing Javascript libraries

jolokia-client-jmx-adapter

Special reversed client library. It contains implementation of javax.management.remote.JMXConnectorProvider allowing to use standard JMX Remote API to access external Jolokia Agent. It can be used in tools like JConsole or Java Mission Control. It uses JMX URIs in the form of service:jmx:jolokia://<host>:<port>/jolokia/<path>.

jolokia-client-kubernetes

An implementation of javax.management.remote.JMXConnectorProvider handling JMX URIs in the form of service:jmx:kubernetes///<namespace>/http(s):<pod>:port/jolokia to access JMX Agents exposed inside accessible Kubernetes cluster. It uses Kubernetes Proxy URLs.

Support modules

Supporting libraries for miscellaneous purposes.

Artifact ID Description

jolokia-support-jmx

Helper library that adds Jolokia-specific MBeanServer and utilities for easier MBean registration

jolokia-support-spring

Spring support library (Spring Boot, Spring Framework)