Package org.apache.wiki.api.engine
Interface EngineLifecycleExtension
-
- All Known Implementing Classes:
MarkdownSetupEngineLifecycleExtension
public interface EngineLifecycleExtension
SPI used to notify JSPWiki extensions about
Engine
's initialization & shutdown, without having to deep dive onEngine
's internals.Examples of
EngineLifecycleExtension
's use cases:- Appending a plugin's classpath to
jspwiki.plugin.searchPath
, so it can be used as a drop-in, without further configuration. - Providing default parameters for a custom extension.
- Setting up that expensive singleton, or disposing resources, without having to use or register a
WikiEventListener
.
As a concrete example, the markdown module uses an
EngineLifecycleExtension
to set up all the required properties ifjspwiki.syntax=markdown
is provided on thejspwiki[-custom].properties file
.All methods are provided with a
default
, do-nothing implementation, so specific EngineLifecycleExtensions only have to provide implementations for the methods they're really interested in.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
onInit(java.util.Properties properties)
Called beforeEngine
initialization, after the wiki properties have been sought out.default void
onShutdown(Engine e, java.util.Properties properties)
Called beforeEngine
shutdown.default void
onStart(Engine e, java.util.Properties properties)
Called afterEngine
initialization.
-
-
-
Method Detail
-
onInit
default void onInit(java.util.Properties properties)
Called beforeEngine
initialization, after the wiki properties have been sought out.- Parameters:
properties
- wiki configuration properties.
-
onStart
default void onStart(Engine e, java.util.Properties properties)
Called afterEngine
initialization.- Parameters:
properties
- wiki configuration properties.e
- JSPWiki's ready to be usedEngine
.
-
onShutdown
default void onShutdown(Engine e, java.util.Properties properties)
Called beforeEngine
shutdown.- Parameters:
e
- JSPWiki's runningEngine
.properties
- wiki configuration properties.
-
-