Performing Processing at Startup and ShutdownThe UnboundID Server SDK provides a number of mechanisms for performing custom processing when the server is starting up and/or shutting down. This section describes the differences between those mechanisms and the contexts in which they should be used. Extension Initialization and Finalization
Whenever an extension is prepared for use in the server, then a method is invoked
in that extension to allow it to perform any appropriate initialization (e.g.,
parsing arguments provided to the extension). If an extension is already defined
and enabled in the server configuration, then this initialization will occur
during server startup. Otherwise, it will be invoked whenever a new instance of
the extension is added to the server configuration (if that extension is enabled
at the time it is added), or when an existing disabled extension is updated so
that it is enabled. If you need to perform processing whenever an extension is
initialized, regardless of whether that initialization is performed at startup or
after the server is already running, then the extension's
Similarly, each type of extension also provides a method that will be invoked
whenever that extension will be taken out of service (e.g., to close any files or
free up any other resources it might have been using). If an extension is
disabled while the server is still running, then this finalization will occur at
that time. Otherwise, it will be invoked as part of the server shutdown
processing. If you need to perform processing whenever an extension is taken out
of service, whether at shutdown or while the server is still running, then the
extension's Startup and Shutdown Plugins
If you want to have a certain set of processing performed only at the time that
the server is started rather than any time that an extension is initialized, then
you should use a startup plugin (i.e., create a Java-based or scripted plugin that
implements the
Note that if you include code in the
By default, startup plugins will be invoked very late in the startup process,
after nearly all other server components have been initialized but before the
server has begun accepting client connections. This helps ensure that any other
components the plugin might need to reference will be available for use. However,
if it is necessary for that to occur earlier in the startup process, then that can
be accomplished by implementing the
Similarly, plugins can implement a
If a plugin implements both the Server Shutdown Listeners
If you want to have a non-plugin extension perform some kind of processing only
when the server is shutting down, then you can have that extension implement the
Note that if an extension is registered as a shutdown listener, then both the
|