2.17.2: 2011-06-17

net.sf.basedb.util.extensions
Interface RendererFactory<A extends Action>

All Known Implementing Classes:
AbstractJspRendererFactory, CompactButtonRendererFactory, ToolbarButtonRendererFactory

public interface RendererFactory<A extends Action>

A renderer factory is a factory that can create 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.

Version:
2.7
Author:
nicklas
Last modified
$Date:2008-03-20 12:15:25 +0100 (Thu, 20 Mar 2008) $

Method Summary
 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.
 

Method Detail

prepareContext

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. With the BASE web-client this means that it is possible to add scripts or stylesheets that is needed by the extension. See 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.

Parameters:
context - The current invokation context

getRenderer

Renderer<? super A> getRenderer(InvokationContext<? extends A> context)
Get a renderer for a given context. This method may create a new instance or use an existing instance. If an existing instance is used, it must be thread-safe, since multiple threads may use the same renderer.

Parameters:
context - The current invokation context
Returns:
A renderer instance

2.17.2: 2011-06-17