org.apache.wicket.request
Class RequestHandlerStack

java.lang.Object
  extended by org.apache.wicket.request.RequestHandlerStack

public abstract class RequestHandlerStack
extends Object

Manages stack of executions of IRequestHandlers.

Author:
Matej Knopp, igor.vaynberg

Nested Class Summary
static class RequestHandlerStack.ReplaceHandlerException
          Exception to stop current request handler and execute a new one.
 
Constructor Summary
RequestHandlerStack()
           
 
Method Summary
 void detach()
          Detaches all request handlers
protected abstract  void detach(IRequestHandler handler)
          Allows the request handler to detach
 void execute(IRequestHandler handler)
           
 IRequestHandler getActive()
           
 IRequestHandler next()
           
 void replaceAll(IRequestHandler handler)
          Replaces all request handlers on the stack with the specified one and executes it.
 IRequestHandler resolveHandler(RuntimeException exception)
          Certain exceptions can carry a request handler they wish to be executed, this method tries to resolve such a handler given an exception.
protected abstract  void respond(IRequestHandler handler)
          Allows the request handler to respond to the request
 void schedule(IRequestHandler handler)
          Schedules the handler after the current one
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestHandlerStack

public RequestHandlerStack()
Method Detail

getActive

public IRequestHandler getActive()
Returns:
active handler

execute

public void execute(IRequestHandler handler)
Parameters:
handler -

resolveHandler

public final IRequestHandler resolveHandler(RuntimeException exception)
Certain exceptions can carry a request handler they wish to be executed, this method tries to resolve such a handler given an exception.

Parameters:
exception -
Returns:
request handler or null} if one cannot be resolved

respond

protected abstract void respond(IRequestHandler handler)
Allows the request handler to respond to the request

Parameters:
handler -

schedule

public void schedule(IRequestHandler handler)
Schedules the handler after the current one

Parameters:
handler -

next

public IRequestHandler next()
Returns:
scheduled request handler after the current one

replaceAll

public void replaceAll(IRequestHandler handler)
Replaces all request handlers on the stack with the specified one and executes it. If there are any request handlers currently executing (this method is called from inside IRequestHandler.respond(IRequestCycle)) the execution is interrupted via an exception.

Parameters:
handler -

detach

public void detach()
Detaches all request handlers


detach

protected abstract void detach(IRequestHandler handler)
Allows the request handler to detach

Parameters:
handler -


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.