Interface FrontcacheModule


@Deprecated public interface FrontcacheModule
Deprecated.
since 2.13.0: implement FrontcachePlugin and ship a META-INF/frontcache-plugin.properties manifest. A module without one still runs, through an adapter, as a manage plugin - for one release.
A module that plugs into a node from its own jar - found with ServiceLoader through META-INF/services/org.frontcache.module.FrontcacheModule.

Never on the request path

Nothing here is called while a request is served: a module gets the node's lifecycle, management actions, and meters - nothing in FrontCacheEngine.init(), the cache or include processors, the guard or the resilience commands. A node with no module serves exactly what a node with one serves.

A module cannot stop a node

org.frontcache.plugin.host.FrontcachePlugins catches everything a module throws. A module that throws in start(ModuleContext) is logged and dropped until the next start; the node starts regardless.

One instance per process

A module is instantiated once, like FCConfig and the cache processor, and outlives an engine: the reload action calls stop(false) then start(...) on the same instance. The constructor must be cheap and side-effect free - it may run from a servlet's init, before any engine.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    bindMeters(Object meterRegistry)
    Deprecated.
    Registers this module's series on the metrics exporter's registry - an io.micrometer.core.instrument.MeterRegistry, typed Object so this interface carries no Micrometer type.
    id()
    Deprecated.
    A short, stable id - for logs and the modules list of get-node-stats.
    Deprecated.
    Management actions this module answers, by action name.
    default void
    Deprecated.
    The servlet or filter has told the node how it is deployed.
    void
    Deprecated.
    The engine has started: the cache processor exists, metrics export has not been started yet.
    void
    stop(boolean shutdown)
    Deprecated.
     
  • Method Details

    • id

      String id()
      Deprecated.
      A short, stable id - for logs and the modules list of get-node-stats.
    • start

      void start(ModuleContext context)
      Deprecated.
      The engine has started: the cache processor exists, metrics export has not been started yet.
    • stop

      void stop(boolean shutdown)
      Deprecated.
      Parameters:
      shutdown - true when the process is going away; false when reload is about to start a replacement engine - process-wide state should survive
    • onModeKnown

      default void onModeKnown(NodeMode mode)
      Deprecated.
      The servlet or filter has told the node how it is deployed. Not necessarily before start(ModuleContext): no servlet is load-on-startup, so whichever sees the first request builds the engine. Called again only if the mode changes.
    • managementActions

      default Map<String, ManagementAction> managementActions()
      Deprecated.
      Management actions this module answers, by action name. Consulted after the core's own actions and before the ping fallback, so a name the core owns can never be shadowed. The caller has already passed ApiKey.isAuthorized; whether it may also write is on the request.
    • bindMeters

      default void bindMeters(Object meterRegistry)
      Deprecated.
      Registers this module's series on the metrics exporter's registry - an io.micrometer.core.instrument.MeterRegistry, typed Object so this interface carries no Micrometer type. Called once per exporter, possibly before start(ModuleContext); meters must read state at scrape time rather than capture it now. Names are prefixed frontcache. by the registry.