org.jboss.errai.security.client.local.nav
Class PageRoleLifecycleListener<W extends com.google.gwt.user.client.ui.IsWidget>
java.lang.Object
org.jboss.errai.security.client.local.nav.PageRoleLifecycleListener<W>
- All Implemented Interfaces:
- LifecycleListener<W>
public class PageRoleLifecycleListener<W extends com.google.gwt.user.client.ui.IsWidget>
- extends Object
- implements LifecycleListener<W>
Listens for page navigation events and redirects if the logged in user lacks
sufficient roles.
- Author:
- Max Barkley
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PageRoleLifecycleListener
public PageRoleLifecycleListener(String[] rolesRequiredByPage)
observeEvent
public void observeEvent(LifecycleEvent<W> event)
- Description copied from interface:
LifecycleListener
- This method is called when a
LifecycleEvent
is called such that
LifecycleListener.isObserveableEventType(Class)
returns true for this listener and
event.
If LifecycleEvent.veto()
is called in this method, any pending
listeners will be cancelled and callback of
LifecycleEvent#fireAsync(LifecycleCallback)
will be invoked with a
failure result.
- Specified by:
observeEvent
in interface LifecycleListener<W extends com.google.gwt.user.client.ui.IsWidget>
- Parameters:
event
- The event being observed.
isObserveableEventType
public boolean isObserveableEventType(Class<? extends LifecycleEvent<W>> eventType)
- Description copied from interface:
LifecycleListener
- Check if this listener observes this event type.
- Specified by:
isObserveableEventType
in interface LifecycleListener<W extends com.google.gwt.user.client.ui.IsWidget>
- Parameters:
eventType
- A type of subclass of LifecycleEvent
.
- Returns:
- True iff this listener observes this event type.
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.