JBoss JMX Microkernel Bootstrap

We have discussed about the JBoss 4 Core JMX Microkernel in the previous post.

In this post, we will look into the sequence of steps involved during the Kernel startup.

We will have main method, which is the starting point of execution for the Java Application.

main method internally invoke multiple classes, methods, etc, based on the design and requirements.
Here we will map the generic steps involved in the execution of any program with the steps involved while starting the JBoss Microkernel.

Sequence-01
As shown in the above diagram, the purpose of the server is to start the Server. Before executing the business logic, the program has to check and validate the command line parameters. After validating the command line parameters, then all the initializations must take place. After the initialization, start of Core Services followed by start of Other Services.

We have seen the separate phases while starting the server. We will further drill down and look at the high level statements that gets executed at each phase of starting the server.

Steps-01
JBoss architecture has a feasibility of providing the Server Implementation class at runtime. The steps mentioned in the post are for the default server implementation.

The detailed log messages after the JMX Microkernel startup is as given below:
To differentiate the log information in different phases of startup, its been placed in different colors. We can also see the major milestones reached at each phase of the startup.
22:27:44,879 INFO  [Server] Starting JBoss (MX MicroKernel)…
22:27:44,879 INFO  [Server] Release ID: null null
22:27:44,895 DEBUG [Server] Using config: org.jboss.system.server.ServerConfigImpl@1457cb
22:27:44,895 DEBUG [Server] Server type: class org.jboss.system.server.ServerImpl
22:27:44,895 DEBUG [Server] Server loaded through: sun.misc.Launcher$AppClassLoader
22:27:44,895 INFO  [Server] Home Dir: D:\Lab-Env\Workspace
22:27:44,895 INFO  [Server] Home URL: file:/D:/Lab-Env/Workspace/
22:27:44,895 DEBUG [Server] Library URL: file:/D:/Lab-Env/Workspace/lib/
22:27:44,895 INFO  [Server] Patch URL: null

22:27:44,895 INFO  [Server] Server Name: default
22:27:44,895 INFO  [Server] Server Home Dir: D:\Lab-Env\Workspace\server\default
22:27:44,895 INFO  [Server] Server Home URL: file:/D:Lab-Env/Workspace/server/default/
22:27:44,895 INFO  [Server] Server Log Dir: D:\Workspace\server\default\log

22:27:44,895 DEBUG [Server] Server Data Dir: D:\Lab-Env\Workspace\server\default\data
22:27:44,895 INFO  [Server] Server Temp Dir: D:\Lab-Env\Workspace\server\default\tmp
22:27:44,895 DEBUG [Server] Server Config URL: file:/D:/Lab-Env/Workspace/server/default/conf/
22:27:44,895 DEBUG [Server] Server Library URL:
file:/D:/Lab-Env/Workspace/server/default/lib/
22:27:44,895 INFO  [Server] Root Deployment Filename: jboss-service.xml
22:27:44,895 DEBUG [Server] Starting General Purpose Architecture (GPA)…
22:27:44,973 DEBUG [Server] Created MBeanServer: org.jboss.mx.server.MBeanServerImpl@4a5ab2[ defaultDomain=’jboss’ ]
22:27:44,988 DEBUG [Server] Boot url list: [file:/D:/Lab-Env/Workspace/server/default/conf/]
22:27:44,988 DEBUG [Server] Creating loader for URL: file:/D:/Lab-Env/Workspace/server/default/conf/
22:27:44,988 DEBUG [RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@5483cd, cl=org.jboss.mx.loading.UnifiedClassLoader3@9931f5{ url=file:/D:/Lab-Env/Workspace/server/default/conf/ ,addedOrder=0}
22:27:44,988 DEBUG [RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@5483cd, cl=org.jboss.mx.loading.UnifiedClassLoader3@9931f5{ url=file:/D:/Lab-Env/Workspace/server/default/conf/ ,addedOrder=0}
22:27:44,988 DEBUG [UnifiedLoaderRepository3] Adding org.jboss.mx.loading.UnifiedClassLoader3@9931f5{ url=file:/D:/Lab-Env/Workspace/server/default/conf/ ,addedOrder=0}
22:27:45,035 DEBUG [Server] Failed to create xmbean for: org.jboss.system.server.ServerInfo
22:27:45,035 INFO  [ServerInfo] Java version: 1.6.0_37,Sun Microsystems Inc.
22:27:45,035 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 20.12-b01,Sun Microsystems Inc.
22:27:45,035 INFO  [ServerInfo] OS-System: Windows 7 6.1,x86
22:27:45,035 DEBUG [ServerInfo] Full System Properties Dump
22:27:45,035 DEBUG [ServerInfo]     java.runtime.name: Java(TM) SE Runtime Environment
22:27:45,035 DEBUG [ServerInfo]     jboss.server.base.dir: D:\Lab-Env\Workspace\server
22:27:45,035 DEBUG [ServerInfo]     java.protocol.handler.pkgs: org.jboss.net.protocol
22:27:45,035 DEBUG [ServerInfo]     sun.boot.library.path: C:\Program Files\Java\jre6\bin
22:27:45,035 DEBUG [ServerInfo]     jboss.server.lib.url: file:/D:/Lab-Env/Workspace/server/default/lib/
22:27:45,035 DEBUG [ServerInfo]     java.vm.version: 20.12-b01
22:27:45,035 DEBUG [ServerInfo]     javax.management.builder.initial: org.jboss.mx.server.MBeanServerBuilderImpl
22:27:45,035 DEBUG [ServerInfo]     java.vm.vendor: Sun Microsystems Inc.
22:27:45,035 DEBUG [ServerInfo]     java.vendor.url: http://java.sun.com/
22:27:45,035 DEBUG [ServerInfo]     path.separator: ;
22:27:45,035 DEBUG [ServerInfo]     java.vm.name: Java HotSpot(TM) Client VM
22:27:45,035 DEBUG [ServerInfo]     file.encoding.pkg: sun.io
22:27:45,035 DEBUG [ServerInfo]     user.country: US
22:27:45,035 DEBUG [ServerInfo]     sun.java.launcher: SUN_STANDARD
22:27:45,035 DEBUG [ServerInfo]     sun.os.patch.level: Service Pack 1
22:27:45,035 DEBUG [ServerInfo]     java.vm.specification.name: Java Virtual Machine Specification
22:27:45,035 DEBUG [ServerInfo]     user.dir: D:\Lab-Env\Workspace\MyJBoss
22:27:45,035 DEBUG [ServerInfo]     jboss.server.base.url: file:/D:/Lab-Env/Workspace/server/
22:27:45,035 DEBUG [ServerInfo]     java.runtime.version: 1.6.0_37-b06
22:27:45,035 DEBUG [ServerInfo]     java.awt.graphicsenv: sun.awt.Win32GraphicsEnvironment
22:27:45,035 DEBUG [ServerInfo]     java.endorsed.dirs: C:\Program Files\Java\jre6\lib\endorsed
22:27:45,035 DEBUG [ServerInfo]     os.arch: x86
22:27:45,035 DEBUG [ServerInfo]     java.io.tmpdir: C:\Users\pavan\AppData\Local\Temp\
22:27:45,035 DEBUG [ServerInfo]     line.separator:
22:27:45,035 DEBUG [ServerInfo]     jbossmx.loader.repository.class: org.jboss.mx.loading.UnifiedLoaderRepository3
22:27:45,035 DEBUG [ServerInfo]     java.vm.specification.vendor: Sun Microsystems Inc.
22:27:45,035 DEBUG [ServerInfo]     user.variant:
22:27:45,035 DEBUG [ServerInfo]     os.name: Windows 7
22:27:45,035 DEBUG [ServerInfo]     jboss.bind.address: 127.0.0.1
22:27:45,035 DEBUG [ServerInfo]     jboss.server.temp.dir: D:\Lab-Env\Workspace\server\default\tmp
22:27:45,035 DEBUG [ServerInfo]     jboss.home.dir: D:\Lab-Env\Workspace
22:27:45,035 DEBUG [ServerInfo]     sun.jnu.encoding: Cp1252
22:27:45,035 DEBUG [ServerInfo]     java.library.path: C:\Program Files\Java\jre6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Program Files\Windows Resource Kits\Tools\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\DW WLAN Card;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Intel\DMIX;C:\Program Files\Java\jdk1.6.0_20\bin;;;.
22:27:45,035 DEBUG [ServerInfo]     jboss.server.home.dir: D:\Lab-Env\Workspace\server\default
22:27:45,035 DEBUG [ServerInfo]     java.class.version: 50.0
22:27:45,035 DEBUG [ServerInfo]     java.specification.name: Java Platform API Specification
22:27:45,035 DEBUG [ServerInfo]     sun.management.compiler: HotSpot Client Compiler
22:27:45,035 DEBUG [ServerInfo]     jboss.server.config.url: file:/D:/Lab-Env/Workspace/server/default/conf/
22:27:45,035 DEBUG [ServerInfo]     os.version: 6.1
22:27:45,035 DEBUG [ServerInfo]     jboss.home.url: file:/D:/Lab-Env/Workspace/
22:27:45,035 DEBUG [ServerInfo]     user.home: C:\Users\pavan
22:27:45,035 DEBUG [ServerInfo]     user.timezone: Asia/Calcutta
22:27:45,035 DEBUG [ServerInfo]     java.awt.printerjob: sun.awt.windows.WPrinterJob
22:27:45,035 DEBUG [ServerInfo]     java.specification.version: 1.6
22:27:45,035 DEBUG [ServerInfo]     file.encoding: Cp1252
22:27:45,035 DEBUG [ServerInfo]     jboss.server.home.url: file:/D:/Lab-Env/Workspace/server/default/
22:27:45,035 DEBUG [ServerInfo]     jboss.server.log.dir: D:\Lab-Env\Workspace\server\default\log
22:27:45,035 DEBUG [ServerInfo]     user.name: pavan
22:27:45,035 DEBUG [ServerInfo]     java.class.path: D:\Lab-Env\My-Servers\JBoss\jars\jboss-jmx-4.2.3.GA.jar;
22:27:45,035 DEBUG [ServerInfo]     jboss.lib.url: file:/D:/Lab-Env/Workspace/lib/
22:27:45,035 DEBUG [ServerInfo]     jboss.server.name: default
22:27:45,035 DEBUG [ServerInfo]     java.vm.specification.version: 1.0
22:27:45,035 DEBUG [ServerInfo]     sun.arch.data.model: 32
22:27:45,035 DEBUG [ServerInfo]     java.home: C:\Program Files\Java\jre6
22:27:45,035 DEBUG [ServerInfo]     sun.java.command: org.jboss.Main
22:27:45,035 DEBUG [ServerInfo]     java.specification.vendor: Sun Microsystems Inc.
22:27:45,035 DEBUG [ServerInfo]     user.language: en
22:27:45,035 DEBUG [ServerInfo]     awt.toolkit: sun.awt.windows.WToolkit
22:27:45,035 DEBUG [ServerInfo]     java.vm.info: mixed mode, sharing
22:27:45,035 DEBUG [ServerInfo]     java.version: 1.6.0_37
22:27:45,035 DEBUG [ServerInfo]     java.ext.dirs: C:\Program Files\Java\jre6\lib\ext;C:\Windows\Sun\Java\lib\ext
22:27:45,035 DEBUG [ServerInfo]     jboss.server.data.dir: D:\Lab-Env\Workspace\server\default\data
22:27:45,035 DEBUG [ServerInfo]     sun.boot.class.path: C:\Program Files\Java\jre6\lib\resources.jar;C:\Program Files\Java\jre6\lib\rt.jar;C:\Program Files\Java\jre6\lib\sunrsasign.jar;C:\Program Files\Java\jre6\lib\jsse.jar;C:\Program Files\Java\jre6\lib\jce.jar;C:\Program Files\Java\jre6\lib\charsets.jar;C:\Program Files\Java\jre6\lib\modules\jdk.boot.jar;C:\Program Files\Java\jre6\classes
22:27:45,035 DEBUG [ServerInfo]     java.vendor: Sun Microsystems Inc.
22:27:45,035 DEBUG [ServerInfo]     file.separator: \
22:27:45,035 DEBUG [ServerInfo]     java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
22:27:45,035 DEBUG [ServerInfo]     sun.cpu.endian: little
22:27:45,035 DEBUG [ServerInfo]     sun.io.unicode.encoding: UnicodeLittle
22:27:45,035 DEBUG [ServerInfo]     java.rmi.server.hostname: 127.0.0.1
22:27:45,035 DEBUG [ServerInfo]     sun.desktop: windows
22:27:45,035 DEBUG [ServerInfo]     sun.cpu.isalist: pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
22:27:45,051 DEBUG [Server] Created system MBean: jboss.system:type=ServerInfo
22:27:45,051 DEBUG [Server] Failed to create xmbean for: org.jboss.system.ServiceController
22:27:45,066 DEBUG [ServiceController] Controller MBean online
22:27:45,066 DEBUG [Server] Created system MBean: jboss.system:service=ServiceController
22:27:45,113 DEBUG [Server] Created system XMBean: jboss.system:service=MainDeployer
22:27:45,113 DEBUG [ServiceController] Creating service jboss.system:service=MainDeployer
22:27:45,129 DEBUG [MainDeployer] Creating jboss.system:service=MainDeployer
22:27:45,129 DEBUG [MainDeployer] Created jboss.system:service=MainDeployer
22:27:45,129 DEBUG [ServiceController] Creating dependent components for: jboss.system:service=MainDeployer dependents are:
22:27:45,129 DEBUG [ServiceController] starting service jboss.system:service=MainDeployer
22:27:45,129 DEBUG [MainDeployer] Starting jboss.system:service=MainDeployer
22:27:45,129 DEBUG [MainDeployer] Started jboss.system:service=MainDeployer
22:27:45,129 DEBUG [ServiceController] Starting dependent components for: jboss.system:service=MainDeployer dependent components:
22:27:45,129 DEBUG [Server] Shutdown hook added
22:27:45,175 DEBUG [Server] Created system XMBean: jboss.system:service=JARDeployer
22:27:45,175 DEBUG [ServiceController] Creating service jboss.system:service=JARDeployer
22:27:45,175 DEBUG [JARDeployer] Creating jboss.system:service=JARDeployer
22:27:45,175 DEBUG [JARDeployer] Created jboss.system:service=JARDeployer
22:27:45,175 DEBUG [ServiceController] Creating dependent components for: jboss.system:service=JARDeployer dependents are:
22:27:45,175 DEBUG [ServiceController] starting service jboss.system:service=JARDeployer
22:27:45,175 DEBUG [JARDeployer] Starting jboss.system:service=JARDeployer
22:27:45,175 DEBUG [MainDeployer] Adding deployer: org.jboss.deployment.JARDeployer@191d8c1
22:27:45,175 DEBUG [SuffixOrderHelper] Static suffix exists; ignoring request for adding enhanced suffix: 700:.jar
22:27:45,175 DEBUG [JARDeployer] Started jboss.system:service=JARDeployer
22:27:45,175 DEBUG [ServiceController] Starting dependent components for: jboss.system:service=JARDeployer dependent components:
22:27:45,191 DEBUG [Server] Created system XMBean: jboss.system:service=ServiceDeployer
22:27:45,191 DEBUG [ServiceController] Creating service jboss.system:service=ServiceDeployer
22:27:45,191 DEBUG [SARDeployer] Creating jboss.system:service=ServiceDeployer
22:27:45,191 DEBUG [SARDeployer] Created jboss.system:service=ServiceDeployer
22:27:45,191 DEBUG [ServiceController] Creating dependent components for: jboss.system:service=ServiceDeployer dependents are:
22:27:45,191 DEBUG [ServiceController] starting service jboss.system:service=ServiceDeployer
22:27:45,191 DEBUG [SARDeployer] Starting jboss.system:service=ServiceDeployer
22:27:45,191 DEBUG [MainDeployer] Adding deployer: org.jboss.deployment.SARDeployer@c832d2
22:27:45,191 DEBUG [SARDeployer] Started jboss.system:service=ServiceDeployer
22:27:45,191 DEBUG [ServiceController] Starting dependent components for: jboss.system:service=ServiceDeployer dependent components:
22:27:45,191 INFO  [Server] Core system initialized
22:27:45,207 DEBUG [MainDeployer] Starting deployment of package: file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:45,207 DEBUG [MainDeployer] Starting deployment (init step) of package at: file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:45,254 DEBUG [MainDeployer] Copying file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml -> D:\Lab-Env\Workspace\server\default\tmp\deploy\tmp7400981593785702621jboss-service.xml

22:27:45,254 DEBUG [MainDeployer] using deployer org.jboss.deployment.SARDeployer@c832d2
22:27:45,254 DEBUG [SARDeployer] Found classpath element: [classpath: null]
22:27:45,254 DEBUG [SARDeployer] codebase URL is file:/D:/Lab-Env/Workspace/server/default/lib/
22:27:45,254 DEBUG [SARDeployer] listing codebase for archives matching *

22:27:45,270 DEBUG [SARDeployer] URLLister class is org.jboss.net.protocol.file.FileURLLister
22:27:45,270 DEBUG [SARDeployer] looking for nested deployments in : file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:46,175 DEBUG [MainDeployer] found 0 subpackages of file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:46,175 DEBUG [MainDeployer] Watching new file: file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:46,175 DEBUG [MainDeployer] create step for deployment file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:46,175 DEBUG [SARDeployer] Deploying SAR, create step: url file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:46,175 DEBUG [SARDeployer] Registering service UCL=jmx.loading:UCL=10e3293

22:27:46,175 DEBUG [ServiceCreator] About to create bean: default.Helloworld:service= HelloWorldService with code: HelloWorldService
22:27:46,175 DEBUG [ServiceCreator] Class loader is jmx.loading:UCL=10e3293
22:27:46,237 DEBUG [ServiceCreator] Created bean: default.Helloworld:service= HelloWorldService
22:27:46,237 DEBUG [ServiceController] Creating service default.Helloworld:service= HelloWorldService
22:27:46,237 DEBUG [HelloWorldService] Creating default.Helloworld:service= HelloWorldService
22:27:46,237 DEBUG [HelloWorldService] Created default.Helloworld:service= HelloWorldService
22:27:46,237 DEBUG [ServiceController] Creating dependent components for: default.Helloworld:service= HelloWorldService dependents are: 22:27:46,237 DEBUG [MainDeployer] Done with create step of deploying jboss-service.xml
22:27:46,237 DEBUG [MainDeployer] Begin deployment start file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:46,237 DEBUG [SARDeployer] Deploying SAR, start step: url file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:46,237 DEBUG [ServiceController] starting service default.Helloworld:service= HelloWorldService
22:27:46,237 DEBUG [HelloWorldService] Starting default.Helloworld:service= HelloWorldService
22:27:46,237 INFO  [HelloWorldService] Starting with message=Sorry no message today
22:27:46,237 DEBUG [HelloWorldService] Started default.Helloworld:service= HelloWorldService
22:27:46,237 DEBUG [ServiceController] Starting dependent components for: default.Helloworld:service= HelloWorldService dependent components: []
22:27:46,237 DEBUG [MainDeployer] End deployment start on package: jboss-service.xml
22:27:46,237 DEBUG [MainDeployer] Deployed package: file:/D:/Lab-Env/Workspace/server/default/conf/jboss-service.xml
22:27:46,237 INFO  [Server] JBoss (MX MicroKernel) [null] Started in 1s:342ms

 

In this post, we could see the high level steps executed during the startup and the corresponding information in the logs.

 

Related Posts:

JBoss Microkernel Introduction
Writing JBoss MBean Services

JBoss JMX Microkernel Overview

 

Jboss JMX MicroKernel Overview

Since we got to know the importance of the JMX Kernel in our previous posts lets look at the main components of the JMX Kernel. Also, look at just the JBoss Micro Kernel, with out any other modules/services.

Main Components

The microkernel has three main components:

  • Server
  • JBoss/JMX
  • System

Server-Component-Tasks

JBoss-JMX

System


Jboss MicroKernel Core

As we have seen in the earlier posts, JMX MicroKernel Core has a small memory footprint and it is a back bone for deployment & maintenance of Services.. This core component allows the user to integrate modules, containers, and plugins. Lets bisect the JBoss and see the Core Kernel and modules separately.

Lets look out for options to extract just the JMX MicroKernel Core from the JBoss and see how it works and behaves.

One simple way to do this done is to remove all the services from JBoss-Service.xml and files and directories from the deploy folder.

We can start Jboss server after making the above changes. This will finally be left with the MicroKernel Core. We can see the drastic change in the startup time of the server. One thing to note down in this approach is that there is no actual separation of Kernel from JBoss. It is the suppression of services at the startup. This isn’t exactly what we are looking for.

To really separate the Core and other modules, we have to look out for other options.

Other way of getting the Kernel is check out if only the Core Kernel component is available for download. I wasnt successful in getting only JMX MicroKernel for download.

Since JBoss is open source and source is available for download, i felt that it is an opportunity to check out if we can download the source and then separate the JMX Kernel code from the total source. To start with, i have downloaded the jboss-4.2.0.GA-src.zip. After extracting the source, the next step is figuring out the Core module from this.

JBoss Modular architecture, Source code availability and the Main Components discussed above has helped me in getting the Kernel Code in an easier way.

Extracted directory structure of the JBoss Source:

JBoss-Source

I have copied the System folder from the JBoss source.

Sliced-Source

1

MicroKernel-Source-Code

Further drill down of folder structure from the system folder is as shown below:

03-System


“deployment” folder structure is as shown below:
02-deployment

 

“Server” folder structure is as shown below:

03-Server

I tried compiling the JMX Kernel (system folder). To successfully compile the Core Kernel, there were some of the dependent jar files that needs to be in place.

After setting the classpath of the required files, i had successfully compiled the source and able to start the MicroKernel.

00:20:17,599 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 20.12-b01,Sun Microsystems Inc.
00:20:17,599 INFO [ServerInfo] OS-System: Windows 7 6.1,x86
00:20:18,254 INFO [Server] Core system initialized
00:20:20,406 INFO [Server] JBoss (MX MicroKernel) [null] Started in 4s:571ms

As shown in the log above, we are able to start the Jboss Kernel (which is separated from fully functional JBoss Server).

Source of the JBoss MicroKernel is available and we can play around with the code and trace the code line by line by using eclipse or netbeans editor.

We will look at the JBoss MicroKernel bootstrap in the next post.

Related Posts:

JBoss MicroKernel Introduction
Writing JBoss MBean Services

 

JBoss JMX MicroKernel

We will look into the JBoss 4.x Architecture in this post.
We have already discussed the importance of using Modular Architecture (Why Modularity) while designing the large projects. JBoss 4.x is also built on modular architecture. JBoss Server is composed of different modules, where all the modules work together to provide the total functionality of the Application Server.

Once we think of having modules providing the total functionality, few of the important things pops up.

  • How are these modules get loaded & unloaded
  • When these modules get loaded & unloaded
  • How these modules interact with one another
  • How the dependencies between them is maintained

JBoss server is completely implemented using JMX Modules. Jboss used JMX to enforce modularity in the design. Apart from being used as Management interface, JMX is being used as a framework to manage different modules.

JMX MBean services are the core building blocks of the JBoss Application Server. Using JMX based model help manage both JBoss/Server components and the applications deployed on it.

Each functionality of the Application server that is developed as JMX module is plugged into the JMX-based server spine. JMX Components implement every key feature of JEE specification. Whole application server is just a collection of JMX plugins to the central implementation of JMX Server. It thus becomes easy to assemble a JEE in a mix-and-match style by bringing together independent modules.

031313_0634_JBossJMXMic1.png
As shown in the diagram, JMX based MicroKernel is the Common spine for the JBoss Server. This core component allows the user to integrate modules, containers, and plugins. This MicroKernel is extremely small in foot print and this provides the foundation for the flexible deployment and Modular Architecture for JBoss. MicroKernel is only a framework, and its not a source of Actual functionality of the server.
MBean Modules in Jboss include:

  • Core/Boot System
  • UnifiedClassLoaders
  • Service Providers (jca, jms, jndi, security, etc.)
  • Subsystems (aop, ejb, web, ws, iiop, etc.)
  • Deployers (.sar, .jar, .ear, .war, .har, etc.)
  • Invokers (http, socket, iiop, etc.)
  • Management (JSR-77, jboss.managament.local)
  • Monitoring (standard JMX monitors)

JMX was chosen as the basis of the JBoss component model for the following reasons:

  • It provides a lightweight environment.
  • Components can be dynamically loaded and configured.
  • Implement or wrap and access everything as MBeans (which basically provides manageability and de-coupling).
  • It helps in implementation of the Microkernel architecture ( which provides a minimal kernel that serves as a software bus for extensions).
  • JBoss can be managed by JMX-compliant applications.

031313_0634_JBossJMXMic2.png

On top of JMX, JBoss introduces its own model for managing the modules. JBoss JMX MicroKernel extends and refines the JMX model to address some of the concepts beyond the scope of JMX, which includes Module lifecycle, dependency between modules, deployment and redeployment of modules, dynamic configuration, etc. Most of these services are also implemented as MBeans. They communicate with one another using the MicroKernel.

JMX offers standard interfaces to the management of its components as well as the applications deployed on it.

When JBoss server starts, one of the first steps being performed is the Creation of MBeanServer instance (javax.management.MBeanServer). JMX MBeanServer plays the role of JMX MicroKernel. All other modules/components are plugged into JBoss by registering with MBean Server. Since all the MBeans are registered with the MBeanServer, MBeanServer can control and configure the Modules (MBeans).

MBeanServer is the Registry & Factory for MBeans . Modules use the metadata and the operations available in the MBean interface which are exposed by MBeanServer for the interaction & configuration of the Mbean modules.

JBoss includes adaptors that allow access to the JMX MBeanServer from outside of the JBoss server VM.

All of the bundled functionality provided with the standard JBoss distribution is based on MBeans. The best way to add services to the JBoss server is to write your own JMX MBeans.

We will cover how to write our own Service/Module and hook it to the JBoss server in the coming post.