Java Code Examples for javax.enterprise.event.TransactionPhase#IN_PROGRESS

The following examples show how to use javax.enterprise.event.TransactionPhase#IN_PROGRESS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ObserverInfo.java    From quarkus with Apache License 2.0 5 votes vote down vote up
static TransactionPhase initTransactionPhase(boolean isAsync, BeanDeployment beanDeployment, MethodInfo observerMethod) {
    AnnotationInstance observesAnnotation = isAsync
            ? beanDeployment.getAnnotation(observerMethod, DotNames.OBSERVES_ASYNC)
            : beanDeployment.getAnnotation(observerMethod, DotNames.OBSERVES);
    AnnotationValue duringValue = observesAnnotation.value("during");
    if (duringValue == null) {
        return TransactionPhase.IN_PROGRESS;
    }
    return TransactionPhase.valueOf(duringValue.asEnum());
}
 
Example 2
Source File: ObserverConfigurator.java    From quarkus with Apache License 2.0 5 votes vote down vote up
public ObserverConfigurator(Consumer<ObserverConfigurator> consumer) {
    this.consumer = consumer;
    this.observedQualifiers = new HashSet<>();
    this.priority = ObserverMethod.DEFAULT_PRIORITY;
    this.isAsync = false;
    this.transactionPhase = TransactionPhase.IN_PROGRESS;
}
 
Example 3
Source File: EventBinder.java    From rabbitmq-cdi with MIT License 5 votes vote down vote up
ExchangeBinding(Class<T> eventType, String exchange) {
  this.eventType = eventType;
  this.exchange = exchange;
  this.headers = new HashMap<>();
  this.encoder = new JsonEncoder<>();
  routingKeyFunction = e -> "";
  transactionPhase = TransactionPhase.IN_PROGRESS;
  errorHandler = nop();
  basicPropertiesBuilder = MessageProperties.BASIC.builder().headers(headers);
  LOGGER.info("Binding created between exchange {} and event type {}", exchange,
      eventType.getSimpleName());
}
 
Example 4
Source File: InjectableObserverMethod.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
default TransactionPhase getTransactionPhase() {
    return TransactionPhase.IN_PROGRESS;
}
 
Example 5
Source File: ObserverTestBean.java    From hibernate-demos with Apache License 2.0 4 votes vote down vote up
public void observesShort(@Observes(during=TransactionPhase.IN_PROGRESS) Short event) {
    sb.append(event);
}