Graphene Implementation 1.0.0.CR3

org.jboss.arquillian.ajocado.guard
Class RequestGuardInterceptor

java.lang.Object
  extended by org.jboss.arquillian.ajocado.guard.RequestGuardInterceptor
All Implemented Interfaces:
CommandInterceptor

public class RequestGuardInterceptor
extends Object
implements CommandInterceptor

The Guard which guards that request what was expected to be done will be actually done.

Version:
$Revision$
Author:
Lukas Fryc

Constructor Summary
RequestGuardInterceptor(RequestType requestExpected, boolean interlayed)
          Constructs the guard with predefined expected RequestType
 
Method Summary
 void doAfterCommand()
           Waits for changing the requestDone flag (or for timeout, when flag stay to be NONE).
 void doBeforeCommand()
          Install the PageExtensions (which is used to figure out, what requestType was actually done) and clear the request type to NONE state.
 void intercept(CommandContext ctx)
          Enfolds the command with guarding code to detect request type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestGuardInterceptor

public RequestGuardInterceptor(RequestType requestExpected,
                               boolean interlayed)
Constructs the guard with predefined expected RequestType

Parameters:
requestExpected - the RequestType which is expected to be done
interlayed - indicates whenever the request can be interlayed by another request
Method Detail

intercept

public void intercept(CommandContext ctx)
               throws CommandInterceptorException
Enfolds the command with guarding code to detect request type

Specified by:
intercept in interface CommandInterceptor
Throws:
CommandInterceptorException

doBeforeCommand

public void doBeforeCommand()
Install the PageExtensions (which is used to figure out, what requestType was actually done) and clear the request type to NONE state.


doAfterCommand

public void doAfterCommand()

Waits for changing the requestDone flag (or for timeout, when flag stay to be NONE).

Then figure out what requestType was actually done and compare to expected one.

Throws:
RequestGuardException - when done requestType doesn't equal to expected one

Graphene Implementation 1.0.0.CR3

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.