当前位置: 首页>>代码示例>>Java>>正文


Java AlfrescoTransactionSupport.bindIntegrityChecker方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:53,代码来源:IntegrityChecker.java


注:本文中的org.alfresco.repo.transaction.AlfrescoTransactionSupport.bindIntegrityChecker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。