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


Java TransactionAttributeType.REQUIRES_NEW属性代码示例

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


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

示例1: initTimers_internal

/**
 * Initialize the timer for polling for the services
 */
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void initTimers_internal() {
    Collection<Timer> timers = timerService.getTimers();
    boolean appTimerExist = false;
    for (Timer timerAPP : timers) {
    	if (APP_TIMER_INFO.equals(timerAPP.getInfo())) {
    		appTimerExist = true;
    	}
    }
    if (!appTimerExist) {
        logger.info("Timer create.");
        try {
            String timerIntervalSetting = configService
                    .getProxyConfigurationSetting(
                            PlatformConfigurationKey.APP_TIMER_INTERVAL);
            long interval = Long.parseLong(timerIntervalSetting);
            timerService.createTimer(0, interval, APP_TIMER_INFO);
        } catch (ConfigurationException e) {
            timerService.createTimer(0, DEFAULT_TIMER_INTERVAL,
                    APP_TIMER_INFO);
            logger.info(
                    "Timer interval not set, switch to default 15 sec.");
        }
    }
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:28,代码来源:APPTimerServiceBean.java

示例2: importUser

@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void importUser(VOUserDetails user, String marketplaceId)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        ObjectNotFoundException {
    try {
        Marketplace marketplace = getMarketplace(marketplaceId);
        Organization organization = getOrganization(
                user.getOrganizationId());
        String password = new PasswordGenerator().generatePassword();
        if (organization != null && organization.getTenant() != null) {
            user.setTenantId(organization.getTenant().getTenantId());
        }
        addPlatformUser(user, organization, password,
                UserAccountStatus.PASSWORD_MUST_BE_CHANGED, true, true,
                marketplace, true);
    } catch (NonUniqueBusinessKeyException | MailOperationException
            | ValidationException | UserRoleAssignmentException e) {
        sessionCtx.setRollbackOnly();
        throw e;
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:23,代码来源:IdentityServiceBean.java

示例3: performSupplierSharesCalculationRun

@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void performSupplierSharesCalculationRun(long startOfLastMonth,
        long endOfLastMonth, Long supplierKey) throws Exception {

    SupplierShareResultAssembler assembler = new SupplierShareResultAssembler(
            sharesRetrievalService);
    SupplierRevenueShareResult supplierShareResult = assembler.build(
            supplierKey, startOfLastMonth, endOfLastMonth);

    supplierShareResult.calculateAllShares();

    saveBillingSharesResult(startOfLastMonth, endOfLastMonth,
            BillingSharesResultType.SUPPLIER, supplierShareResult,
            supplierKey);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:16,代码来源:SharesCalculatorBean.java

示例4: abortAsyncSubscription

@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void abortAsyncSubscription(UUID subscriptionUUID)
        throws ObjectNotFoundException, SubscriptionStateException,
        OrganizationAuthoritiesException, OperationNotPermittedException {

    ArgumentValidator.notNull("subscriptionUUID", subscriptionUUID);

    VOSubscription subscription = getSubscription(subscriptionUUID);
    if (subscription == null) {
        throw new ObjectNotFoundException("Subscription with UUID "
                + subscriptionUUID + " not found!");
    }

    completeAsyncSubscription(subscription.getSubscriptionId(),
            subscription.getOrganizationId(), null,
            false);

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:SubscriptionServiceBean.java

示例5: completeAsyncSubscription

@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void completeAsyncSubscription(UUID subscriptionUUID,
        VOInstanceInfo instanceInfo) throws ObjectNotFoundException,
        SubscriptionStateException, TechnicalServiceNotAliveException,
        TechnicalServiceOperationException,
        OrganizationAuthoritiesException, OperationNotPermittedException,
        ValidationException {

    ArgumentValidator.notNull("subscriptionUUID", subscriptionUUID);
    ArgumentValidator.notNull("instance", instanceInfo);

    VOSubscription subscription = getSubscription(subscriptionUUID);

    if (subscription == null) {
        throw new ObjectNotFoundException("Subscription with UUID "
                + subscriptionUUID + " not found!");
    }

    completeAsynProvisioning(instanceInfo, subscription.getSubscriptionId(),
            subscription.getOrganizationId(), false);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:22,代码来源:SubscriptionServiceBean.java

示例6: deleteInstance

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void deleteInstance(ServiceInstance serviceInstance)
        throws ServiceInstanceNotFoundException {
    ServiceInstance dbInstance = find(serviceInstance);
    em.remove(dbInstance);
    em.flush();
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:7,代码来源:ServiceInstanceDAO.java

示例7: getAllProjects

@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public List<Projet> getAllProjects() {
	List<Projet> list = entityManager.createNamedQuery("Projet.findAll", Projet.class).getResultList();
	List<Projet> listOut = new ArrayList<>();
	for (Projet projet : list) {
		listOut.add(computeDonValue(projet));
	}

	return listOut;
}
 
开发者ID:imie-source,项目名称:CDPN-N-07-SHARE,代码行数:11,代码来源:ProjetBusiness.java

示例8: cancelTimers

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void cancelTimers() {
    Collection<Timer> timers = timerService.getTimers();
    for (Timer th : timers) {
        if (APP_TIMER_INFO.equals(th.getInfo())) {
            th.cancel();
            return;
        }
    }
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:10,代码来源:APPTimerServiceBean.java

示例9: lockServiceInstance

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public boolean lockServiceInstance(String controllerId, String instanceId)
        throws APPlatformException {
    LOGGER.debug("try to lock service instance {}", instanceId);

    ServiceInstance lockedService = instanceDAO
            .getLockedInstanceForController(controllerId);
    if (lockedService != null) {
        if (!lockedService.getInstanceId().equals(instanceId)) {
            LOGGER.debug("other service is already locked ({}).",
                    lockedService.getInstanceId());
            return false;
        }

        LOGGER.debug("Service is already locked");
        return true;
    }

    ServiceInstance service = null;
    try {
        service = instanceDAO.getInstanceById(controllerId, instanceId);
    } catch (ServiceInstanceNotFoundException e) {
        throw new APPlatformException(e.getMessage());
    }
    service.setLocked(true);
    em.flush();

    LOGGER.debug("Locked successfully.");
    return true;
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:30,代码来源:APPConcurrencyServiceBean.java

示例10: setStatus

/**
 * Internal method to change the status even if the caller set the
 * transaction to rollback only.
 *
 * @see AccountServiceLocal#removeOverdueOrganization(Organization)
 */
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void setStatus(long triggerProcessKey, TriggerProcessStatus status)
    throws ObjectNotFoundException {

    TriggerProcess proc = dm.getReference(TriggerProcess.class,
        triggerProcessKey);
    proc.setState(status);

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:16,代码来源:TriggerServiceBean.java

示例11: storeControllerConfigurationSettings

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void storeControllerConfigurationSettings(String controllerId,
        HashMap<String, Setting> settings) throws ConfigurationException {

    LOGGER.debug("Storing configuration settings for controller '{}'",
            controllerId);
    if (controllerId == null || settings == null) {
        throw new IllegalArgumentException("All parameters must be set");
    }
    Query query = em
            .createNamedQuery("ConfigurationSetting.getForController");
    query.setParameter("controllerId", controllerId);
    List<?> resultList = query.getResultList();
    for (Object entry : resultList) {
        ConfigurationSetting setting = (ConfigurationSetting) entry;
        String key = setting.getSettingKey();
        if (settings.containsKey(key)) {
            if (settings.get(key) == null
                    || settings.get(key).getValue() == null) {
                em.remove(setting);
            } else {
                setting.setDecryptedValue(settings.get(key).getValue());
                em.persist(setting);
            }
            settings.remove(key);
        }
    }
    for (String newKey : settings.keySet()) {
        ConfigurationSetting newSetting = new ConfigurationSetting();
        newSetting.setControllerId(controllerId);
        newSetting.setSettingKey(newKey);
        newSetting.setDecryptedValue(settings.get(newKey) != null
                ? settings.get(newKey).getValue() : null);
        em.persist(newSetting);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:36,代码来源:APPConfigurationServiceBean.java

示例12: restoreInstance

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void restoreInstance(ServiceInstance instance)
        throws ServiceInstanceNotFoundException {
    ServiceInstance dbInstance = find(instance);
    dbInstance.unmarkForDeletion();
    em.flush();

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:8,代码来源:ServiceInstanceDAO.java

示例13: storeControllerOrganizations

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void storeControllerOrganizations(
        HashMap<String, String> controllerOrganizations) {

    LOGGER.debug("Storing configured controllers");
    Query query = em
            .createNamedQuery("ConfigurationSetting.getControllersForKey");
    query.setParameter("key",
            ControllerConfigurationKey.BSS_ORGANIZATION_ID.name());
    List<?> resultList = query.getResultList();
    for (Object entry : resultList) {
        ConfigurationSetting currentCs = (ConfigurationSetting) entry;
        String cId = currentCs.getControllerId();
        if (controllerOrganizations.containsKey(cId)) {
            String value = controllerOrganizations.get(cId);
            if (value == null || value.trim().length() == 0) {
                em.remove(currentCs);
            } else {
                currentCs.setSettingValue(value);
                em.persist(currentCs);
            }
            controllerOrganizations.remove(cId);
        }
    }
    for (String key : controllerOrganizations.keySet()) {
        if (controllerOrganizations.get(key) != null
                && controllerOrganizations.get(key).trim().length() > 0) {
            ConfigurationSetting newSetting = new ConfigurationSetting();
            newSetting.setControllerId(key);
            newSetting.setSettingKey(
                    ControllerConfigurationKey.BSS_ORGANIZATION_ID.name());
            newSetting.setSettingValue(controllerOrganizations.get(key));
            em.persist(newSetting);
        }
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:36,代码来源:APPConfigurationServiceBean.java

示例14: isPresent

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public boolean isPresent(String name){
    return em.find(Foo.class, name) != null;
}
 
开发者ID:arcuri82,项目名称:testing_security_development_enterprise_systems,代码行数:4,代码来源:EJB_10_multi_base.java

示例15: createOneProject

@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public Projet createOneProject(Projet projet) {
	entityManager.persist(projet);
	return projet;
}
 
开发者ID:imie-source,项目名称:CDPN-N-07-SHARE,代码行数:6,代码来源:ProjetBusiness.java


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