public interface RendererFactory<A extends Action>
Renderer
objects. An extension point may provide a default factory
(ExtensionPoint.getRendererFactory()
). If allowed by the
extension point an extension may provide it's own factory
implementation (Extension.getRendererFactory()
.
Renderer factory implementations must be thread-safe, since a single instance of the factory may have to serve multiple requests at the same time.
Note 1! A single factory instance may be used by more than one extension/extension point. This is at the control of the client application.
Note 2! The BASE web-client uses the XmlLoader
to
define extensions. The XmlLoader
always create a
separate factory instance for each extension/extension point.
The XmlLoader
also requires that the factories has
a public no-argument constructor.
Modifier and Type | Method and Description |
---|---|
Renderer<? super A> |
getRenderer(InvokationContext<? extends A> context)
Get a renderer for a given context.
|
void |
prepareContext(InvokationContext<? extends A> context)
This method is called once for each request/use of an
extension and should be used by a factory to initialise the context
with resources that the actions may need.
|
void prepareContext(InvokationContext<? extends A> context)
JspContext
.
Note! This method has no return value as opposed to
ActionFactory.prepareContext(InvokationContext)
. The
simple reason is that once we get to the point of rendering it
is already known that the extension is enabled.
context
- The current invokation contextRenderer<? super A> getRenderer(InvokationContext<? extends A> context)
context
- The current invokation context