Can ejb interceptors change the return value of a method before the calling class gets it?

Viewed 3426

If we have code in the field that has a method that another product calls, and gets a list of objects back. And we need to make changes to the code to make it more flexible in populating the list to return, can we in the interim create an interceptor for the customer, that intercepts the method before it returns the list, and remove items from the list before the product that calls the method gets the list.

e.g.

OurCode.search() returns a list of foundObjects

Other product calls OurCode.search, receives 100 items

Can we create an interceptor that intercepts before OurCode.search returns, and alter the List of foundObjects, removing unnecessary items? This would only be a temporary fix until a future release

1 Answers
Related