Class BpmJobExecutorBase

  • All Implemented Interfaces:
    es.caib.bpm.servei.BpmJobExecutor

    public abstract class BpmJobExecutorBase
    extends Object
    implements es.caib.bpm.servei.BpmJobExecutor

    Spring Service base class for es.caib.bpm.servei.BpmJobExecutor, provides access to all services and entities referenced by this service.

    see es.caib.bpm.servei.BpmJobExecutor
    • Constructor Detail

      • BpmJobExecutorBase

        public BpmJobExecutorBase()
    • Method Detail

      • setBpmJobExecutor

        public void setBpmJobExecutor​(com.soffid.iam.bpm.service.BpmJobExecutor bpmJobExecutor)
        Sets reference to bpmJobExecutor.
      • getBpmJobExecutor

        public com.soffid.iam.bpm.service.BpmJobExecutor getBpmJobExecutor()
        Gets reference to bpmJobExecutor.
      • lockJob

        @Transactional(isolation=DEFAULT,
                       propagation=REQUIRES_NEW,
                       rollbackFor=java.lang.Exception.class)
        public boolean lockJob​(long id,
                               String lockOwner)
                        throws es.caib.seycon.ng.exception.InternalErrorException,
                               es.caib.seycon.ng.exception.InternalErrorException,
                               Exception
        Specified by:
        lockJob in interface es.caib.bpm.servei.BpmJobExecutor
        Throws:
        es.caib.seycon.ng.exception.InternalErrorException
        Exception
      • handleLockJob

        protected abstract boolean handleLockJob​(long id,
                                                 String lockOwner)
                                          throws Exception
        Throws:
        Exception
      • getNextDueDate

        @Transactional(isolation=DEFAULT,
                       propagation=REQUIRES_NEW,
                       rollbackFor=java.lang.Exception.class)
        public Date getNextDueDate​(String lockOwner)
                            throws es.caib.seycon.ng.exception.InternalErrorException,
                                   es.caib.seycon.ng.exception.InternalErrorException
        Specified by:
        getNextDueDate in interface es.caib.bpm.servei.BpmJobExecutor
        Throws:
        es.caib.seycon.ng.exception.InternalErrorException
      • getJobs

        @Transactional(isolation=DEFAULT,
                       propagation=REQUIRES_NEW,
                       rollbackFor=java.lang.Exception.class)
        public List getJobs​(String lockOwner)
                     throws es.caib.seycon.ng.exception.InternalErrorException,
                            es.caib.seycon.ng.exception.InternalErrorException
        Specified by:
        getJobs in interface es.caib.bpm.servei.BpmJobExecutor
        Throws:
        es.caib.seycon.ng.exception.InternalErrorException
      • anotateFailure

        @Transactional(isolation=DEFAULT,
                       propagation=REQUIRES_NEW,
                       rollbackFor=java.lang.Exception.class)
        public void anotateFailure​(long id,
                                   Exception e)
                            throws es.caib.seycon.ng.exception.InternalErrorException,
                                   es.caib.seycon.ng.exception.InternalErrorException
        Specified by:
        anotateFailure in interface es.caib.bpm.servei.BpmJobExecutor
        Throws:
        es.caib.seycon.ng.exception.InternalErrorException
      • executeJob

        @Transactional(isolation=DEFAULT,
                       propagation=REQUIRES_NEW,
                       rollbackFor=java.lang.Exception.class)
        public void executeJob​(long id)
                        throws es.caib.seycon.ng.exception.InternalErrorException,
                               es.caib.seycon.ng.exception.InternalErrorException,
                               Exception
        Specified by:
        executeJob in interface es.caib.bpm.servei.BpmJobExecutor
        Throws:
        es.caib.seycon.ng.exception.InternalErrorException
        Exception
      • handleExecuteJob

        protected abstract void handleExecuteJob​(long id)
                                          throws Exception
        Throws:
        Exception
      • indexPendingProcesses

        @Transactional(isolation=DEFAULT,
                       propagation=REQUIRES_NEW,
                       rollbackFor=java.lang.Exception.class)
        public void indexPendingProcesses()
                                   throws es.caib.seycon.ng.exception.InternalErrorException,
                                          es.caib.seycon.ng.exception.InternalErrorException
        Specified by:
        indexPendingProcesses in interface es.caib.bpm.servei.BpmJobExecutor
        Throws:
        es.caib.seycon.ng.exception.InternalErrorException
      • handleIndexPendingProcesses

        protected abstract void handleIndexPendingProcesses()
                                                     throws Exception
        Throws:
        Exception
      • unlockOverdueJobs

        @Transactional(isolation=DEFAULT,
                       propagation=REQUIRES_NEW,
                       rollbackFor=java.lang.Exception.class)
        public void unlockOverdueJobs​(Date threshold)
                               throws es.caib.seycon.ng.exception.InternalErrorException,
                                      es.caib.seycon.ng.exception.InternalErrorException
        Specified by:
        unlockOverdueJobs in interface es.caib.bpm.servei.BpmJobExecutor
        Throws:
        es.caib.seycon.ng.exception.InternalErrorException
      • handleUnlockOverdueJobs

        protected abstract void handleUnlockOverdueJobs​(Date threshold)
                                                 throws Exception
        Throws:
        Exception
      • getPrincipal

        protected Principal getPrincipal()
        Gets the current principal if one has been set, otherwise returns null.
        Returns:
        the current principal