} else {
IPortletWindow portletWindow = portletWindowRegistry.getPortletWindow(request, portletWindowId);
IPortletDefinition portletDef = portletWindow.getPortletEntity().getPortletDefinition();
if (portletDef.getLifecycleState().equals(PortletLifecycleState.MAINTENANCE)) {
// Prevent the portlet from rendering; replace with a helpful "Out of Service" message
portletRenderExecutionWorker = this.portletWorkerFactory.createFailureWorker(request, response, portletWindowId, new MaintenanceModeException());
} else {
// Happy path
portletRenderExecutionWorker = this.portletWorkerFactory.createRenderWorker(request, response, portletWindowId);
}
}