com.google.sitebricks.routing
Class SpiAction

java.lang.Object
  extended by com.google.sitebricks.routing.SpiAction
All Implemented Interfaces:
Action

public class SpiAction
extends Object
implements Action

An Action that is configured using the at().perform() scheme. See SitebricksModule for details.

Author:
dhanji@gmail.com (Dhanji R. Prasanna)

Constructor Summary
SpiAction(Action action, ActionDescriptor actionDescriptor)
           
 
Method Summary
 Object call(Request request, Object page, Map<String,String> map)
          Invoke this action!
 boolean shouldCall(Request request)
          Returns true if this action should be called on this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpiAction

public SpiAction(Action action,
                 ActionDescriptor actionDescriptor)
Method Detail

shouldCall

public boolean shouldCall(Request request)
Description copied from interface: Action
Returns true if this action should be called on this request. All dispatch rules have succeeded and this is a last-resort gate (for example, to handle special headers or gate IPs etc.).

Specified by:
shouldCall in interface Action

call

public Object call(Request request,
                   Object page,
                   Map<String,String> map)
Description copied from interface: Action
Invoke this action!

Specified by:
call in interface Action
page - The page object on which to call this action. Aka: the 'resource'.
map - A map of path variables (fragments) to their values.
Returns:
an instance of Reply, Redirect or null to trigger a 500 error.


Copyright © 2014. All rights reserved.