ModelProvider

interface ModelProvider

The binding index of one module: the aggregate models of its bounded context context, the handlers of its subscription processors (processors) and of its service routes (routes), and where its Manifest fragment is (fragment, META-INF/wow/manifest/<module>.json). The compiler generates one per module and registers it in META-INF/services/me.ahoo.wow.kernel.ModelProvider, so the host finds every module of the service with load, without scanning or reflecting.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val binding: Int

The binding the module was generated for: BINDING of the kernel its compiler was released with. load refuses a module of another binding, so a module built by another Wow version fails at startup, not with a NoSuchMethodError on its first command. A provider written by hand says BINDING.

Link copied to clipboard
abstract val context: String

The bounded context of the module's aggregates.

Link copied to clipboard
abstract val fragment: String

The class path resource of the module's Manifest fragment.

Functions

Link copied to clipboard
abstract fun models(dependencies: Dependencies): List<AggregateModel<*>>

The module's aggregate models, with their factories' parameters from dependencies; a MissingDependencyException when one is missing.

Link copied to clipboard
open fun processors(dependencies: Dependencies): List<ProcessorBinding<*>>

The handlers of the module's @Projection, @Reactor and @Saga processors, which subscribe to context: each processor constructed once, with its constructor's parameters from dependencies (qualified by their @Name); a MissingDependencyException when one is missing. None by default: the compiler overrides it for a module that declares processors.

Link copied to clipboard
open fun routes(dependencies: Dependencies): List<ServiceRouteHandler>

The handlers of the module's service routes (@ServiceRoute), each bound to the instance of its class that dependencies holds; a MissingDependencyException when it holds none. None by default: the compiler overrides it for a module that declares routes.