public interface ToolFactory<V>
Implement this interface to manage lifecycle and factory for tools initialized and destroyed with Moqui Framework. Implementations must have a public no parameter constructor.
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
destroy() Called on destroy/shutdown of Moqui to destroy (shutdown, close, etc) the underlying tool. |
|
public V |
getInstance(java.lang.Object parameters) Called by ExecutionContextFactory.getTool() to get an instance object for this tool. |
|
public java.lang.String |
getName() Return a name that the factory will be available under through the ExecutionContextFactory.getToolFactory() method and instances will be available under through the ExecutionContextFactory.getTool() method. |
|
public void |
init(ExecutionContextFactory ecf) Initialize the underlying tool and if the instance is a singleton also the instance. |
|
public void |
postFacadeDestroy() Rarely used, like destroy() but runs after the facades are destroyed. |
|
public void |
preFacadeInit(ExecutionContextFactory ecf) Rarely used, initialize before Moqui Facades are initialized; useful for tools that ResourceReference, ScriptRunner, TemplateRenderer, ServiceRunner, etc implementations depend on. |
Called on destroy/shutdown of Moqui to destroy (shutdown, close, etc) the underlying tool.
Called by ExecutionContextFactory.getTool() to get an instance object for this tool. May be created for each call or a singleton.
Return a name that the factory will be available under through the ExecutionContextFactory.getToolFactory() method and instances will be available under through the ExecutionContextFactory.getTool() method.
Initialize the underlying tool and if the instance is a singleton also the instance.
Rarely used, like destroy() but runs after the facades are destroyed.
Rarely used, initialize before Moqui Facades are initialized; useful for tools that ResourceReference, ScriptRunner, TemplateRenderer, ServiceRunner, etc implementations depend on.