Configuration Model Listener Reference
Use model listeners in your own configurations to listen for events and execute code in response. Creating a model listener requires only three steps:
- Implement the
ConfigurationModelListener
interface - Register the listener with the
@Component
annotation:service = ConfigurationModelListener.class
- Add your custom logic for what happens when the listener is triggered
See an implementation of the listener in Liferay’s PasswordPoliciesConfigurationModelListener
.
Note these things:
- The configuration model listener will trigger and verify upon System, Instance, and Site Settings configuration changes
- The configuration model listener will trigger when the server is already started and the configuration file is deployed as the listener will be registered at that time
- The configuration model listener will NOT trigger for configuration files that are deployed to an instance before startup
See Creating a Model Listener to learn more about model listeners.