InboundMessageType - type of in-bound messageOutboundMessageType - type of out-bound message@ThreadSafe public abstract class AbstractProfileAction<InboundMessageType,OutboundMessageType> extends AbstractConditionalProfileAction<InboundMessageType,OutboundMessageType> implements org.springframework.webflow.execution.Action, org.springframework.context.MessageSource, org.springframework.context.MessageSourceAware
This base class takes care of the following:
ProfileRequestContext from the current request environmentRequestContext into the profile context treeMetricContext in the treeAction implementations may override doExecute(RequestContext, ProfileRequestContext)
if they require SWF functionality, but most should override AbstractProfileAction.doExecute(ProfileRequestContext)
instead.
| Modifier and Type | Field and Description |
|---|---|
private Logger |
log
Class logger.
|
private org.springframework.context.MessageSource |
messageSource
MessageSource injected by Spring, typically the parent ApplicationContext itself.
|
private com.google.common.base.Function<org.springframework.webflow.execution.RequestContext,ProfileRequestContext> |
profileContextLookupStrategy
Strategy used to lookup the
ProfileRequestContext from a given WebFlow RequestContext. |
| Constructor and Description |
|---|
AbstractProfileAction()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.webflow.execution.Event |
doExecute(org.springframework.webflow.execution.RequestContext springRequestContext,
ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext)
Spring-aware actions can override this method to fully control the execution of an Action
by the Web Flow engine.
|
org.springframework.webflow.execution.Event |
execute(org.springframework.webflow.execution.RequestContext springRequestContext) |
String |
getMessage(org.springframework.context.MessageSourceResolvable resolvable,
Locale locale) |
String |
getMessage(String code,
Object[] args,
Locale locale) |
String |
getMessage(String code,
Object[] args,
String defaultMessage,
Locale locale) |
com.google.common.base.Function<org.springframework.webflow.execution.RequestContext,ProfileRequestContext> |
getProfileContextLookupStrategy()
Get the strategy used to lookup the
ProfileRequestContext from a given WebFlow RequestContext. |
protected org.springframework.webflow.execution.RequestContext |
getRequestContext(ProfileRequestContext profileRequestContext)
Gets the Spring
RequestContext from a SpringRequestContext stored in the context tree. |
protected org.springframework.webflow.execution.Event |
getResult(ProfileAction action,
ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext)
Examines the profile context for an event to return, or signals a successful outcome if
no
EventContext is located; the EventContext will be removed upon completion. |
void |
setMessageSource(org.springframework.context.MessageSource source) |
void |
setProfileContextLookupStrategy(com.google.common.base.Function<org.springframework.webflow.execution.RequestContext,ProfileRequestContext> strategy)
Set the strategy used to lookup the
ProfileRequestContext from a given WebFlow RequestContext. |
doPreExecute, getActivationCondition, setActivationConditiondoExecute, doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull private com.google.common.base.Function<org.springframework.webflow.execution.RequestContext,ProfileRequestContext> profileContextLookupStrategy
ProfileRequestContext from a given WebFlow RequestContext.@Nonnull private org.springframework.context.MessageSource messageSource
public AbstractProfileAction()
profileContextLookupStrategy to
WebflowRequestContextProfileRequestContextLookup.@Nonnull public com.google.common.base.Function<org.springframework.webflow.execution.RequestContext,ProfileRequestContext> getProfileContextLookupStrategy()
ProfileRequestContext from a given WebFlow RequestContext.public void setProfileContextLookupStrategy(@Nonnull com.google.common.base.Function<org.springframework.webflow.execution.RequestContext,ProfileRequestContext> strategy)
ProfileRequestContext from a given WebFlow RequestContext.strategy - lookup strategy@Nonnull public org.springframework.webflow.execution.Event execute(@Nonnull org.springframework.webflow.execution.RequestContext springRequestContext)
execute in interface org.springframework.webflow.execution.Action@Nonnull protected org.springframework.webflow.execution.Event doExecute(@Nonnull org.springframework.webflow.execution.RequestContext springRequestContext, @Nonnull ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext)
Alternatively they may override AbstractProfileAction.doExecute(ProfileRequestContext) and access
Spring information via a SpringRequestContext attached to the profile request context.
The default implementation attaches the Spring Web Flow request context to the profile
request context tree to "narrow" the execution signature to the basic OpenSAML ProfileAction
interface. After execution, an EventContext is sought, and used to return a result back to
the Web Flow engine. If no context exists, a "proceed" event is signaled.
springRequestContext - the Spring request contextprofileRequestContext - a profile request context@Nonnull protected org.springframework.webflow.execution.Event getResult(@Nonnull ProfileAction action, @Nonnull ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext)
EventContext is located; the EventContext will be removed upon completion.
The EventContext must contain a Spring Web Flow Event or a String.
Any other type of context data will be ignored.
action - the action signaling the eventprofileRequestContext - the profile request context to examinepublic void setMessageSource(org.springframework.context.MessageSource source)
setMessageSource in interface org.springframework.context.MessageSourceAwarepublic String getMessage(String code, Object[] args, String defaultMessage, Locale locale)
getMessage in interface org.springframework.context.MessageSourcepublic String getMessage(String code, Object[] args, Locale locale)
getMessage in interface org.springframework.context.MessageSourcepublic String getMessage(org.springframework.context.MessageSourceResolvable resolvable, Locale locale)
getMessage in interface org.springframework.context.MessageSource@Nullable protected org.springframework.webflow.execution.RequestContext getRequestContext(@Nonnull ProfileRequestContext profileRequestContext)
RequestContext from a SpringRequestContext stored in the context tree.profileRequestContext - Profile request context.Copyright © 1999–2020 Shibboleth Consortium. All rights reserved.