本文整理汇总了Java中org.alfresco.repo.transaction.AlfrescoTransactionSupport.bindIntegrityChecker方法的典型用法代码示例。如果您正苦于以下问题:Java AlfrescoTransactionSupport.bindIntegrityChecker方法的具体用法?Java AlfrescoTransactionSupport.bindIntegrityChecker怎么用?Java AlfrescoTransactionSupport.bindIntegrityChecker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.repo.transaction.AlfrescoTransactionSupport
的用法示例。
在下文中一共展示了AlfrescoTransactionSupport.bindIntegrityChecker方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: save
import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
/**
* Ensures that this service is registered with the transaction and saves the event
*
* @param event IntegrityEvent
*/
@SuppressWarnings("unchecked")
private void save(IntegrityEvent event)
{
// optionally set trace
if (traceOn)
{
// get a stack trace
Throwable t = new Throwable();
t.fillInStackTrace();
StackTraceElement[] trace = t.getStackTrace();
event.addTrace(trace);
// done
}
// register this service
AlfrescoTransactionSupport.bindIntegrityChecker(this);
// get the event list
Map<IntegrityEvent, IntegrityEvent> events =
(Map<IntegrityEvent, IntegrityEvent>) AlfrescoTransactionSupport.getResource(KEY_EVENT_SET);
if (events == null)
{
events = new HashMap<IntegrityEvent, IntegrityEvent>(113, 0.75F);
AlfrescoTransactionSupport.bindResource(KEY_EVENT_SET, events);
}
// check if the event is present
IntegrityEvent existingEvent = events.get(event);
if (existingEvent != null)
{
// the event (or its equivalent is already present - transfer the trace
if (traceOn)
{
existingEvent.getTraces().addAll(event.getTraces());
}
}
else
{
// the event doesn't already exist
events.put(event, event);
}
if (logger.isDebugEnabled())
{
logger.debug("" + (existingEvent != null ? "Event already present in" : "Added event to") + " event set: \n" +
" event: " + event);
}
}