Chapter 6. Microcontainer

JBoss Enterprise Web Platform 5.0 uses JBoss Microcontainer to integrate enterprise services together with a Servlet/JSP container, EJB container, deployers and management utilities in order to provide a standard Java EE environment. If you need additional services then you can simply deploy these on top of Java EE to provide the functionality you need. Likewise any services that you do not need can be removed by changing the configuration.
JBoss Microcontainer is very lightweight and deals with POJOs. As with other lightweight containers, JBoss Microcontainer uses dependency injection to wire individual POJOs together to create services. Configuration is performed using either annotations or XML depending on where the information is best located. Unit testing is made extremely simple thanks to a helper class that extends JUnit to setup the test environment, allowing you to access POJOs and services from your test methods using just a few lines of code.

6.1. An overview of the Microcontainer modules

This section introduces the various Microcontainer modules. The figure below gives an overview of the modules.
  • Tools represents a variety of tools to assist users with use and development with JBoss Microcontainer.
  • Integr. represents the aop-mc-int module, which handles integration between the JBoss AOP and JBoss Microcontainer.
  • OSGi represents several integration classes that adapt the OSGi module for the Microcontainer.
  • Reliance represents two modules: Drools-int and jBPM-int. These modules define JBoss Rules dependencies.
  • Deployers load components from from various modules (such as POJOs, JMX, Spring, Java EE) into the Microcontainer at runtime.
  • CL represents the Classloader, a new peer classloader module that handles the OSGi bundle module.
  • VFS represents the Virtual File System. This is an abstract layer used to identify known file system issues within a single module.
  • Kernel defines the core kernel SPI, including bootstrap, configuration, POJO deployments, dependency, events, bean metadata and bean registry. It contains the following modules:
    • Dependency
    • Kernel
    • AOP-MC-int
    • Spring-int
    • Guice-int
  • Managed represents two modules: managed and metatype. These modules define the base objects that define the management view of a component.
  • MDR is the generic Metadata Repository. It handles scoped metadata lookups.
  • Reflect is the integration point for manipulating class information at runtime.