本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}