Server Handlers
Server handlers are useful extension points when users need custom code to be executed during different states of the server’s lifecycle. Several interfaces have been provided by WSO2 Carbon for this purpose. Following are the available server handlers in WSO2 Carbon.
Server Handler | Interface description | Methods | Method description |
---|---|---|---|
ServerStartupObserver | This interface contains methods that get invoked at server startup. | void completingServerStartup() | This method is invoked just before starting the transports. |
void completedServerStartup() | This method is invoked just after starting all the transports. | ||
ServerShutdownHandler | This interface can be implemented to perform any execution that needs to happen before server shutdown. | void invoke() | This method is invoked before server shutdown begins. |
ServerRestartHandler | This interface can be implemented to perform any execution that needs to happen before server restart. | void invoke() | This method is invoked before server restart begins. |