Users can add their own listener implementing org.openl.rules.ruleservice.loader.DataSourceListener for additional control of data source modifications with the required behavior and register it in datasource.
How does one do that? Where is the new listener registered?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FYI, it is a listener that fires when services are updated in ruleservice. Use it when you want to nofify third application that service is updated.
If you want to fire a listener when database is changed but ruleservices are not updated (because deployments are ignored by configuration) then RuleServicePublisherListener is not fired.
Also, RuleServicePublisherListener fires only after service is updated if DB is changed. But DataSourceListener fires when DB is update but service can be not updated yet.
BTW, I don't recomend look at DataSourceListener because it is internal API and can be changed someday and you don't have an easy way to use it. But, If you can't use RuleServicePublisherListener you can wrap org.openl.rules.ruleservice.management.ServiceManagerImpl#onDeploymentAdded via Spring AOP.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the Web Services Usage and Customization Guide, Section 5.7, it states:
How does one do that? Where is the new listener registered?
Hi,
This document contains information for developers and this interface for listener is designed for implementing a new type of Production Repository.
What are you want to do?
Thanks, Marat Kamalov.
I want to send a notification to an external program when data is modified. A DataSourceListener seemed the obvious place to do that.
You can look at org.openl.rules.ruleservice.publish.RuleServicePublisherListener interface.
How to use: Just register a bean in Spring context that implements RuleServicePublisherListener interface,
FYI, it is a listener that fires when services are updated in ruleservice. Use it when you want to nofify third application that service is updated.
If you want to fire a listener when database is changed but ruleservices are not updated (because deployments are ignored by configuration) then RuleServicePublisherListener is not fired.
Also, RuleServicePublisherListener fires only after service is updated if DB is changed. But DataSourceListener fires when DB is update but service can be not updated yet.
BTW, I don't recomend look at DataSourceListener because it is internal API and can be changed someday and you don't have an easy way to use it. But, If you can't use RuleServicePublisherListener you can wrap org.openl.rules.ruleservice.management.ServiceManagerImpl#onDeploymentAdded via Spring AOP.