本文整理汇总了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;
}));
}
示例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);
}
}
示例3: observeAfterTransactionCompletion
public void observeAfterTransactionCompletion(@Observes(during = TransactionPhase.AFTER_SUCCESS) @Transaction String message) {
System.out.println("Message from within transaction received after success: " + message);
}
示例4: saveAuditLogEntries
public void saveAuditLogEntries(
@Observes(during = TransactionPhase.AFTER_SUCCESS) AuditLogEntries logData) {
dao.saveAuditLog(logData.getAuditLogEntries());
}
示例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);
}