Class FrontcachePlugins
java.lang.Object
org.frontcache.plugin.host.FrontcachePlugins
The node's plugins - found once per process, started and stopped with the engine.
Finding them
Every "META-INF/frontcache-plugin.properties" on the core's class path names a plugin's entry class; the class is instantiated through its no-argument constructor. A pre-2.13FrontcacheModule found through its
META-INF/services file and carrying no manifest is run through LegacyModulePlugin as a
manage plugin, with a deprecation WARN. A manifest that is refused, a class that cannot be loaded, a
duplicate id, an unsupported plugin-api major or a kind this node does not offer: logged, reported in
get-node-stats, and the node starts without that plugin.
A plugin that fails is a plugin that is absent
Every call into a plugin is wrapped. One that throws instart is dropped until the next start; one that
contributes something of a kind it did not declare (an event listener without observe, an endpoint without
serve, a management action without manage) is refused and stopped. Nothing here may stop a node
from serving. A started plugin's endpoint answers /fc-x/<id>/ through PluginEndpoints.
A plugin's config
A manifest'sconfig names conf/<file>, which no other plugin and no core file may be. It is read,
parsed and resolved here (PluginConfigs) and handed to FrontcachePlugin.configure(Config) before every
start; a refusal there is a plugin that does not start. reloadConfig(String) re-reads it for a running plugin
(which keeps its old config when the new one is refused, and has its event listeners read again when it accepts
it) and starts one that failed on its config.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbindMeters(Object meterRegistry) Lets every loaded plugin register its meters - seeFrontcachePlugin.bindMeters(Object).static StringconfigFile(String id) Theconf/file a loaded plugin's manifest names - never composed from a caller's input - or null when there is no such plugin, it was refused, or it has no config.ids()The ids of the started plugins, in load order -get-node-stats'modules.The ids of every plugin found, for the metrics exporter's per-plugin series.static org.frontcache.plugin.ManagementActionmanagementAction(String name) The management action a started plugin answers undername, or null.Every plugin action's description, by name - for thehelpaction.The management action names the started plugins answer.static voidmodeKnown(org.frontcache.plugin.NodeMode deployedAs) Called byFrontCacheServlet/FrontCacheFilteras they start - possibly before the engine, so it reaches every loaded plugin rather than only the started ones.reloadConfig(String id) reload-plugin-config: re-reads a plugin'sconf/<config>.static voidStarts every plugin; called by the engine on each start,reloadincluded.static List<PluginStats> stats()Every plugin found, started or not -get-node-stats'plugins.static PluginStatsOne plugin's stats by id, read at scrape time; null when there is none.static voidstop(boolean shutdown) validateConfig(String id, String content) Whether a config the caller wants to write would be accepted: it parses, resolves, and the plugin'sFrontcachePlugin.validateConfig(Config)accepts it.
-
Method Details
-
start
Starts every plugin; called by the engine on each start,reloadincluded.- Parameters:
publicDomain-FrontCacheEngine.getPublicDomain(), null when unsetguardRules- the engine's current guard rules, for the guard summary
-
reloadConfig
reload-plugin-config: re-reads a plugin'sconf/<config>. A running plugin is configured with it - and keeps the config it had when it refuses the new one; a plugin whose last start failed on its config is started with it. EmitsConfigReloaded.- Returns:
- the outcome; never null
-
validateConfig
Whether a config the caller wants to write would be accepted: it parses, resolves, and the plugin'sFrontcachePlugin.validateConfig(Config)accepts it. Touches nothing the plugin runs on.- Returns:
- every reason it would be refused; empty when it would not
-
configFile
-
stop
public static void stop(boolean shutdown) - Parameters:
shutdown- seeFrontcachePlugin.stop(boolean)
-
modeKnown
public static void modeKnown(org.frontcache.plugin.NodeMode deployedAs) Called byFrontCacheServlet/FrontCacheFilteras they start - possibly before the engine, so it reaches every loaded plugin rather than only the started ones. -
managementAction
The management action a started plugin answers undername, or null. -
managementActionDescriptions
-
managementActionNames
-
bindMeters
Lets every loaded plugin register its meters - seeFrontcachePlugin.bindMeters(Object). Loaded rather than started: the exporter may be built before the engine, and meters read their state at scrape time anyway. -
ids
-
stats
Every plugin found, started or not -get-node-stats'plugins. -
loadedIds
-
stats
One plugin's stats by id, read at scrape time; null when there is none.
-