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


Java AlfrescoTransactionSupport.isActualTransactionActive方法代码示例

本文整理汇总了Java中org.alfresco.repo.transaction.AlfrescoTransactionSupport.isActualTransactionActive方法的典型用法代码示例。如果您正苦于以下问题:Java AlfrescoTransactionSupport.isActualTransactionActive方法的具体用法?Java AlfrescoTransactionSupport.isActualTransactionActive怎么用?Java AlfrescoTransactionSupport.isActualTransactionActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.repo.transaction.AlfrescoTransactionSupport的用法示例。


在下文中一共展示了AlfrescoTransactionSupport.isActualTransactionActive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
public void execute()
{
    if(state != STATE.START)
    {
        throw new IllegalStateException("Patch is already being applied");
    }

    if(!patch.requiresTransaction() && AlfrescoTransactionSupport.isActualTransactionActive())
    {
        throw new AlfrescoRuntimeException("Patch " +
                patch.getId() +
                " has been configured with requiresTransaction set to false but is being called in a transaction");
    }

    setup();
    applyPatch();
    save();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:PatchServiceImpl.java

示例2: setUp

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception
{
    ctx = ApplicationContextHelper.getApplicationContext();
    if (AlfrescoTransactionSupport.isActualTransactionActive())
    {
        fail("Test started with transaction in progress");
    }
    
    transactionService = (TransactionService) ctx.getBean("transactionComponent");
    repoUsageComponent = (RepoUsageComponent) ctx.getBean("repoUsageComponent");
    jobLockService = (JobLockService) ctx.getBean("jobLockService");
    
    AuthenticationUtil.setRunAsUserSystem();
    
    txn = transactionService.getUserTransaction();
    txn.begin();
    
    restrictionsBefore = repoUsageComponent.getRestrictions();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:RepoUsageComponentTest.java

示例3: setUp

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
protected void setUp() throws Exception
{
    applicationContext = ApplicationContextHelper.getApplicationContext();
    if (AlfrescoTransactionSupport.isActualTransactionActive())
    {
        fail("Test started with transaction in progress");
    }
    
    nodeService = (NodeService)applicationContext.getBean("NodeService");
    authenticationService = (MutableAuthenticationService)applicationContext.getBean("authenticationService");   
    transactionService = (TransactionService)applicationContext.getBean("transactionComponent");
    personService = (PersonService)applicationContext.getBean("PersonService");
    contentService = (ContentService)applicationContext.getBean("ContentService");
    contentUsageService = (ContentUsageService)applicationContext.getBean("ContentUsageService");
    
    userUsageTrackingComponent = (UserUsageTrackingComponent)applicationContext.getBean("userUsageTrackingComponent");
    
    // Enable
    ContentUsageImpl contentUsage = (ContentUsageImpl)applicationContext.getBean("contentUsageImpl");
    contentUsage.setEnabled(true);
    contentUsage.init();
    userUsageTrackingComponent.setEnabled(true);
    userUsageTrackingComponent.init();
    userUsageTrackingComponent.bootstrapInternal();
    
    AuthenticationUtil.setRunAsUserSystem();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:UserUsageTrackingComponentTest.java

示例4: setUp

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
protected void setUp() throws Exception
{
    applicationContext = ApplicationContextHelper.getApplicationContext();
    if (AlfrescoTransactionSupport.isActualTransactionActive())
    {
        fail("Test started with transaction in progress");
    }
    
    nodeService = (NodeService) applicationContext.getBean("nodeService");
    fileFolderService = (FileFolderService) applicationContext.getBean("fileFolderService");
    
    authenticationService = (MutableAuthenticationService) applicationContext.getBean("authenticationService");
    authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
    
    authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
    authenticationDAO = (MutableAuthenticationDao) applicationContext.getBean("authenticationDao");
    transactionService = (TransactionService) applicationContext.getBean("transactionComponent");
    
    contentService = (ContentService) applicationContext.getBean("contentService");
    personService = (PersonService) applicationContext.getBean("personService");
    
    contentUsageImpl = (ContentUsageImpl) applicationContext.getBean("contentUsageImpl");
    usageService = (UsageService) applicationContext.getBean("usageService");
    
    ownableService = (OwnableService) applicationContext.getBean("ownableService");
    
    repoAdminService = (RepoAdminService) applicationContext.getBean("repoAdminService");
    
    testTX = transactionService.getUserTransaction();
    testTX.begin();
    this.authenticationComponent.setSystemUserAsCurrentUser();
    
    // get default store (as configured for content usage service)
    StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
    rootNodeRef = nodeService.getRootNode(storeRef);
    
    // create test users
    createTestUsers();
    
    // deploy custom model
    InputStream modelStream = getClass().getClassLoader().getResourceAsStream("tenant/exampleModel.xml");
    repoAdminService.deployModel(modelStream, "exampleModel.xml");
    
    testTX.commit();
    
    authenticationComponent.clearCurrentSecurityContext();
    
    testTX = transactionService.getUserTransaction();
    testTX.begin();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:51,代码来源:UserUsageTest.java


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