Class RuntimeEnvironmentFactoryBean

  • All Implemented Interfaces:
    org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

    public class RuntimeEnvironmentFactoryBean
    extends Object
    implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean
    Factory responsible for producing instances of RuntimeEnvironment that are consumed by RuntimeManager upon creation. It allows to create following types of RuntimeEnvironment (that mainly means what is configured by default):
    • DEFAULT - default (most common) configuration for RuntimeManager
    • EMPTY - completely empty environment to be manually populated
    • DEFAULT_IN_MEMORY - same as DEFAULT but without persistence of the runtime engine
    • DEFAULT_KJAR - same as DEFAULT but knowledge asset are taken from KJAR identified by releaseid or GAV
    • DEFAULT_KJAR_CL - build directly from classpath that consists kmodule.xml descriptor
    Mandatory properties depends on the type selected but knowledge information must be given for all types. That means that one of the following is provided:
    • knowledgeBase
    • assets
    • releaseId
    • groupId, artifactId, version
    Next for DEFAULT, DEFAULT_KJAR, DEFAULT_KJAR_CL persistence needs to be configured:
    • entity manager factory
    • transaction manager
    Transaction Manager must be Spring transaction manager as based on its presence entire persistence and transaction support is configured.
    Optionally entityManager can be provided to be used instead of always creating new one from EntityManagerFactory - e.g. when using shared entity manager from Spring.
    All other properties are optional and are meant to override the default given by type of the environment selected.
    See Also:
    RuntimeManagerFactoryBean
    • Constructor Detail

      • RuntimeEnvironmentFactoryBean

        public RuntimeEnvironmentFactoryBean()
    • Method Detail

      • getObject

        public Object getObject()
                         throws Exception
        Specified by:
        getObject in interface org.springframework.beans.factory.FactoryBean
        Throws:
        Exception
      • getObjectType

        public Class<?> getObjectType()
        Specified by:
        getObjectType in interface org.springframework.beans.factory.FactoryBean
      • isSingleton

        public boolean isSingleton()
        Specified by:
        isSingleton in interface org.springframework.beans.factory.FactoryBean
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • checkPersistence

        protected void checkPersistence()
      • checkKnowledge

        protected void checkKnowledge()
      • checkKjar

        protected void checkKjar()
      • getType

        public String getType()
      • setType

        public void setType​(String type)
      • getEntityManagerFactory

        public javax.persistence.EntityManagerFactory getEntityManagerFactory()
      • setEntityManagerFactory

        public void setEntityManagerFactory​(javax.persistence.EntityManagerFactory entityManagerFactory)
      • getEntityManager

        public javax.persistence.EntityManager getEntityManager()
      • setEntityManager

        public void setEntityManager​(javax.persistence.EntityManager entityManager)
      • getTransactionManager

        public org.springframework.transaction.PlatformTransactionManager getTransactionManager()
      • setTransactionManager

        public void setTransactionManager​(org.springframework.transaction.PlatformTransactionManager transactionManager)
      • getKnowledgeBase

        public org.kie.api.KieBase getKnowledgeBase()
      • setKnowledgeBase

        public void setKnowledgeBase​(org.kie.api.KieBase knowledgeBase)
      • getAssets

        public Map<org.kie.api.io.Resource,​org.kie.api.io.ResourceType> getAssets()
      • setAssets

        public void setAssets​(Map<org.kie.api.io.Resource,​org.kie.api.io.ResourceType> assets)
      • getReleaseId

        public org.kie.api.builder.ReleaseId getReleaseId()
      • setReleaseId

        public void setReleaseId​(org.kie.api.builder.ReleaseId releaseId)
      • getGroupId

        public String getGroupId()
      • setGroupId

        public void setGroupId​(String groupId)
      • getArtifactId

        public String getArtifactId()
      • setArtifactId

        public void setArtifactId​(String artifactId)
      • getVersion

        public String getVersion()
      • setVersion

        public void setVersion​(String version)
      • getKbaseName

        public String getKbaseName()
      • setKbaseName

        public void setKbaseName​(String kbaseName)
      • getKsessionName

        public String getKsessionName()
      • setKsessionName

        public void setKsessionName​(String ksessionName)
      • getEnvironmentEntries

        public Map<String,​Object> getEnvironmentEntries()
      • setEnvironmentEntries

        public void setEnvironmentEntries​(Map<String,​Object> environmentEntries)
      • setConfiguration

        public void setConfiguration​(Map<String,​String> configuration)
      • getUserGroupCallback

        public org.kie.api.task.UserGroupCallback getUserGroupCallback()
      • setUserGroupCallback

        public void setUserGroupCallback​(org.kie.api.task.UserGroupCallback userGroupCallback)
      • getUserInfo

        public org.kie.internal.task.api.UserInfo getUserInfo()
      • setUserInfo

        public void setUserInfo​(org.kie.internal.task.api.UserInfo userInfo)
      • getTaskService

        public org.kie.api.task.TaskService getTaskService()
      • setTaskService

        public void setTaskService​(org.kie.api.task.TaskService taskService)
      • getRegisterableItemsFactory

        public org.kie.api.runtime.manager.RegisterableItemsFactory getRegisterableItemsFactory()
      • setRegisterableItemsFactory

        public void setRegisterableItemsFactory​(org.kie.api.runtime.manager.RegisterableItemsFactory registerableItemsFactory)
      • setClassLoader

        public void setClassLoader​(ClassLoader classLoader)
      • getSchedulerService

        public org.jbpm.process.core.timer.GlobalSchedulerService getSchedulerService()
      • setSchedulerService

        public void setSchedulerService​(org.jbpm.process.core.timer.GlobalSchedulerService schedulerService)
      • getPessimisticLocking

        public boolean getPessimisticLocking()
      • setPessimisticLocking

        public void setPessimisticLocking​(boolean pessimisticLocking)