Package org.jbpm.runtime.manager.impl
Class RuntimeEnvironmentBuilder
- java.lang.Object
-
- org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder
-
- All Implemented Interfaces:
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
,org.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
public class RuntimeEnvironmentBuilder extends Object implements org.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory, org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
A builder implementation that follows the fluent approach to buildRuntimeEnvironments
. Comes with short cut methods to get predefined configurations of theRuntimeEnvironment
:- getDefault() - returns preconfigured environment with enabled persistence
- getDefaultInMemory() - returns preconfigured environment with disabled persistence for runtime engine
- getDefault(ReleaseId) - returns preconfigured environment with enabled persistence that is tailored for kjar
- getDefault(ReleaseId, String, String) - returns preconfigured environment with enabled persistence that is tailored for kjar and allows to specify kbase and ksession name
- getDefault(String, String, String) - returns preconfigured environment with enabled persistence that is tailored for kjar
- getDefault(String, String, String, String, String) - returns preconfigured environment with enabled persistence that is tailored for kjar and allows to specify kbase and ksession name
- getEmpty() - completely empty environment for self configuration
- getClasspathKModuleDefault() - returns preconfigured environment with enabled persistence based on classpath kiecontainer
- getClasspathKModuleDefault(String, String) - returns preconfigured environment with enabled persistence based on classpath kiecontainer
-
-
Constructor Summary
Constructors Constructor Description RuntimeEnvironmentBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RuntimeEnvironmentBuilder
addAsset(org.kie.api.io.Resource asset, org.kie.api.io.ResourceType type)
RuntimeEnvironmentBuilder
addConfiguration(String name, String value)
RuntimeEnvironmentBuilder
addEnvironmentEntry(String name, Object value)
RuntimeEnvironmentBuilder
classLoader(ClassLoader cl)
RuntimeEnvironmentBuilder
entityManagerFactory(Object emf)
org.kie.internal.runtime.manager.RuntimeEnvironment
get()
static RuntimeEnvironmentBuilder
getClasspathKmoduleDefault()
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on: DefaultRuntimeEnvironment It relies on KieClasspathContainer that requires to have kmodule.xml present in META-INF folder which defines the kjar itself.static RuntimeEnvironmentBuilder
getClasspathKmoduleDefault(String kbaseName, String ksessionName)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on: DefaultRuntimeEnvironment It relies on KieClasspathContainer that requires to have kmodule.xml present in META-INF folder which defines the kjar itself.static RuntimeEnvironmentBuilder
getDefault()
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on: DefaultRuntimeEnvironmentstatic RuntimeEnvironmentBuilder
getDefault(String groupId, String artifactId, String version)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on: DefaultRuntimeEnvironment This one is tailored to works smoothly with kjars as the notion of kbase and ksessionsstatic RuntimeEnvironmentBuilder
getDefault(String groupId, String artifactId, String version, String kbaseName, String ksessionName)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on: DefaultRuntimeEnvironment This one is tailored to works smoothly with kjars as the notion of kbase and ksessionsstatic RuntimeEnvironmentBuilder
getDefault(org.kie.api.builder.ReleaseId releaseId)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on: DefaultRuntimeEnvironment This one is tailored to works smoothly with kjars as the notion of kbase and ksessionsstatic RuntimeEnvironmentBuilder
getDefault(org.kie.api.builder.ReleaseId releaseId, String kbaseName, String ksessionName)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on: DefaultRuntimeEnvironment This one is tailored to works smoothly with kjars as the notion of kbase and ksessionsstatic RuntimeEnvironmentBuilder
getDefaultInMemory()
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on: DefaultRuntimeEnvironment but it does not have persistence for process engine configured so it will only store process instances in memorystatic RuntimeEnvironmentBuilder
getEmpty()
Provides completely emptyRuntimeEnvironmentBuilder
instance that allows to manually set all required components instead of relying on any defaults.protected static Object
getInstanceFromModel(org.kie.internal.runtime.conf.ObjectModel model, org.kie.api.runtime.KieContainer kieContainer, Map<String,Object> contaxtParams)
RuntimeEnvironmentBuilder
knowledgeBase(org.kie.api.KieBase kbase)
RuntimeEnvironmentBuilder
mapper(org.kie.internal.runtime.manager.Mapper mapper)
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newClasspathKmoduleDefaultBuilder()
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newClasspathKmoduleDefaultBuilder(String kbaseName, String ksessionName)
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newDefaultBuilder()
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newDefaultBuilder(String groupId, String artifactId, String version)
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newDefaultBuilder(String groupId, String artifactId, String version, String kbaseName, String ksessionName)
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newDefaultBuilder(org.kie.api.builder.ReleaseId releaseId)
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newDefaultBuilder(org.kie.api.builder.ReleaseId releaseId, String kbaseName, String ksessionName)
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newDefaultInMemoryBuilder()
org.kie.api.runtime.manager.RuntimeEnvironmentBuilder
newEmptyBuilder()
RuntimeEnvironmentBuilder
persistence(boolean persistenceEnabled)
RuntimeEnvironmentBuilder
registerableItemsFactory(org.kie.api.runtime.manager.RegisterableItemsFactory factory)
RuntimeEnvironmentBuilder
schedulerService(Object globalScheduler)
RuntimeEnvironmentBuilder
userGroupCallback(org.kie.api.task.UserGroupCallback callback)
RuntimeEnvironmentBuilder
userInfo(org.kie.api.task.UserInfo userInfo)
-
-
-
Method Detail
-
getEmpty
public static RuntimeEnvironmentBuilder getEmpty()
Provides completely emptyRuntimeEnvironmentBuilder
instance that allows to manually set all required components instead of relying on any defaults.- Returns:
- new instance of
RuntimeEnvironmentBuilder
-
getDefault
public static RuntimeEnvironmentBuilder getDefault()
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on:- DefaultRuntimeEnvironment
- Returns:
- new instance of
RuntimeEnvironmentBuilder
that is already preconfigured with defaults - See Also:
DefaultRuntimeEnvironment
-
getDefaultInMemory
public static RuntimeEnvironmentBuilder getDefaultInMemory()
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on:- DefaultRuntimeEnvironment
- Returns:
- new instance of
RuntimeEnvironmentBuilder
that is already preconfigured with defaults - See Also:
DefaultRuntimeEnvironment
-
getDefault
public static RuntimeEnvironmentBuilder getDefault(String groupId, String artifactId, String version)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on:- DefaultRuntimeEnvironment
- Parameters:
groupId
- group id of kjarartifactId
- artifact id of kjarversion
- version number of kjar- Returns:
- new instance of
RuntimeEnvironmentBuilder
that is already preconfigured with defaults - See Also:
DefaultRuntimeEnvironment
-
getDefault
public static RuntimeEnvironmentBuilder getDefault(String groupId, String artifactId, String version, String kbaseName, String ksessionName)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on:- DefaultRuntimeEnvironment
- Parameters:
groupId
- group id of kjarartifactId
- artifact id of kjarversion
- version number of kjarkbaseName
- name of the kbase defined in kmodule.xml stored in kjarksessionName
- name of the ksession define in kmodule.xml stored in kjar- Returns:
- new instance of
RuntimeEnvironmentBuilder
that is already preconfigured with defaults - See Also:
DefaultRuntimeEnvironment
-
getDefault
public static RuntimeEnvironmentBuilder getDefault(org.kie.api.builder.ReleaseId releaseId)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on:- DefaultRuntimeEnvironment
- Parameters:
releaseId
-ReleaseId
that described the kjar- Returns:
- new instance of
RuntimeEnvironmentBuilder
that is already preconfigured with defaults - See Also:
DefaultRuntimeEnvironment
-
getDefault
public static RuntimeEnvironmentBuilder getDefault(org.kie.api.builder.ReleaseId releaseId, String kbaseName, String ksessionName)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on:- DefaultRuntimeEnvironment
- Parameters:
releaseId
-ReleaseId
that described the kjarkbaseName
- name of the kbase defined in kmodule.xml stored in kjarksessionName
- name of the ksession define in kmodule.xml stored in kjar- Returns:
- new instance of
RuntimeEnvironmentBuilder
that is already preconfigured with defaults - See Also:
DefaultRuntimeEnvironment
-
getClasspathKmoduleDefault
public static RuntimeEnvironmentBuilder getClasspathKmoduleDefault()
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on:- DefaultRuntimeEnvironment
- Returns:
- new instance of
RuntimeEnvironmentBuilder
that is already preconfigured with defaults - See Also:
DefaultRuntimeEnvironment
-
getClasspathKmoduleDefault
public static RuntimeEnvironmentBuilder getClasspathKmoduleDefault(String kbaseName, String ksessionName)
Provides default configuration ofRuntimeEnvironmentBuilder
that is based on:- DefaultRuntimeEnvironment
- Parameters:
kbaseName
- name of the kbase defined in kmodule.xmlksessionName
- name of the ksession define in kmodule.xml- Returns:
- new instance of
RuntimeEnvironmentBuilder
that is already preconfigured with defaults - See Also:
DefaultRuntimeEnvironment
-
persistence
public RuntimeEnvironmentBuilder persistence(boolean persistenceEnabled)
- Specified by:
persistence
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
entityManagerFactory
public RuntimeEnvironmentBuilder entityManagerFactory(Object emf)
- Specified by:
entityManagerFactory
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
addAsset
public RuntimeEnvironmentBuilder addAsset(org.kie.api.io.Resource asset, org.kie.api.io.ResourceType type)
- Specified by:
addAsset
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
addEnvironmentEntry
public RuntimeEnvironmentBuilder addEnvironmentEntry(String name, Object value)
- Specified by:
addEnvironmentEntry
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
addConfiguration
public RuntimeEnvironmentBuilder addConfiguration(String name, String value)
- Specified by:
addConfiguration
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
knowledgeBase
public RuntimeEnvironmentBuilder knowledgeBase(org.kie.api.KieBase kbase)
- Specified by:
knowledgeBase
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
userGroupCallback
public RuntimeEnvironmentBuilder userGroupCallback(org.kie.api.task.UserGroupCallback callback)
- Specified by:
userGroupCallback
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
userInfo
public RuntimeEnvironmentBuilder userInfo(org.kie.api.task.UserInfo userInfo)
- Specified by:
userInfo
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
mapper
public RuntimeEnvironmentBuilder mapper(org.kie.internal.runtime.manager.Mapper mapper)
-
registerableItemsFactory
public RuntimeEnvironmentBuilder registerableItemsFactory(org.kie.api.runtime.manager.RegisterableItemsFactory factory)
- Specified by:
registerableItemsFactory
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
get
public org.kie.internal.runtime.manager.RuntimeEnvironment get()
- Specified by:
get
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
schedulerService
public RuntimeEnvironmentBuilder schedulerService(Object globalScheduler)
- Specified by:
schedulerService
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
classLoader
public RuntimeEnvironmentBuilder classLoader(ClassLoader cl)
- Specified by:
classLoader
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilder
-
newEmptyBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newEmptyBuilder()
- Specified by:
newEmptyBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
newDefaultBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newDefaultBuilder()
- Specified by:
newDefaultBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
newDefaultInMemoryBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newDefaultInMemoryBuilder()
- Specified by:
newDefaultInMemoryBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
newDefaultBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newDefaultBuilder(String groupId, String artifactId, String version)
- Specified by:
newDefaultBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
newDefaultBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newDefaultBuilder(String groupId, String artifactId, String version, String kbaseName, String ksessionName)
- Specified by:
newDefaultBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
newDefaultBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newDefaultBuilder(org.kie.api.builder.ReleaseId releaseId)
- Specified by:
newDefaultBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
newDefaultBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newDefaultBuilder(org.kie.api.builder.ReleaseId releaseId, String kbaseName, String ksessionName)
- Specified by:
newDefaultBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
newClasspathKmoduleDefaultBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newClasspathKmoduleDefaultBuilder()
- Specified by:
newClasspathKmoduleDefaultBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
newClasspathKmoduleDefaultBuilder
public org.kie.api.runtime.manager.RuntimeEnvironmentBuilder newClasspathKmoduleDefaultBuilder(String kbaseName, String ksessionName)
- Specified by:
newClasspathKmoduleDefaultBuilder
in interfaceorg.kie.api.runtime.manager.RuntimeEnvironmentBuilderFactory
-
-