PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
PortletResourceRequestContext requestContext = rcService.getPortletResourceRequestContext(this, request, response, portletWindow);
PortletResourceResponseContext responseContext = rcService.getPortletResourceResponseContext(this, request, response, portletWindow);
ResourceRequest portletRequest = envService.createResourceRequest(requestContext, responseContext);
ResourceResponse portletResponse = envService.createResourceResponse(responseContext, requestContext.getCacheability());
FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RESOURCE_PHASE);
try
{
invoker.serveResource(requestContext, portletRequest, portletResponse, filterManager);
// Mark portlet interaction is completed: backend implementation can flush response state now
responseContext.close();
}
finally
{
responseContext.release();
}
debugWithName("Portlet resource done for: " + portletWindow.getPortletDefinition().getPortletName());
}