Class BaseModuleHandlerFactory

    • Constructor Detail

      • BaseModuleHandlerFactory

        public BaseModuleHandlerFactory()
    • Method Detail

      • deactivate

        protected void deactivate()
        Should be overridden by the implementations that extend this base class. Called from DS to deactivate the ModuleHandlerFactory.
      • getHandlers

        protected Map<String,​ModuleHandler> getHandlers()
        Provides all available ModuleHandlers created by concrete factory implementation.
        Returns:
        a map with keys calculated by concatenated rule UID and module Id and values representing ModuleHandler created for concrete module corresponding to the module Id and belongs to rule with such UID.
      • internalCreate

        protected abstract @Nullable ModuleHandler internalCreate​(Module module,
                                                                  String ruleUID)
        Creates a new ModuleHandler for a given module and ruleUID.
        Parameters:
        module - the Module for which a handler should be created.
        ruleUID - the identifier of the Rule that the given module belongs to.
        Returns:
        a ModuleHandler instance or null if thins module type is not supported.
      • ungetHandler

        public void ungetHandler​(Module module,
                                 String ruleUID,
                                 ModuleHandler handler)
        Description copied from interface: ModuleHandlerFactory
        Releases the ModuleHandler instance when it is not needed anymore for handling the specified module in the Rule with the specified ruleUID. If no other Rules and Modules use this handler instance, it should be disposed.
        Specified by:
        ungetHandler in interface ModuleHandlerFactory
        Parameters:
        module - the Module for which the handler was created.
        ruleUID - the identifier of the Rule that the given module belongs to.
        handler - the ModuleHandler instance that is no longer needed.