Hi there, we are using javax.jcr.observation.EventListener to check if every created page has a property, and if it does, do something, This is set with an absolute path to /content/my-site. (we are targeting the jcr:content nodes)
Has anyone used this before, and are there any performance impacts that we should be aware of?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
If you are targetting the "jcr:content" node of pages, you can refine the registration for the observation listener and express, that you are only interested in changes on nodes of nodetype "cq:pageContent".
That's a very good way to reduce the overhead, because your code is only invoked in this special case.
Using Sling's ResourceChangeListener is less effective in this special case, because it cannot be limited by the nodetype. And that's a very effective measure to reduce the number of invocations.
Hi,
You can also use Sling Resource Listener which provide high level API.
https://github.com/arunpatidar02/aem63app-repo/blob/master/java/SampleResourceChangeListener.java
Hi,
If you are targetting the "jcr:content" node of pages, you can refine the registration for the observation listener and express, that you are only interested in changes on nodes of nodetype "cq:pageContent".
That's a very good way to reduce the overhead, because your code is only invoked in this special case.
Using Sling's ResourceChangeListener is less effective in this special case, because it cannot be limited by the nodetype. And that's a very effective measure to reduce the number of invocations.