Class OnTenantStartupProcessor
- java.lang.Object
-
- de.hybris.platform.ruleengine.event.OnTenantStartupProcessor
-
public class OnTenantStartupProcessor extends java.lang.ObjectThe OnTenantStartupProcessor is responsible for handling tenant activation of rules modules after the current tenant has been (re)started. It is possible to disable this mechanism for specific tenants by providing a set of tenant ids to be excluded (seegetExcludedTenants(). This class essentially activates the drools engine. It will also set drools specific properties that can be configured via the local.properties approach as system properties.
-
-
Constructor Summary
Constructors Constructor Description OnTenantStartupProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanactivateRulesModules()protected ConfigurationServicegetConfigurationService()protected java.util.Set<java.lang.String>getDroolsProperties()returns a set of properties that will be set as system properties before drools is started up.protected java.util.Set<java.lang.String>getExcludedTenants()returns a set of tenant IDs for which rules modules will not be activated.protected RuleEngineBootstrapgetRuleEngineBootstrap()protected org.springframework.retry.support.RetryTemplategetRuleEngineInitRetryTemplate()protected RuleEngineServicegetRuleEngineService()protected RulesModuleDaogetRulesModuleDao()protected booleanignoreTenant()checks if the current tenantID is part of the ignored tenants as configured viagetExcludedTenants().protected voidinit()protected booleanisSystemInitialized()protected voidprocessOnTenantStartup()The method is called on Tenant startup.protected voidrefreshCurrentSessionWithRetry(java.util.function.Supplier<java.lang.Void> failingMethodSupplier)voidsetConfigurationService(ConfigurationService configurationService)voidsetDroolsProperties(java.util.Set<java.lang.String> droolsProperties)protected voidsetDroolsSystemProperties()all of the properties defined in this class' droolsProperties attribute will be set as system property before drools is initialized.voidsetExcludedTenants(java.util.Set<java.lang.String> excludedTenants)voidsetRuleEngineBootstrap(RuleEngineBootstrap ruleEngineBootstrap)voidsetRuleEngineInitRetryTemplate(org.springframework.retry.support.RetryTemplate ruleEngineInitRetryTemplate)voidsetRuleEngineService(RuleEngineService ruleEngineService)voidsetRulesModuleDao(RulesModuleDao rulesModuleDao)
-
-
-
Method Detail
-
processOnTenantStartup
protected void processOnTenantStartup()
The method is called on Tenant startup.
-
setDroolsSystemProperties
protected void setDroolsSystemProperties()
all of the properties defined in this class' droolsProperties attribute will be set as system property before drools is initialized.
-
activateRulesModules
protected boolean activateRulesModules()
-
refreshCurrentSessionWithRetry
protected void refreshCurrentSessionWithRetry(java.util.function.Supplier<java.lang.Void> failingMethodSupplier)
-
init
@PostConstruct protected void init()
-
isSystemInitialized
protected boolean isSystemInitialized()
-
ignoreTenant
protected boolean ignoreTenant()
checks if the current tenantID is part of the ignored tenants as configured viagetExcludedTenants().- Returns:
- true if the tenant should be ignored, otherwise false
-
getConfigurationService
protected ConfigurationService getConfigurationService()
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
getExcludedTenants
protected java.util.Set<java.lang.String> getExcludedTenants()
returns a set of tenant IDs for which rules modules will not be activated.
-
setExcludedTenants
public void setExcludedTenants(java.util.Set<java.lang.String> excludedTenants)
-
getDroolsProperties
protected java.util.Set<java.lang.String> getDroolsProperties()
returns a set of properties that will be set as system properties before drools is started up.
-
setDroolsProperties
public void setDroolsProperties(java.util.Set<java.lang.String> droolsProperties)
-
getRulesModuleDao
protected RulesModuleDao getRulesModuleDao()
-
setRulesModuleDao
public void setRulesModuleDao(RulesModuleDao rulesModuleDao)
-
getRuleEngineBootstrap
protected RuleEngineBootstrap getRuleEngineBootstrap()
-
setRuleEngineBootstrap
public void setRuleEngineBootstrap(RuleEngineBootstrap ruleEngineBootstrap)
-
getRuleEngineService
protected RuleEngineService getRuleEngineService()
-
setRuleEngineService
public void setRuleEngineService(RuleEngineService ruleEngineService)
-
getRuleEngineInitRetryTemplate
protected org.springframework.retry.support.RetryTemplate getRuleEngineInitRetryTemplate()
-
setRuleEngineInitRetryTemplate
public void setRuleEngineInitRetryTemplate(org.springframework.retry.support.RetryTemplate ruleEngineInitRetryTemplate)
-
-