Package es.caib.bpm.servei
Class BpmJobExecutorBase
- java.lang.Object
-
- es.caib.bpm.servei.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
see es.caib.bpm.servei.BpmJobExecutores.caib.bpm.servei.BpmJobExecutor
, provides access to all services and entities referenced by this service.
-
-
Constructor Summary
Constructors Constructor Description BpmJobExecutorBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
anotateFailure(long id, Exception e)
void
executeJob(long id)
com.soffid.iam.bpm.service.BpmJobExecutor
getBpmJobExecutor()
Gets reference tobpmJobExecutor
.List
getJobs(String lockOwner)
Date
getNextDueDate(String lockOwner)
protected Principal
getPrincipal()
Gets the currentprincipal
if one has been set, otherwise returnsnull
.protected abstract void
handleAnotateFailure(long id, Exception e)
protected abstract void
handleExecuteJob(long id)
protected abstract List
handleGetJobs(String lockOwner)
protected abstract Date
handleGetNextDueDate(String lockOwner)
protected abstract void
handleIndexPendingProcesses()
protected abstract boolean
handleLockJob(long id, String lockOwner)
protected abstract void
handleUnlockOverdueJobs(Date threshold)
void
indexPendingProcesses()
boolean
lockJob(long id, String lockOwner)
void
setBpmJobExecutor(com.soffid.iam.bpm.service.BpmJobExecutor bpmJobExecutor)
Sets reference tobpmJobExecutor
.void
unlockOverdueJobs(Date threshold)
-
-
-
Method Detail
-
setBpmJobExecutor
public void setBpmJobExecutor(com.soffid.iam.bpm.service.BpmJobExecutor bpmJobExecutor)
Sets reference tobpmJobExecutor
.
-
getBpmJobExecutor
public com.soffid.iam.bpm.service.BpmJobExecutor getBpmJobExecutor()
Gets reference tobpmJobExecutor
.
-
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 interfacees.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 interfacees.caib.bpm.servei.BpmJobExecutor
- Throws:
es.caib.seycon.ng.exception.InternalErrorException
-
handleGetNextDueDate
protected abstract Date handleGetNextDueDate(String lockOwner) throws Exception
- Throws:
Exception
-
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 interfacees.caib.bpm.servei.BpmJobExecutor
- Throws:
es.caib.seycon.ng.exception.InternalErrorException
-
handleGetJobs
protected abstract List handleGetJobs(String lockOwner) throws Exception
- Throws:
Exception
-
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 interfacees.caib.bpm.servei.BpmJobExecutor
- Throws:
es.caib.seycon.ng.exception.InternalErrorException
-
handleAnotateFailure
protected abstract void handleAnotateFailure(long id, Exception e) throws Exception
- Throws:
Exception
-
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 interfacees.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 interfacees.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 interfacees.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 currentprincipal
if one has been set, otherwise returnsnull
.- Returns:
- the current principal
-
-