Errai 3.0.1-SNAPSHOT

org.jboss.errai.security.client.local.nav
Class PageRoleLifecycleListener<W extends com.google.gwt.user.client.ui.IsWidget>

java.lang.Object
  extended by 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

Constructor Summary
PageRoleLifecycleListener(String[] rolesRequiredByPage)
           
 
Method Summary
 boolean isObserveableEventType(Class<? extends LifecycleEvent<W>> eventType)
          Check if this listener observes this event type.
 void observeEvent(LifecycleEvent<W> event)
          This method is called when a LifecycleEvent is called such that LifecycleListener.isObserveableEventType(Class) returns true for this listener and event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageRoleLifecycleListener

public PageRoleLifecycleListener(String[] rolesRequiredByPage)
Method Detail

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.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.