Blog

  • 2024
  • 2023
  • 2022
  • 2021
  • 2020
  • 2019
  • 2018
  • 2017
  • 2016
  • 2015
  • 2014
  • 2013
  • 2012




When I first started to learn about JBoss Modules and JBoss Extensions, I looked for Version 7.1 of the JBoss Application Server and began to read Extending JBoss AS 7. Unfortunately I had only a short glance at the adviced prerequisite Admin Guide and therefore missed the invaluable information about basic concepts. The Version 7.2 of Extending JBoss AS 7 makes the relevant parts more clear.

Nonetheless the information about getting started with writing JBoss Extensions is scattered so this little guided tour might help those who feel somewhat lost (as I have felt in some parts of my journey).

Overview over the Tour

Since modules are the foundation of JBoss Extensions, this tour will first introduce you to documentation that deals with JBoss Modules. The second section will then concentrate on the extension concepts and will guide you towards the central document for all extension programmers.

 

JBoss provides documentation for each minor version of the Application Server. This can sometimes be confusing. Especially with the transclusion mechanism, where the same content can be read within a large document and on its own. But once you managed to recognize these two concepts, it is not that difficult to find the relevant documents. Besides the nagging thought that one misses information, if not referring to the latest documentation, but to the documentation of the product version currently in use.

The following list of resources points to that of versions 7.2.

JBoss Modules

The modules concept is quiet easy to grasp. There is a certain directory layout with a given number of artifacts (module.xml, JARs, index files) in it. There are means to reference modules from dynamic deployables (META-INF or deployment descriptor). Some class loading knowledge comes handy in case of trouble shootings. That's it.

Here is the list of recommended readings:

  1. JBoss Modules - provides information about modules, but unfortunately the information given is not complete. The best covered part is Module descriptors.
  2. Define dependencies, two options:
    1. As part of META-INF/Manifest.mf as shown in Manifest module information.
    2. With a WEB-INF/jboss-deployment-structure.xml as shown in Class Loading in AS7 documentation.
  3. JBoss Modules Maven Plugin - helper to create the module structure for a Maven project. Note that we are the authors of this plugin, so we may be biased concerning the usefulness of the tool ;.).

JBoss Extensions

Dealing with extensions is just a bit more complicated. The basic concept is indeed not that difficult. But if you plan to actually write an extensions, going into details might not be that obvious at first. Therefore we recommend the following readings:

  1. Extending AS7 - provides an overview over the basic concepts ofextensions/subsystems and deployments. It discusses when to use which approach or when to combine the two. It also provides information about patching and the differences patching modules or non-modules (like XML files or deployables).
  2. General configuration concepts - provides more information on extensions and subsystems. It also provides information about the concepts of profiles and logical resources like paths, interfaces, socket bindings and system properties.
  3. Management resources - provides information about the concepts address, operation, and attribute. The mapping of the configuration (e.g. standalone.xml to the runtime model is done by constructing and executing operations. Therefore this information is very relevant. The document also discusses the differences to JMX. You may want to not follow references to the basic Java types of DMR, since they are covered in the next step.
  4. Detyped management and the jboss-dmr library - provides an overview of the JBoss Dynamic Model Representation (DMR)
    1. ModelNode
    2. ModelValue
      1. ListModelValue
      2. PropertyModelValue
      3. ObjectModelValue
    3. ModelType
    Understanding these basic building blocks is the basis for the construction and desconstruction of operations and parameters
  5. The native management API - provides information about the construction of operations in Java.
  6. Extending JBoss AS 7 - provides information about writing extensions for JBoss AS 7. I find it easier to first get the concepts and then get my hands dirty. Therefore I recommend this sequence:
    1. Key Interfaces and Classes Relevant to Extension Developers
    2. Example subsystem

The last document shows quite detailed how to develop an extension. The next step would be to learn how JBoss extensions have been implemented JBoss developers. Download and have a look at the source code of JBoss AS 7! Expect to find a couple of different approaches for implementing extensions.

Here are two projects we developed that may also serve as examples. But keep in mind: We just started with JBoss 7 and these topics. ;-)

  1. smartics-exceptions-bom (SVN)
  2. smartics-properties-jboss-extension (SVN)

Both projects use our JBoss Modules Maven Plugin for integration into a JBoss AS 7.

Summary

This has been a short tour through the documentation on JBoss Modules and Extensions. It lists the relevant documents to get an easy start into these technologies.


Link

Link

Posts