2.17.2: 2011-06-17

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

All Known Implementing Classes:
AbstractJspActionFactory, BeanActionFactory, DebugOnSaveActionFactory, DummyService, FixedButtonFactory, FixedMenuItemFactory, FixedTabFactory, IncludeContentTabFactory, MAPlotFactory, PermissionButtonFactory, PermissionMenuItemFactory, ProxyActionFactory

public interface ActionFactory<A extends Action>

An action factory is an object which knows how to create Action:s. Action factories are part of an extension (see Extension.getActionFactory()).

Action 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. 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. 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
 A[] getActions(InvokationContext<? super A> context)
          This method may be called one or several times for each request.
 boolean prepareContext(InvokationContext<? super A> context)
          This method is called once for each request/use of an extension and have two purposes: The factory should decide if the extension should be enabled or not.
 

Method Detail

prepareContext

boolean prepareContext(InvokationContext<? super A> context)
This method is called once for each request/use of an extension and have two purposes:

Parameters:
context - The current invokation context
Returns:
TRUE if the extension should be enabled, FALSE if the extension should be disabled

getActions

A[] getActions(InvokationContext<? super A> context)
This method may be called one or several times for each request. This is decided by the extension point. If, for example, the extension point is a pure single-item extension point then this method is probably only called once. If the extension point is a per-item extension point in a list context, then this method may be called once for every item in the list. The context parameter contains all information about the context of the extension point, including the current item, if any.

Parameters:
context - The current invokation context
Returns:
An array of actions that should be added to the extension point. Returns null or an empty array if there are no actions in the current context.

2.17.2: 2011-06-17