WebuiRequestContext.setCurrentInstance(context);
try {
for (ApplicationLifecycle<RequestContext> lifecycle : getApplicationLifecycle()) {
lifecycle.onStartRequest(this, context);
}
StateManager sm = getStateManager();
UIApplication uiApp = sm.restoreUIRootComponent(context);
context.setUIApplication(uiApp);
javax.portlet.Event portletEvent = req.getEvent();
context.setAttribute(PORTLET_EVENT_VALUE, portletEvent.getValue());
Event<UIComponent> uiEvent = uiApp.createEvent(portletEvent.getName(), Phase.PROCESS, context);
uiEvent.broadcast();
// Store ui root
sm.storeUIRootComponent(context);
} finally {
WebuiRequestContext.setCurrentInstance(parentAppRequestContext);
}
}