HK2 is a modular dependency injection framework that can be used to build modular server-side Java applications like GlassFish. It provides services, dependency injection, and configuration capabilities. HK2 abstracts away dependencies on specific module systems like OSGi and allows a service-based architecture. Oracle plans to integrate HK2 into WebLogic Server to converge the GlassFish and WLS architectures and enable a shared set of modular capabilities.