Get a list of MBean information for Java applications

Scala 2.12

import java.lang.management.{ManagementFactory, PlatformManagedObject}

import javax.management.{MBeanInfo, ObjectName}

import scala.collection.JavaConverters._

val mbeanInterfaces: Seq[Class[_ <: PlatformManagedObject]] = ManagementFactory.getPlatformManagementInterfaces.asScala.toSeq
val mbeanObjects: Seq[_ <: PlatformManagedObject] = mbeanInterfaces.flatMap(ManagementFactory.getPlatformMXBeans(_).asScala.toSeq)
val mbeanObjectNames: Seq[ObjectName] = mbeanObjects.map(_.getObjectName)
val mbeanInfos: Seq[MBeanInfo] = mbeanObjectNames.map(ManagementFactory.getPlatformMBeanServer.getMBeanInfo(_))

Get information via MBeanServer (ManagementFactory.getPlatformMBeanServer) using MBeanInfo and ʻObjectName`.

Recommended Posts

Get a list of MBean information for Java applications
Get a list of S3 files with ListObjectsV2Request (AWS SDK for Java)
A list of rawValues for UITextContentType.
Sort a List of Java objects
List of download destinations for oracle java
A collection of simple questions for Java beginners
Get a list of Qiita articles for a specific user with Ruby + Qiita API v2
Get a list of classes in a Guava specific package
Output a list of cron settings for all users.
List of frequently used Java instructions (for beginners and beginners)
Get EXIF information in Java
[Java] Summary of for statements
Think of a Java update strategy
Java, JS (jQuery) and Ajax. Get a specific value of JSON.
Handle business logic for a set of Entity in Java class
[Details] Implementation of consumer applications with Kinesis Client Library for Java
List of members added in Java 9
Cast an array of Strings to a List of Integers in Java
Get the public URL of a private Flickr file in Java
A brief description of JAVA dependencies
Get stuck in a Java primer
Generics of Kotlin for Java developers
List of types added in Java 9
How to check for the contents of a java fixed-length string
List of alternative distributions for CentOS
List IT terms before implementing a business system (Java) for inexperienced people
[Java] [ibatis] How to get records of 1-to-N relationship with List <Map <>>
[Java] How to get to the front of a specific string using the String class
How to get the absolute path of a directory running in Java
Implementation of clone method for Java Record
Get the result of POST in Java
Name a group of regular expressions (Java)
[Java] Get List / Map elements with Iterator
[Java] Get the day of the specific day of the week
Get caller information from stack trace (java)
List of point cuts for making finer point cuts
[Java] Get tag information from music files
Features of spring framework for java developers
Ability to display a list of products
[Java] Contents of Collection interface and List interface
Get the path defined in Controller class of Spring boot as a list
A story about Java 11 support for Web services
Create a CSR with extended information in Java
A brief summary of Bootstrap features for beginners
Summary of Java environment settings for myself [mac]
Do you need a memory-aware implementation of Java?
Measure the size of a folder in Java
List of libraries useful for ios application development
[Java] Get the length of the surrogate pair string
Get block information with Hyperledger Iroha's Java SDK
[Java] Let's create a mod for Minecraft 1.14.4 [Introduction]
Create Scala Seq from Java, make Scala Seq a Java List
[Java] Let's create a mod for Minecraft 1.16.1 [Introduction]
[Note] Java: Speed of List processing by purpose
Library "OSHI" to get system information in Java
Pre-introduction notes for JavaScript experienced learners of Java
A quick review of Java learned in class
[Java] Get a random value from an array
[Java] Let's create a mod for Minecraft 1.14.4 [99. Mod output]
Build a development environment for Docker, java, vscode
[Java] How to get the authority of the folder