Class TaskServiceFactoryBean

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

    public class TaskServiceFactoryBean
    extends Object
    implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean
    Creates instance of TaskService based on set properties. Following are mandatory properties that must be provided:
    • 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.
    In addition to above there are optional properties that can be set on task service instance:
    • userGroupCallback - implementation of UserGroupCallback to be used, defaults to MVELUserGroupCallbackImpl
    • userInfo - implementation of UserInfo to be used, defaults to DefaultUserInfo
    • listener - list of TaskLifeCycleEventListener that will be notified upon various operations on tasks
    This factory creates single instance of task service only as it's intended to be shared across all other beans in the system.
    • Constructor Detail

      • TaskServiceFactoryBean

        public TaskServiceFactoryBean()
    • 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
      • close

        public void close()
      • checkPersistence

        protected void checkPersistence()
      • 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)
      • 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)
      • getListeners

        public List<org.jbpm.services.task.lifecycle.listeners.TaskLifeCycleEventListener> getListeners()
      • setListeners

        public void setListeners​(List<org.jbpm.services.task.lifecycle.listeners.TaskLifeCycleEventListener> listeners)