Think 2021: The premier hybrid cloud and AI event, May 11-12 Register now

OSGi demystified article series

Open Services Gateway initiative, or OSGi, is a Java framework for developing and deploying modular software programs and libraries. OSGi provides a very powerful and useful model — but great power can come with complexity. At CICS Java HQ, we think OSGi is a great choice for many reasons, but we’ve had to learn its quirks along with its capabilities. For example, there are some clashes of concepts between OSGi and CICS that can catch you out — bundles being a big one — and some capabilities, such as class loading, have hidden depths. This series of articles brings you a whole stack of tips that we’ve learned in using OSGi with CICS. We explore some key concepts and capabilities, share best practices, point out some pitfalls, and provide sample code to help you to try some of them out.

Part 1: Bundles of fun


Learn about:

  • OSGi bundles
  • OSGi services
  • OSGi application and architectural guidance
  • JRE class visibility, bootdelegation, and system.packages.extra

Part 2: Unraveling Java and OSGi class loader problems


Learn about:

  • Java and OSGi class loader problems that you might encounter in CICS OSGi and Liberty JVM servers
  • The differences between NoClassDefFoundError the ClassNotFoundException
  • How to achieve stricter OSGi compliance
  • Boot compatibility and how it works within CICS TS V5.3+

Part 3: Avoiding dynamic class loading


Learn about:

  • What dynamic class loading is
  • Issues to anticipate
  • OSGi services and declarative services
  • Workarounds for exploiting OSGi services effectively

Part 4: Don’t bungle your bundles


Learn about:

  • Using common OSGi bundles
  • Properties files and OSGi
  • Converting to OSGi bundles vs. using Bundle-ClassPath
  • Avoiding Require-Bundle
  • Splitting packages
  • Understanding your execution environment
  • Avoiding circular dependencies

Part 5: Using declarative services


Learn about:

  • Service Component Runtime
  • Component lifecycle
  • Implementing an OSGi service
  • Declarative services
  • Reference attributes
  • Dynamically binding services
  • Dynamically updating applications without outage using OSGi’s declarative services
  • Interface definition
  • Writing the CICS application
  • Deploying version 1.0.0 of the application
  • CICS TSQ storage service
  • Upgrading with zero downtime