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


Java TransactionPhase.AFTER_SUCCESS属性代码示例

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


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

示例1: executePipeline

/**
 * Executes a pipeline, executing each stage in turn until the pipeline completes, fails or halts while waiting for an asynchronous process to complete.
 * <p>
 * Only pipelines that are in their initial state can be executed, if the pipeline is not in it's initial state it is marked as failed.
 * </p>
 *
 * @param pipeline
 *         the pipeline
 */
@Asynchronous
public void executePipeline(@Observes(during = TransactionPhase.AFTER_SUCCESS) Pipeline pipeline) {
    Throwables.voidInstance(() -> OmakaseSecurity.doAsSystem(() -> {
        if (!pipeline.isFirstPipelineStage() && !PipelineStageStatus.QUEUED.equals(pipeline.getStatusOfCurrentStage())) {
            LOGGER.error("Pipeline " + pipeline.getId() + " is not in it's initial state");
            updatePipeline(PipelineStageResult.builder(pipeline.getId(), PipelineStageStatus.FAILED).addMessages(ImmutableSet.of("The pipeline is not in it's initial state")).build());
        }

        // the first stage is executed outside of recursion as, the recursion relies on the the previous stage
        // being complete before executing the next one which is not the case for the first stage.
        PipelineContext pipelineContext = createPipelineContext(pipeline);
        PipelineStageResult pipelineStageResult = pipelineStageExecutor.execute(pipelineContext, pipeline.getCurrentPipelineStage());

        executePipelineFailureStage(pipelineStageResult);

        Pipeline updatedPipeline = updatePipeline(pipelineStageResult);
        // execute subsequent stages until the pipeline is halted or completed.
        executePipelineStages(updatedPipeline);
        return true;
    }));

}
 
开发者ID:projectomakase,项目名称:omakase,代码行数:31,代码来源:PipelineExecutor.java

示例2: accept

/**
 * Accepts the TalkModificationEvent and sends it to the JMS queue.
 *
 * @param event
 * 		the modification event received after successful transaction phase
 */
@Asynchronous
public void accept(@Observes(during = TransactionPhase.AFTER_SUCCESS) TalkModificationEvent event) {

	try {
		String message = this.createMessage(event);
		this.sendMessage(message);
	} catch (JMSException e) {
		logger.error("Error sending Message to JMS Queue.", e);
	}
}
 
开发者ID:n-moser,项目名称:Conference,代码行数:16,代码来源:TalkModificationEventHandler.java

示例3: observeAfterTransactionCompletion

public void observeAfterTransactionCompletion(@Observes(during = TransactionPhase.AFTER_SUCCESS) @Transaction String message) {
    System.out.println("Message from within transaction received after success: " + message);
}
 
开发者ID:Pscheidl,项目名称:cdi-events-playground,代码行数:3,代码来源:TransactionBoundMessageObserver.java

示例4: saveAuditLogEntries

public void saveAuditLogEntries(
        @Observes(during = TransactionPhase.AFTER_SUCCESS) AuditLogEntries logData) {
    dao.saveAuditLog(logData.getAuditLogEntries());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:4,代码来源:AuditLogServiceBean.java

示例5: carCreated

public void carCreated(@Observes(during = TransactionPhase.AFTER_SUCCESS) Specification spec) {
    createdCars.labels(spec.getColor().name(), spec.getEngine().name()).inc();
}
 
开发者ID:PacktPublishing,项目名称:Architecting-Modern-Java-EE-Applications,代码行数:3,代码来源:ManufacturingStatistics.java

示例6: onSuccessfulOrder

public void onSuccessfulOrder(@Observes(during = TransactionPhase.AFTER_SUCCESS) Order order) {
	System.out.println("Successful order: " + order);
}
 
开发者ID:wesleyegberto,项目名称:javaee_projects,代码行数:3,代码来源:OrderMonitor.java


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