@SuppressWarnings("unchecked")
public void processEvent(SystemEvent event) throws AbortProcessingException
{
if (event instanceof PostConstructViewMapEvent)
{
PostConstructViewMapEvent viewMapEvent = (PostConstructViewMapEvent) event;
UIViewRoot viewRoot = (UIViewRoot) viewMapEvent.getComponent();
viewRoot.getViewMap().put(ViewScope.VIEW_SCOPE_CALLBACKS,new HashMap<String, Runnable>());
} else if (event instanceof PreDestroyViewMapEvent)
{
PreDestroyViewMapEvent viewMapEvent = (PreDestroyViewMapEvent) event;
UIViewRoot viewRoot = (UIViewRoot) viewMapEvent.getComponent();
Map<String, Runnable> callbacks = (Map<String, Runnable>) viewRoot.getViewMap().get(ViewScope.VIEW_SCOPE_CALLBACKS);
if (callbacks != null)
{
for (Runnable c : callbacks.values())
{