# Modules

A module is an application or component of an application that may be deployed into Zephyr. A module may be packaged as a JAR, a WAR or any other file-format for which there is a corresponding io.zephyr.kernel.extensions.ModuleAssemblyExtractor (opens new window)

There are several implementations of this class supporting:

  1. JAR Files (opens new window)
  2. WAR Files (opens new window)
  3. Spring Boot WARs (opens new window)

As you can see, adding support for new module formats is quite easy: simply implement your ModuleAssemblyExtractor and add a META-INF/services/io.zephyr.kernel.extensions.ModuleAssemblyExtractor file that refers to it per the Java Services API (opens new window)

These ModuleAssemblyExtractors must be installed as [Kernel Modules](##Kernel Modules)

# Some notes on Zephyr vs. the Java Services API + Java Module Framework

There is a good deal of overlap between Zephyr and combination of the Java Services API and the _ Java Module Framework_. So what's the difference?

# Topological Ordering

Zephyr computes a dependency graph over each set of modules that are installed. Contrary to many available plugin frameworks, dependency lifecycle ordering is implicitly encoded within this graph. We have found it very challenging, for instance, in OSGi to explicitly manage the dependency lifecycle across hundreds of bundles and thousands of services. Zephyr cleanly and elegantly solves for this.

# UI/UX Extensibility

Zephyr natively understands [Aire-UX] widgets, which allows us to dynamically add and remove functionality to a single-page web application

# Kernel Modules

The Zephyr Kernel is also extensible, but at a lower level than Zephyr modules. Kernel modules may also define extension-points, so the kernel is recursively extensible. The primary kernel extension points are:

  1. io.sunshower.kernel.core.ModuleScanner (opens new window)
  2. io.zephyr.kernel.extensions.EntryPoint (opens new window)
  3. java.nio.file.spi.FileSystemProvider (opens new window) ( Zephyr provides its own cluster-aware filesystem)
  4. io.zephyr.kernel.core.ModuleClasspathManagerProvider (opens new window)
  5. io.zephyr.kernel.core.ModuleAssemblyExtractor (discussed above)

The io.zephyr.kernel.extensions.EntryPoint is a good candidate for registering new functionality, including new extension-points for the kernel.