public class MultiSchemaMultiTenantProcessEngineConfiguration extends ProcessEngineConfigurationImpl
ProcessEngineConfiguration that builds a multi tenant ProcessEngine where
each tenant has its own database schema.
If multitenancy is needed and no data isolation is needed: the default ProcessEngineConfigurationImpl
of Activiti is multitenant enabled out of the box by setting a tenant identifier on a DeploymentBuilder.
This configuration has following characteristics:
- It needs a TenantInfoHolder to determine which tenant is currently 'active'. Ie for which
tenant a certain API call is executed.
- The StrongUuidGenerator is used by default. The 'regular' DbIdGenerator cannot be used with this config.
- Adding tenants (also after boot!) is done using the registerTenant(String, DataSource) operations.
- Currently, this config does not work with the 'old' JobExecutor, but only with the newer AsyncExecutor.
There are two different implementations:
- The ExecutorPerTenantAsyncExecutor: creates one full AsyncExecutor for each tenant.
- The SharedExecutorServiceAsyncExecutor: created acquisition threads for each tenant, but the
job execution is done using a process engine shared ExecutorService.
The AsyncExecutor needs to be injected using the ProcessEngineConfiguration.setAsyncExecutor(AsyncExecutor) method on this class.
databasetype| Modifier and Type | Field and Description |
|---|---|
protected boolean |
booted |
protected TenantInfoHolder |
tenantInfoHolder |
activityBehaviorFactory, allConfigurators, asyncExecutorAsyncJobLockTimeInMillis, asyncExecutorCorePoolSize, asyncExecutorDefaultAsyncJobAcquireWaitTime, asyncExecutorDefaultQueueSizeFullWaitTime, asyncExecutorDefaultTimerJobAcquireWaitTime, asyncExecutorExecuteAsyncRunnableFactory, asyncExecutorLockOwner, asyncExecutorLockRetryWaitTimeInMillis, asyncExecutorMaxAsyncJobsDuePerAcquisition, asyncExecutorMaxPoolSize, asyncExecutorMaxTimerJobsPerAcquisition, asyncExecutorSecondsToWaitOnShutdown, asyncExecutorThreadKeepAliveTime, asyncExecutorThreadPoolQueue, asyncExecutorThreadPoolQueueSize, asyncExecutorTimerLockTimeInMillis, batchSizeProcessInstances, batchSizeTasks, beans, bpmnDeployer, bpmnModelCache, bpmnModelCacheLimit, bpmnParseFactory, bpmnParser, businessCalendarManager, commandContextFactory, commandExecutor, commandInterceptors, commandInvoker, configurators, customDefaultBpmnParseHandlers, customEventHandlers, customFormEngines, customFormTypes, customJobHandlers, customMybatisMappers, customMybatisXMLMappers, customPostCommandInterceptors, customPostDeployers, customPostVariableTypes, customPreCommandInterceptors, customPreDeployers, customPreVariableTypes, customRejectedJobsHandler, customScriptingEngineClasses, customSessionFactories, DATABASE_TYPE_DB2, DATABASE_TYPE_H2, DATABASE_TYPE_HSQL, DATABASE_TYPE_MSSQL, DATABASE_TYPE_MYSQL, DATABASE_TYPE_ORACLE, DATABASE_TYPE_POSTGRES, databaseTypeMappings, DB_SCHEMA_UPDATE_CREATE, DB_SCHEMA_UPDATE_DROP_CREATE, dbSqlSessionFactory, DEFAULT_GENERIC_MAX_LENGTH_STRING, DEFAULT_MYBATIS_MAPPING_FILE, DEFAULT_ORACLE_MAX_LENGTH_STRING, DEFAULT_WS_SYNC_FACTORY, defaultCommandConfig, delegateInterceptor, deployers, deploymentManager, dynamicBpmnService, enableConfiguratorServiceLoader, enableDatabaseEventLogging, enableEventDispatcher, enableSafeBpmnXml, eventDispatcher, eventHandlers, eventListeners, expressionManager, failedJobCommandFactory, formEngines, formService, formTypes, historyService, identityService, idGenerator, idGeneratorDataSource, idGeneratorDataSourceJndiName, isBulkInsertEnabled, jobHandlers, knowledgeBaseCache, knowledgeBaseCacheLimit, listenerFactory, managementService, maxLengthStringVariableType, maxNrOfStatementsInBulkInsert, objectMapper, postBpmnParseHandlers, preBpmnParseHandlers, processDefinitionCache, processDefinitionCacheLimit, processDefinitionInfoCache, processDefinitionInfoCacheLimit, processValidator, repositoryService, resolverFactories, runtimeService, schemaCommandConfig, scriptingEngines, sessionFactories, sqlSessionFactory, taskService, transactionContextFactory, transactionFactory, typedEventListeners, variableTypes, wsSyncFactoryClassNameactivityFontName, asyncExecutor, asyncExecutorActivate, asyncExecutorEnabled, asyncFailedJobWaitTime, classLoader, clock, databaseCatalog, databaseSchema, databaseSchemaUpdate, databaseTablePrefix, databaseType, dataSource, dataSourceJndiName, DB_SCHEMA_UPDATE_CREATE_DROP, DB_SCHEMA_UPDATE_FALSE, DB_SCHEMA_UPDATE_TRUE, defaultCamelContext, defaultFailedJobWaitTime, enableProcessDefinitionInfoCache, history, historyLevel, idBlockSize, isCreateDiagramOnDeploy, isDbHistoryUsed, isDbIdentityUsed, jdbcDefaultTransactionIsolationLevel, jdbcDriver, jdbcMaxActiveConnections, jdbcMaxCheckoutTime, jdbcMaxIdleConnections, jdbcMaxWaitTime, jdbcPassword, jdbcPingConnectionNotUsedFor, jdbcPingEnabled, jdbcPingQuery, jdbcUrl, jdbcUsername, jobExecutor, jobExecutorActivate, jpaCloseEntityManager, jpaEntityManagerFactory, jpaHandleTransaction, jpaPersistenceUnitName, labelFontName, lockTimeAsyncJobWaitTime, mailServerDefaultFrom, mailServerHost, mailServerPassword, mailServerPort, mailServers, mailServerUsername, mailSessionJndi, mailSessionsJndi, NO_TENANT_ID, processDiagramGenerator, processEngineLifecycleListener, processEngineName, tablePrefixIsSchema, transactionsExternallyManaged, useClassForNameClassLoading, useSSL, useTLS, xmlEncoding| Constructor and Description |
|---|
MultiSchemaMultiTenantProcessEngineConfiguration(TenantInfoHolder tenantInfoHolder) |
| Modifier and Type | Method and Description |
|---|---|
ProcessEngine |
buildProcessEngine() |
protected void |
createTenantAsyncJobExecutor(String tenantId) |
protected void |
createTenantSchema(String tenantId) |
protected CommandInterceptor |
createTransactionInterceptor() |
protected void |
initAsyncExecutor() |
void |
registerTenant(String tenantId,
DataSource dataSource)
Add a new
DataSource for a tenant, identified by the provided tenantId, to the engine. |
addConfigurator, addSessionFactory, configuratorsAfterInit, configuratorsBeforeInit, getActivityBehaviorFactory, getAllConfigurators, getAsyncExecutorAsyncJobLockTimeInMillis, getAsyncExecutorCorePoolSize, getAsyncExecutorDefaultAsyncJobAcquireWaitTime, getAsyncExecutorDefaultQueueSizeFullWaitTime, getAsyncExecutorExecuteAsyncRunnableFactory, getAsyncExecutorLockOwner, getAsyncExecutorLockRetryWaitTimeInMillis, getAsyncExecutorMaxAsyncJobsDuePerAcquisition, getAsyncExecutorMaxPoolSize, getAsyncExecutorMaxTimerJobsPerAcquisition, getAsyncExecutorSecondsToWaitOnShutdown, getAsyncExecutorThreadKeepAliveTime, getAsyncExecutorThreadPoolQueue, getAsyncExecutorThreadPoolQueueSize, getAsyncExecutorTimerJobAcquireWaitTime, getAsyncExecutorTimerLockTimeInMillis, getBatchSizeProcessInstances, getBatchSizeTasks, getBeans, getBpmnDeployer, getBpmnParseFactory, getBpmnParser, getBusinessCalendarManager, getCommandContextFactory, getCommandExecutor, getCommandInterceptors, getCommandInvoker, getConfigurators, getCustomDefaultBpmnParseHandlers, getCustomEventHandlers, getCustomFormEngines, getCustomFormTypes, getCustomJobHandlers, getCustomMybatisMappers, getCustomMybatisXMLMappers, getCustomPostCommandInterceptors, getCustomPostDeployers, getCustomPostVariableTypes, getCustomPreCommandInterceptors, getCustomPreDeployers, getCustomPreVariableTypes, getCustomRejectedJobsHandler, getCustomScriptingEngineClasses, getCustomSessionFactories, getDbSqlSessionFactory, getDefaultBpmnParseHandlers, getDefaultCommandConfig, getDefaultCommandInterceptors, getDefaultDatabaseTypeMappings, getDefaultDeployers, getDefaultHistoryParseHandlers, getDelegateInterceptor, getDeployers, getDeploymentManager, getDynamicBpmnService, getEventDispatcher, getEventHandler, getEventHandlers, getExpressionManager, getFailedJobCommandFactory, getFormEngines, getFormService, getFormTypes, getHistoryService, getIdentityService, getIdGenerator, getIdGeneratorDataSource, getIdGeneratorDataSourceJndiName, getJobHandlers, getKnowledgeBaseCache, getKnowledgeBaseCacheLimit, getListenerFactory, getManagementService, getMaxLengthString, getMaxLengthStringVariableType, getMaxNrOfStatementsInBulkInsert, getMyBatisXmlConfigurationSteam, getObjectMapper, getPostBpmnParseHandlers, getPreBpmnParseHandlers, getProcessDefinitionCache, getProcessDefinitionCacheLimit, getProcessEngineConfiguration, getProcessValidator, getRepositoryService, getResolverFactories, getResourceAsStream, getRuntimeService, getSchemaCommandConfig, getScriptingEngines, getSessionFactories, getSqlSessionFactory, getTaskService, getTransactionContextFactory, getTransactionFactory, getVariableTypes, getWsSyncFactoryClassName, init, initBeans, initBusinessCalendarManager, initCommandContextFactory, initCommandExecutor, initCommandExecutors, initCommandInterceptors, initCommandInvoker, initConfigurators, initCustomMybatisMappers, initDatabaseEventLogging, initDatabaseType, initDataSource, initDefaultCommandConfig, initDelegateInterceptor, initDeployers, initEventDispatcher, initEventHandlers, initExpressionManager, initFailedJobCommandFactory, initFormEngines, initFormTypes, initHistoryLevel, initIdGenerator, initInterceptorChain, initJobExecutor, initJobHandlers, initJpa, initMybatisConfiguration, initMybatisTypeHandlers, initProcessDiagramGenerator, initProcessValidator, initScriptingEngines, initService, initServices, initSessionFactories, initSqlSessionFactory, initTransactionContextFactory, initTransactionFactory, initVariableTypes, isBulkInsertEnabled, isEnableDatabaseEventLogging, isEnableEventDispatcher, isEnableSafeBpmnXml, parseCustomMybatisXMLMappers, parseMybatisConfiguration, setActivityBehaviorFactory, setAsyncExecutorAsyncJobLockTimeInMillis, setAsyncExecutorCorePoolSize, setAsyncExecutorDefaultAsyncJobAcquireWaitTime, setAsyncExecutorDefaultQueueSizeFullWaitTime, setAsyncExecutorDefaultTimerJobAcquireWaitTime, setAsyncExecutorExecuteAsyncRunnableFactory, setAsyncExecutorLockOwner, setAsyncExecutorLockRetryWaitTimeInMillis, setAsyncExecutorMaxAsyncJobsDuePerAcquisition, setAsyncExecutorMaxPoolSize, setAsyncExecutorMaxTimerJobsPerAcquisition, setAsyncExecutorSecondsToWaitOnShutdown, setAsyncExecutorThreadKeepAliveTime, setAsyncExecutorThreadPoolQueue, setAsyncExecutorThreadPoolQueueSize, setAsyncExecutorTimerLockTimeInMillis, setBatchSizeProcessInstances, setBatchSizeTasks, setBeans, setBpmnDeployer, setBpmnParseFactory, setBpmnParser, setBulkInsertEnabled, setBusinessCalendarManager, setCommandContextFactory, setCommandExecutor, setCommandInterceptors, setCommandInvoker, setConfigurators, setCustomDefaultBpmnParseHandlers, setCustomEventHandlers, setCustomFormEngines, setCustomFormTypes, setCustomJobHandlers, setCustomMybatisMappers, setCustomMybatisXMLMappers, setCustomPostCommandInterceptors, setCustomPostDeployers, setCustomPostVariableTypes, setCustomPreCommandInterceptors, setCustomPreDeployers, setCustomPreVariableTypes, setCustomRejectedJobsHandler, setCustomScriptingEngineClasses, setCustomSessionFactories, setDbSqlSessionFactory, setDefaultCommandConfig, setDelegateInterceptor, setDeployers, setDeploymentManager, setDynamicBpmnService, setEnableConfiguratorServiceLoader, setEnableDatabaseEventLogging, setEnableEventDispatcher, setEnableSafeBpmnXml, setEventDispatcher, setEventHandlers, setEventListeners, setExpressionManager, setFailedJobCommandFactory, setFormEngines, setFormService, setFormTypes, setHistoryService, setIdentityService, setIdGenerator, setIdGeneratorDataSource, setIdGeneratorDataSourceJndiName, setJobHandlers, setKnowledgeBaseCache, setKnowledgeBaseCacheLimit, setListenerFactory, setManagementService, setMaxLengthStringVariableType, setMaxNrOfStatementsInBulkInsert, setPostBpmnParseHandlers, setPreBpmnParseHandlers, setProcessDefinitionCache, setProcessDefinitionCacheLimit, setProcessValidator, setRepositoryService, setResolverFactories, setRuntimeService, setSchemaCommandConfig, setScriptingEngines, setSessionFactories, setSqlSessionFactory, setTaskService, setTransactionContextFactory, setTransactionFactory, setTypedEventListeners, setVariableTypes, setWsSyncFactoryClassNamecreateProcessEngineConfigurationFromInputStream, createProcessEngineConfigurationFromInputStream, createProcessEngineConfigurationFromResource, createProcessEngineConfigurationFromResource, createProcessEngineConfigurationFromResourceDefault, createStandaloneInMemProcessEngineConfiguration, createStandaloneProcessEngineConfiguration, getActivityFontName, getAsyncExecutor, getAsyncFailedJobWaitTime, getClassLoader, getClock, getDatabaseCatalog, getDatabaseSchema, getDatabaseSchemaUpdate, getDatabaseTablePrefix, getDatabaseType, getDataSource, getDataSourceJndiName, getDefaultCamelContext, getDefaultFailedJobWaitTime, getHistory, getHistoryLevel, getIdBlockSize, getJdbcDefaultTransactionIsolationLevel, getJdbcDriver, getJdbcMaxActiveConnections, getJdbcMaxCheckoutTime, getJdbcMaxIdleConnections, getJdbcMaxWaitTime, getJdbcPassword, getJdbcPingConnectionNotUsedFor, getJdbcPingQuery, getJdbcUrl, getJdbcUsername, getJobExecutor, getJpaEntityManagerFactory, getJpaPersistenceUnitName, getLabelFontName, getLockTimeAsyncJobWaitTime, getMailServer, getMailServerDefaultFrom, getMailServerHost, getMailServerPassword, getMailServerPort, getMailServers, getMailServerUsername, getMailServerUseSSL, getMailServerUseTLS, getMailSessionJndi, getMailSessionJndi, getMailSessionsJndi, getProcessDiagramGenerator, getProcessEngineLifecycleListener, getProcessEngineName, getXmlEncoding, isAsyncExecutorActivate, isAsyncExecutorEnabled, isCreateDiagramOnDeploy, isDbHistoryUsed, isDbIdentityUsed, isEnableProcessDefinitionInfoCache, isJdbcPingEnabled, isJobExecutorActivate, isJpaCloseEntityManager, isJpaHandleTransaction, isTablePrefixIsSchema, isTransactionsExternallyManaged, isUseClassForNameClassLoading, setActivityFontName, setAsyncExecutor, setAsyncExecutorActivate, setAsyncExecutorEnabled, setAsyncFailedJobWaitTime, setClassLoader, setClock, setCreateDiagramOnDeploy, setDatabaseCatalog, setDatabaseSchema, setDatabaseSchemaUpdate, setDatabaseTablePrefix, setDatabaseType, setDataSource, setDataSourceJndiName, setDbHistoryUsed, setDbIdentityUsed, setDefaultCamelContext, setDefaultFailedJobWaitTime, setEnableProcessDefinitionInfoCache, setHistory, setHistoryLevel, setIdBlockSize, setJdbcDefaultTransactionIsolationLevel, setJdbcDriver, setJdbcMaxActiveConnections, setJdbcMaxCheckoutTime, setJdbcMaxIdleConnections, setJdbcMaxWaitTime, setJdbcPassword, setJdbcPingConnectionNotUsedFor, setJdbcPingEnabled, setJdbcPingQuery, setJdbcUrl, setJdbcUsername, setJobExecutor, setJobExecutorActivate, setJpaCloseEntityManager, setJpaEntityManagerFactory, setJpaHandleTransaction, setJpaPersistenceUnitName, setLabelFontName, setLockTimeAsyncJobWaitTime, setMailServerDefaultFrom, setMailServerHost, setMailServerPassword, setMailServerPort, setMailServers, setMailServerUsername, setMailServerUseSSL, setMailServerUseTLS, setMailSessionJndi, setMailSessionsJndi, setProcessDiagramGenerator, setProcessEngineLifecycleListener, setProcessEngineName, setTablePrefixIsSchema, setTransactionsExternallyManaged, setUseClassForNameClassLoading, setXmlEncodingprotected TenantInfoHolder tenantInfoHolder
protected boolean booted
public MultiSchemaMultiTenantProcessEngineConfiguration(TenantInfoHolder tenantInfoHolder)
public void registerTenant(String tenantId, DataSource dataSource)
DataSource for a tenant, identified by the provided tenantId, to the engine.
This can be done after the engine has booted up.
Note that the tenant identifier must have been added to the TenantInfoHolder *prior*
to calling this method.protected void initAsyncExecutor()
initAsyncExecutor in class ProcessEngineConfigurationImplpublic ProcessEngine buildProcessEngine()
buildProcessEngine in class ProcessEngineConfigurationImplprotected void createTenantSchema(String tenantId)
protected void createTenantAsyncJobExecutor(String tenantId)
protected CommandInterceptor createTransactionInterceptor()
createTransactionInterceptor in class ProcessEngineConfigurationImplCopyright © 2016 Alfresco. All rights reserved.