ignore

Framework Configuration and Extension Points

When implementing Strecks, the aim has been to be as unobtrusive as possible in the RequestProcessor extension implementation. Most of the extension functionality is implemented by delegate classes, in each case represented by an interface. The delegate implementation classes can themselves be changed using entries in a strecks.properties, which should be placed on the application's classpath. If not present, then the application defaults are used.

An example of a delegate is ActionCreator, an interface which represents functionality for creating an Action instance when a Struts mapping is encountered for the first time in a request. ActionCreator has a single method:

public interface ActionCreator
{
	public Action createAction(Class actionClass) throws Exception;
}

The default implementation is org.strecks.controller.ActionCreatorImpl, which creates an action controller, and reads any action bean annotations, using these to configure the action controller.

To change the ActionCreator implementation class, you would need an entry in strecks.properties such as the following:

action.creator.impl=[fully qualified action creator implementation class name]

Extension Point Properties

In the following sections we discuss the individual extension points, and their roles.

org.strecks.builder.Builder

Property name builder.impl
Purpose The Builder is the object used to create and configure the other delegate classes
Default org.strecks.builder.PropertiesBuilder

org.strecks.controller.ActionCreator

Property name action.creator.impl
Purpose Responsible for instantiating controller actions, and for reading action bean annotations and using these to configure the controller action
Default org.strecks.controller.ActionCreatorImpl

org.strecks.controller.ControllerProcessorDelegate

Property name delegate.impl
Purpose Provides the entry point for the per-action execution. Called via a RequestProcessor.processActionPerform() extension method. Also responsible for calling the action interceptors.
Default org.strecks.controller.ControllerProcessorDelegateImpl

org.strecks.form.handler.FormWrapper

Property name form.wrapper.impl
Purpose Provides functionality for decorating Action forms so that they can be used for Streck's annotation-based validation and bind-handling functionality. Required to allow action forms to be annotation-enabled
Default org.strecks.form.handler.ValidateBindFormWrapper

org.strecks.form.handler.FormValidationHandler

Property name form.validation.handler.impl
Purpose Provides hooks for applying Streck's validation mechanisms to action forms.
Default org.strecks.form.handler.FormValidationHandlerImpl

org.strecks.form.handler.FormPopulateSource

Property name form.validation.handler.impl
Purpose Provides hooks for integrating Streck's action forms with Struts' form population mechanism.
Default org.strecks.form.handler.FormPopulateSourceImpl

In general, you probably won't need to change these implementation classes. The main exception is the form handler: using the org.strecks.form.handler.FormValidationHandlerImpl can be useful because it temporarily holds form validation errors in the session. These are removed at the start of the next request. This is useful for implementing the Redirect After Post pattern in your applications.

SourceForge.net logo java.net Member logo Copyright © 2005-2007 Realsolve Solutions