Interface GatewayModuleHook
-
- All Known Implementing Classes:
AbstractGatewayModuleHook
,GatewayHook
,ReportingGatewayHook
,SfcGatewayHook
,TagHistorianGatewayHook
public interface GatewayModuleHook
The main hook into a module's gateway scope. Each module should provide exactly one implementation of this hook class if the module includes gateway-scoped logic. The name of this implementation must be included in the module's descriptor file, with an entry like:<hook scope="G">com.example.module.gateway.SuperHookClass</hook>
Best practice: Instead of implementing this interface directly, subclass your hook class from
AbstractGatewayModuleHook
instead.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
configureDeserializer(XMLDeserializer deserializer)
Provides the module a chance to configure the deserializer with any custom handlersvoid
configureFunctionFactory(ExpressionFunctionManager factory)
Provides the module with an opportunity to define its own expression functionsvoid
configureSerializer(XMLSerializer serializer)
Provides the module a chance to add serialization delegates to the serializer custom for classes that might be encountered when serializing objects provided by this moduledefault java.util.List<ConfigCategory>
getConfigCategories()
A list (may be null or empty) of custom config categories needed by any panels returned bygetConfigPanels()
default java.util.Optional<ConfigOverviewContributor>
getConfigOverviewContributor()
Implement this method to contribute meta data to the Configure section's Overview page.default java.util.List<? extends IConfigTab>
getConfigPanels()
A list (may be null or empty) of panels to display in the config section.java.util.List<? extends IHomepagePanelDescriptor>
getHomepagePanels()
A list (may be null or empty) of homepage panels that this module providesdefault java.util.Optional<java.lang.String>
getMountedResourceFolder()
default java.util.Optional<java.lang.String>
getMountPathAlias()
Used by the mounting underneath /res/module-id/* and /main/data/module-id/* as an alternate mounting path instead of your module id, if present.java.lang.Object
getRPCHandler(ClientReqSession session, java.lang.String projectName)
A class whose functions will become exposed automatically through reflection to the Designer and the Client through RPCdefault java.util.Optional<OverviewContributor>
getStatusOverviewContributor()
Implement this method to contribute meta data to the Status section's Systems / Overview page.java.util.List<? extends INamedTab>
getStatusPanels()
A list (may be null or empty) of panels to display in the status sectiondefault void
initializeResourceTypeAdapterRegistry(ResourceTypeAdapterRegistry registry)
Register anyResourceTypeAdapter
s this module needs with withregistry
.void
initializeScriptManager(ScriptManager manager)
Initialize a newly-instantiated script manager.default boolean
isFreeModule()
default boolean
isMakerEditionCompatible()
default void
mountRouteHandlers(RouteGroup routes)
Provides a chance for the module to mount any route handlers it wants.void
notifyLicenseStateChanged(LicenseState licenseState)
Notify module hook when the license state has changed.default void
onMountedResourceRequest(java.lang.String resourcePath, javax.servlet.http.HttpServletResponse response)
Called prior to a 'mounted resource request' being fulfilled by requests to the mounted resource servlet serving resources from /res/module-id/ (or /res/alias/ ifgetMountPathAlias()
is implemented).void
setup(GatewayContext context)
Called to before startup.void
shutdown()
Called to shutdown this module.void
startup(LicenseState activationState)
Called to initialize the module.default void
updateSystemMap(SystemMap map)
Deprecated.Instead, see getStatusOverviewContributor
-
-
-
Method Detail
-
setup
void setup(GatewayContext context)
Called to before startup. This is the chance for the module to add its extension points and update persistent records and schemas. None of the managers will be started up at this point, but the extension point managers will accept extension point types.
-
startup
void startup(LicenseState activationState)
Called to initialize the module. Will only be called once. Persistence interface is available, but only in read-only mode.
-
shutdown
void shutdown()
Called to shutdown this module. Note that this instance will never be started back up - a new one will be created if a restart is desired
-
getRPCHandler
java.lang.Object getRPCHandler(ClientReqSession session, java.lang.String projectName)
A class whose functions will become exposed automatically through reflection to the Designer and the Client through RPC
-
notifyLicenseStateChanged
void notifyLicenseStateChanged(LicenseState licenseState)
Notify module hook when the license state has changed. This could only contain changes for the module or it could contain a change to the platform license (version, restrictions such as expiration date, sqltag count...)
-
getHomepagePanels
java.util.List<? extends IHomepagePanelDescriptor> getHomepagePanels()
A list (may be null or empty) of homepage panels that this module provides
-
getStatusPanels
java.util.List<? extends INamedTab> getStatusPanels()
A list (may be null or empty) of panels to display in the status section
-
getConfigPanels
default java.util.List<? extends IConfigTab> getConfigPanels()
A list (may be null or empty) of panels to display in the config section. Note that any config panels that are part of a category that doesn't exist already or isn't included ingetConfigCategories()
will not be shown.
-
getConfigCategories
default java.util.List<ConfigCategory> getConfigCategories()
A list (may be null or empty) of custom config categories needed by any panels returned bygetConfigPanels()
-
configureSerializer
void configureSerializer(XMLSerializer serializer)
Provides the module a chance to add serialization delegates to the serializer custom for classes that might be encountered when serializing objects provided by this module
-
configureDeserializer
void configureDeserializer(XMLDeserializer deserializer)
Provides the module a chance to configure the deserializer with any custom handlers
-
configureFunctionFactory
void configureFunctionFactory(ExpressionFunctionManager factory)
Provides the module with an opportunity to define its own expression functions
-
updateSystemMap
@Deprecated default void updateSystemMap(SystemMap map)
Deprecated.Instead, see getStatusOverviewContributorThis is no longer used.- Since:
- deprecated since 7.9.0
-
initializeScriptManager
void initializeScriptManager(ScriptManager manager)
Initialize a newly-instantiated script manager. This will be called exactly once for any givenScriptManager
instance. Usually this will involve callingScriptManager.addScriptModule(String, Object)
, which reflectively loads the public (instance and static) java functions from the given object into the scripting environment, at the provided path.This function may be called before
startup(LicenseState)
, but never beforesetup(GatewayContext)
.
-
getMountedResourceFolder
default java.util.Optional<java.lang.String> getMountedResourceFolder()
- Returns:
- the path to a folder in one of the module's gateway jar files that should be mounted at /res/module-id/foldername
-
mountRouteHandlers
default void mountRouteHandlers(RouteGroup routes)
Provides a chance for the module to mount any route handlers it wants. These will be active at /main/data/module-id/* SeeRouteGroup
for details. Will be called after startup().
-
getMountPathAlias
default java.util.Optional<java.lang.String> getMountPathAlias()
Used by the mounting underneath /res/module-id/* and /main/data/module-id/* as an alternate mounting path instead of your module id, if present.
-
isFreeModule
default boolean isFreeModule()
- Returns:
true
if this is a "free" module, i.e. it does not participate in the licensing system. This is equivalent to the now defunct FreeModule attribute that could be specified in module.xml.
-
isMakerEditionCompatible
default boolean isMakerEditionCompatible()
- Returns:
true
if this module opts-in to participating in Ignition Maker Edition. Default isfalse
. If you override this and return true, your module will become activated when running in a Maker Edition installation.
-
getStatusOverviewContributor
default java.util.Optional<OverviewContributor> getStatusOverviewContributor()
Implement this method to contribute meta data to the Status section's Systems / Overview page.
-
getConfigOverviewContributor
default java.util.Optional<ConfigOverviewContributor> getConfigOverviewContributor()
Implement this method to contribute meta data to the Configure section's Overview page.
-
initializeResourceTypeAdapterRegistry
default void initializeResourceTypeAdapterRegistry(ResourceTypeAdapterRegistry registry)
Register anyResourceTypeAdapter
s this module needs with withregistry
.ResourceTypeAdapters are used to adapt a legacy (7.9 or prior) resource type name or payload into a nicer format for the Ignition 8.0 project resource system.Ò Only override this method for modules that aren't known by the
ResourceTypeAdapterRegistry
already.This method is called before
setup(GatewayContext)
orstartup(LicenseState)
.- Parameters:
registry
- the sharedResourceTypeAdapterRegistry
instance.
-
onMountedResourceRequest
default void onMountedResourceRequest(java.lang.String resourcePath, javax.servlet.http.HttpServletResponse response)
Called prior to a 'mounted resource request' being fulfilled by requests to the mounted resource servlet serving resources from /res/module-id/ (or /res/alias/ ifgetMountPathAlias()
is implemented). It is called after the target resource has been successfully located.Primarily intended as an opportunity to amend/alter the response's headers for purposes such as establishing Cache-Control. By default, Ignition sets no additional headers on a resource request.
- Parameters:
resourcePath
- path to the resource being returned by the mounted resource requestresponse
- the response to read/amend.
-
-