org.jbpm.process.audit
Class JPAAuditLogService
java.lang.Object
org.jbpm.process.audit.JPAAuditLogService
- All Implemented Interfaces:
- AuditLogService
public class JPAAuditLogService
- extends Object
- implements AuditLogService
The idea here is that we have a entity manager factory (similar to a session factory)
that we repeatedly use to generate an entity manager (which is a persistence context)
for the specific service command.
While ProcessInstanceLog (and other *Log) entities do not contain LOB's
(which sometimes necessitate the use of tx's even in read situations),
we use transactions here none-the-less, just to be safe. Obviously, if
there is already a running transaction present, we don't do anything
to it.
At the end of every command, we make sure to close the entity manager
we've been using -- which also means that we detach any entities that
might be associated with the entity manager/persistence context.
After all, this is a service which means our philosophy here
is to provide a real interface, and not a leaky one.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JPAAuditLogService
public JPAAuditLogService()
JPAAuditLogService
public JPAAuditLogService(Environment env,
PersistenceStrategyType type)
JPAAuditLogService
public JPAAuditLogService(Environment env)
JPAAuditLogService
public JPAAuditLogService(javax.persistence.EntityManagerFactory emf)
JPAAuditLogService
public JPAAuditLogService(javax.persistence.EntityManagerFactory emf,
PersistenceStrategyType type)
setPersistenceUnitName
public void setPersistenceUnitName(String persistenceUnitName)
getPersistenceUnitName
public String getPersistenceUnitName()
findProcessInstances
public List<ProcessInstanceLog> findProcessInstances()
- Description copied from interface:
AuditLogService
- Service methods
- Specified by:
findProcessInstances
in interface AuditLogService
- Returns:
findProcessInstances
public List<ProcessInstanceLog> findProcessInstances(String processId)
- Specified by:
findProcessInstances
in interface AuditLogService
findActiveProcessInstances
public List<ProcessInstanceLog> findActiveProcessInstances(String processId)
- Specified by:
findActiveProcessInstances
in interface AuditLogService
findProcessInstance
public ProcessInstanceLog findProcessInstance(long processInstanceId)
- Specified by:
findProcessInstance
in interface AuditLogService
findSubProcessInstances
public List<ProcessInstanceLog> findSubProcessInstances(long processInstanceId)
- Specified by:
findSubProcessInstances
in interface AuditLogService
findNodeInstances
public List<NodeInstanceLog> findNodeInstances(long processInstanceId)
- Specified by:
findNodeInstances
in interface AuditLogService
findNodeInstances
public List<NodeInstanceLog> findNodeInstances(long processInstanceId,
String nodeId)
- Specified by:
findNodeInstances
in interface AuditLogService
findVariableInstances
public List<VariableInstanceLog> findVariableInstances(long processInstanceId)
- Specified by:
findVariableInstances
in interface AuditLogService
findVariableInstances
public List<VariableInstanceLog> findVariableInstances(long processInstanceId,
String variableId)
- Specified by:
findVariableInstances
in interface AuditLogService
findVariableInstancesByName
public List<VariableInstanceLog> findVariableInstancesByName(String variableId,
boolean onlyActiveProcesses)
- Specified by:
findVariableInstancesByName
in interface AuditLogService
findVariableInstancesByNameAndValue
public List<VariableInstanceLog> findVariableInstancesByNameAndValue(String variableId,
String value,
boolean onlyActiveProcesses)
- Specified by:
findVariableInstancesByNameAndValue
in interface AuditLogService
clear
public void clear()
- Specified by:
clear
in interface AuditLogService
dispose
public void dispose()
- Specified by:
dispose
in interface AuditLogService
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.