The activateAndRetrieve method will register the listener with the cache and retrieve the set of objects for which the particular derived class of CacheListener was created. By tying these operations together and synchronizing on the cache while the listener is added (and objects returned), we guarantee that we will properly receive events for the set of objects that we're interested in AFTER we have finished sending a set of objects associated with a GetRequest.
This is due to the fact that the GetRequestProcessor (which generally calls this method) is synchronized against itself while the objects that come back from this call are being sent back to the client. If events are generated by the cache while the GetRequestProcessor is still sending back the objects, their forwarding will be blocked until sending of the objects is complete.
No one said that a complex, multi-user web application would be simple ;-)
@return a set of objects from the cache.