TBean
- Type of the beanTPlugin
- Type of the pluginpublic class PluginBeanHelper<TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> extends Object implements Serializable
PluginBeanHelper.forCurrentViewScope(plugin, client).getOrCreateBeans();Each helper is associated to a certain scope (request, view, session, or application scope). It should be used by an accompanying managed bean of the same scope. In the
PostConstruct
method of said bean an instance of this
helper should be created and getOrCreateBean(Class) should be called. In the PreDestroy
method
destroyBeans()
should be called (not removeBeans()
, as the entire scope is about to be destroyed).Modifier and Type | Class and Description |
---|---|
static interface |
PluginBeanHelper.IPreInitAction<TBean extends IPluginGenericCustomGUIBean>
Interface for a callback before a bean is initialized.
|
Modifier and Type | Method and Description |
---|---|
List<de.xima.fc.gui.bean.plugingui.PluginBeanInfo> |
destroyBeans()
Destroys all beans from the current request, view, session or application scope, according to the specified bean
scope handler.
|
static <TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> |
forCurrentApplicationScope(TPlugin plugin,
Mandant client,
PluginBeanOptions pluginBeanOptions)
A new helper for application scoped beans of the given plugin.
|
static <TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> |
forCurrentRequestScope(TPlugin plugin,
Mandant client,
PluginBeanOptions pluginBeanOptions)
A new helper for application request beans of the given plugin.
|
static <TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> |
forCurrentSessionScope(TPlugin plugin,
Mandant client,
PluginBeanOptions pluginBeanOptions)
A new helper for session scoped beans of the given plugin.
|
static <TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> |
forCurrentViewScope(TPlugin plugin,
Mandant client,
PluginBeanOptions pluginBeanOptions)
A new helper for view scoped beans of the given plugin.
|
Map<String,TBean> |
getOrCreateBeans() |
String |
getPluginName() |
PluginBeanHelper.IPreInitAction<TBean> |
getPreInitAction() |
void |
removeBeans()
Destroys all beans and removes them from their current scope.
|
void |
setPreInitAction(PluginBeanHelper.IPreInitAction<TBean> preInitAction) |
public PluginBeanHelper.IPreInitAction<TBean> getPreInitAction()
public void setPreInitAction(PluginBeanHelper.IPreInitAction<TBean> preInitAction)
preInitAction
- the preInitAction to setpublic final List<de.xima.fc.gui.bean.plugingui.PluginBeanInfo> destroyBeans()
List
of beans that were destroyed.public final Map<String,TBean> getOrCreateBeans() throws Exception
Exception
- When a bean could not be retrieved or created, such as when a bean threw an Exception during
initialization or when no active request / session could be found.public String getPluginName()
public final void removeBeans()
Do not call this in a PreDestroy
method of a managed bean, or you may run into issues such
as concurrent modification exceptions (as the JSF framework is currently iterating over the map from which we
remove the beans). Use destroyBeans()
instead.
public static <TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> PluginBeanHelper<TBean,TPlugin> forCurrentApplicationScope(TPlugin plugin, Mandant client, PluginBeanOptions pluginBeanOptions) throws Exception
TBean
- Type of the plugin beans.TPlugin
- Type of the plugin that provides the beans.plugin
- Plugin that provides the beansclient
- The current client, may be null
for the system administrator without a clientpluginBeanOptions
- Options for handling the plugin beans, such as whether post construct annotations should
be processed. Pass null
to use the defaults.Exception
- When no plugin runtime could be found for the given plugin; or when no request is currently
active.public static <TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> PluginBeanHelper<TBean,TPlugin> forCurrentRequestScope(TPlugin plugin, Mandant client, PluginBeanOptions pluginBeanOptions) throws Exception
plugin
- Plugin that provides the beansclient
- The current client, may be null
for the system administrator without a clientpluginBeanOptions
- Options for handling the plugin beans, such as whether post construct annotations should
be processed. Pass null
to use the defaults.Exception
- When no plugin runtime could be found for the given plugin; or when no request is currently
active.public static <TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> PluginBeanHelper<TBean,TPlugin> forCurrentSessionScope(TPlugin plugin, Mandant client, PluginBeanOptions pluginBeanOptions) throws Exception
TBean
- Type of the plugin beans.TPlugin
- Type of the plugin that provides the beans.plugin
- Plugin that provides the beansclient
- The current client, may be null
for the system administrator without a clientpluginBeanOptions
- Options for handling the plugin beans, such as whether post construct annotations should
be processed. Pass null
to use the defaults.Exception
- When no plugin runtime could be found for the given plugin; or when no request is currently
active.public static <TBean extends IPluginGenericCustomGUIBean,TPlugin extends IFCPlugin & IPluginGenericCustomGUI<TBean>> PluginBeanHelper<TBean,TPlugin> forCurrentViewScope(TPlugin plugin, Mandant client, PluginBeanOptions pluginBeanOptions) throws Exception
TBean
- Type of the plugin beans.TPlugin
- Type of the plugin that provides the beans.plugin
- Plugin that provides the beansclient
- The current client, may be null
for the system administrator without a clientpluginBeanOptions
- Options for handling the plugin beans, such as whether post construct annotations should
be processed. Pass null
to use the defaults.Exception
- When no plugin runtime could be found for the given plugin; or when no view is currently active.Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.