Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleOpenSAML ProfileAction interface
package org.opensaml.profile.action;

public interface ProfileAction<InboundMessageType,OutboundMessageType> extends InitializableComponent {

	public void execute(@Nonnull final ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext)
            throws ProfileException;
} 

...

Code Block
languagejava
titleImplementing a Spring Web Flow Action
protected Event doExecute(@Nonnull final RequestContext springRequestContext,
	@Nonnull final ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext)
		throws ProfileException;

An alternative approach that is more consistent with the rest of the action beans that don't involve Spring is to override the ProfileAction method shown in the Spring-Independent example above. As in that case, results are signaled by adding an EventContext to the context tree. Access to Spring is via a SpringRequestContext object available as a child of the context tree.

...

The examples shown use the "prototype" scope to allow the beans to be stateful, such that each invocation of the action will involve a unique bean instance. This is the norm. The default scope can be used for stateless action beans, but declaring it as a prototype means it can eventually acquire state without having to worry about how it's been declared. Using non-prototype beans is a source of potentially serious concurrency bugs so it is strongly discouraged and we may implement bean processors to enforce this at some point.