|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectledge.web.mvc.builders.BuilderExecutorValve
public class BuilderExecutorValve
Pipeline component for executing MVC view building.
The BuilderExecutorValve starts with a view name selected by the configured
view request parameter (WebConfigurator.getViewToken()).
This parameter has to be defined and if not an
UndefinedViewParameterException is thrown.
At the same time the view name must point to either an existing
Builder class or an existing template.
If none of these exists a MissingViewException
is thrown.
If either the template or a builder has been found, the view building starts.
For a given view name either a builder class or a template may be found using the defaulting strategy. This is useful for instance for applications having a set of different templates for presenting the same data. But be warned - defaulting may cause a lot of trouble and You should be aware of it.
If the builder is found it is given the possiblity to route the processing to another builder. This is a rarely used functionality and has been introduced for similarity with older web application frameworks. Routing changes the currently selected view name and forces a new builder and template lookup.
Having the either a builder or a template or both at the same time the build method of the
builder is executed (missing builders and templates are replaced with
DefaultBuilder and
DefaultTemplate objects).
Building creates a String represenation of view contents. The only exception is
in case of a Builder which creates a direct response and writes it's content directly to the
response (via HttpContext), in such case view processing is stopped.
Having the build results for a view, an enclosing view is looked up. The choice of the enclosing view is made upon:
EnclosingView object given by the current
builder,ViewEnclosureTool,ViewFallbackSequence.A detailed diagram of the enclosing view choice algorithm follows:
| Field Summary | |
|---|---|
protected MVCClassFinder |
classFinder
Finder for builder objects. |
protected Builder |
defaultBuilder
the default builder. |
protected Template |
defaultTemplate
the default template. |
protected int |
maxEnclosures
maximum number of builder enclosures. |
protected int |
maxRouteCalls
maximum number of route calls per builder. |
protected SecurityHelper |
securityHelper
SecurityHelper for access checking. |
protected MVCTemplateFinder |
templateFinder
Finder for template objects. |
protected ViewEnclosureManager |
viewEnclosureManager
ViewEnclosureManager for access template based view enclosures. |
| Constructor Summary | |
|---|---|
BuilderExecutorValve(Context context,
MVCClassFinder classFinder,
MVCTemplateFinder templateFinder,
SecurityHelper securityHelper,
ViewEnclosureManager viewEnclosureManager,
int maxRouteCalls,
int maxEnclosures)
Component constructor. |
|
| Method Summary | |
|---|---|
void |
process(Context context)
Run view building starting from a view builder chosen in request parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected MVCClassFinder classFinder
protected MVCTemplateFinder templateFinder
protected SecurityHelper securityHelper
protected ViewEnclosureManager viewEnclosureManager
protected int maxRouteCalls
protected int maxEnclosures
protected Builder defaultBuilder
protected Template defaultTemplate
| Constructor Detail |
|---|
public BuilderExecutorValve(Context context,
MVCClassFinder classFinder,
MVCTemplateFinder templateFinder,
SecurityHelper securityHelper,
ViewEnclosureManager viewEnclosureManager,
int maxRouteCalls,
int maxEnclosures)
context - used application contextclassFinder - finder for builder objectstemplateFinder - finder for template objectssecurityHelper - security helper for access checkingviewEnclosureManager - the template based enclosure managermaxRouteCalls - maxmimal number of Builder.route(String) calls per BuildermaxEnclosures - maxmimal number of Builder enclosures
(also Builder.getEnclosingView(String) calls)| Method Detail |
|---|
public void process(Context context)
throws ProcessingException
process in interface Valvecontext - the thread's processing context.
ProcessingException - if the processing fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||