OSGi is one of the core technologies that Adobe Experience Manager (AEM) is built on. While it is certainly well-documented, a lot of developers have never taken the time to understand the ins and outs of what lies “under the hood” of OSGi for your AEM environment. You don’t have to be an expert in OSGi to be an expert AEM developer or systems engineer.
That said, there are times when it can be helpful to understand specific aspects of OSGi. I like to think of it as the difference between knowing how to change your own oil and knowing how to rebuild your own engine; having that deeper degree of understanding can be a powerful tool when things aren’t working how you would normally expect them to.
One of the common things you will come across as a developer is the need to understand the state of a bundle.
These states describe specific phases of the bundle as it progresses in AEM. Below are the six states that a bundle can have and their associated values. This information was pulled from the OSGi documentation page.
Name | Value | stateRaw | Description |
---|---|---|---|
UNINSTALLED | 0x01 | 1 | Only visible after a bundle is uninstalled; the bundle is in an unusable state but references to the bundle object may still be available and used for introspection. |
INSTALLED | 0x02 | 2 | Visible if the bundle’s code dependencies are not resolved. The Framework may attempt to resolve an INSTALLED bundle’s code dependencies and move the bundle to the RESOLVED state. |
RESOLVED | 0x04 | 4 | The Framework has successfully resolved the bundle’s code dependencies, but the bundle is not active. Dependencies include: the bundle’s classpath; the bundle’s package dependencies; the bundle’s required bundle dependencies; |
STARTING | 0x08 | 8 | The bundle’s start method is active. A bundle must be in this state when the bundle’s BundleActivator.start(BundleContext) is called. If the BundleActivator.start method completes without exception, then the bundle has successfully started and must move to the ACTIVE state. |
STOPPING | 0x10 | 16 | The bundle’s stop method is active. A bundle must be in this state when the bundle’s BundleActivator.stop(BundleContext) method is called. When the BundleActivator.stop method completes the bundle is stopped and must move to the RESOLVED state. |
ACTIVE | 0x20 | 32 | The bundle has been successfully started and activated. |
As you become more adept at building AEM environments, understanding OSGi as it relates to Adobe Experience Manager can help you differentiate your skills as an AEM developer. While you can certainly function with only a high-level understanding of OSGi, a deeper understanding will make you more valuable to your customers and co-workers, just like a friend who knows their way around cars will be your first call if you start having car trouble.
Rightpoint brings simplicity to the complexity of Adobe Experience Cloud implementations and complements it with outstanding experience design.
Utah Office:
132 S State St
Salt Lake City, UT 84111
Mailing Address:
50 W Broadway Ste 333
PMB 27084
Salt Lake City, Utah 84101-2027