Package org.apache.wicket.cdi
Class ConversationPropagator
- java.lang.Object
-
- org.apache.wicket.cdi.ConversationPropagator
-
- All Implemented Interfaces:
IRequestCycleListener
public class ConversationPropagator extends Object implements IRequestCycleListener
A request cycle listener that takes care of propagating persistent conversations.- Author:
- igor
- See Also:
ConversationScoped
-
-
Constructor Summary
Constructors Constructor Description ConversationPropagator(Application application, IConversationPropagation propagation)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
activateForHandler(IRequestHandler handler)
Determines whether or not a conversation should be activated fro the specified handler.static String
getConversationIdFromPage(Page page)
protected PageParameters
getPageParameters(IRequestHandler handler)
Resolves page parameters from a request handlerIConversationPropagation
getPropagation()
static void
markPageWithConversationId(IRequestHandler handler, String cid)
void
onDetach(RequestCycle cycle)
Called after the request cycle has been detachedvoid
onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler)
Called after anIRequestHandler
has been executed.void
onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler)
Called when anIRequestHandler
is resolved and will be executed.void
onUrlMapped(RequestCycle cycle, IRequestHandler handler, Url url)
Called after a Url is generated for aIRequestHandler
.static void
removeConversationIdFromPage(Page page)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.request.cycle.IRequestCycleListener
onBeginRequest, onEndRequest, onException, onExceptionRequestHandlerResolved, onRequestHandlerScheduled
-
-
-
-
Field Detail
-
CID
public static final String CID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConversationPropagator
public ConversationPropagator(Application application, IConversationPropagation propagation)
Constructor- Parameters:
application
-propagation
-
-
-
Method Detail
-
getPropagation
public IConversationPropagation getPropagation()
-
onRequestHandlerResolved
public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler)
Description copied from interface:IRequestCycleListener
Called when anIRequestHandler
is resolved and will be executed.- Specified by:
onRequestHandlerResolved
in interfaceIRequestCycleListener
-
onRequestHandlerExecuted
public void onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler)
Description copied from interface:IRequestCycleListener
Called after anIRequestHandler
has been executed. If the execution resulted in an exception this method will not be called for that particularIRequestHandler
.- Specified by:
onRequestHandlerExecuted
in interfaceIRequestCycleListener
-
onUrlMapped
public void onUrlMapped(RequestCycle cycle, IRequestHandler handler, Url url)
Description copied from interface:IRequestCycleListener
Called after a Url is generated for aIRequestHandler
. This method can be used to modify generated urls, for example query parameters can be added.- Specified by:
onUrlMapped
in interfaceIRequestCycleListener
-
onDetach
public void onDetach(RequestCycle cycle)
Description copied from interface:IRequestCycleListener
Called after the request cycle has been detached- Specified by:
onDetach
in interfaceIRequestCycleListener
-
activateForHandler
protected boolean activateForHandler(IRequestHandler handler)
Determines whether or not a conversation should be activated fro the specified handler. This method is used to filter out conversation activation for utility handlers such as theBufferedResponseRequestHandler
- Parameters:
handler
-- Returns:
true
iff a conversation should be activated
-
markPageWithConversationId
public static void markPageWithConversationId(IRequestHandler handler, String cid)
-
getConversationIdFromPage
public static String getConversationIdFromPage(Page page)
-
removeConversationIdFromPage
public static void removeConversationIdFromPage(Page page)
-
getPageParameters
protected PageParameters getPageParameters(IRequestHandler handler)
Resolves page parameters from a request handler- Parameters:
handler
-- Returns:
- page parameters or
null
if none
-
-