PortletInvokerInterceptor next = previous;
do {
PortletInvoker invoker = previous.getNext();
if (invoker instanceof EventPayloadInterceptor) {
// create a new WSRPEventPayloadInterceptor and make its next one the current event payload invoker
WSRPEventPayloadInterceptor eventPayloadInterceptor = new WSRPEventPayloadInterceptor();
eventPayloadInterceptor.setNext(invoker);
// replace the current event payload interceptor by the WSRP-specific one
previous.setNext(eventPayloadInterceptor);
// we're done