javax.enterprise.event.Reception Java Examples

The following examples show how to use javax.enterprise.event.Reception. 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 6 votes vote down vote up
ObserverInfo(BeanDeployment beanDeployment, DotName beanClass, BeanInfo declaringBean, MethodInfo observerMethod,
        Injection injection,
        MethodParameterInfo eventParameter,
        boolean isAsync, int priority, Reception reception, TransactionPhase transactionPhase,
        Type observedType, Set<AnnotationInstance> qualifiers, Consumer<MethodCreator> notify) {
    this.beanDeployment = beanDeployment;
    this.beanClass = beanClass;
    this.declaringBean = declaringBean;
    this.observerMethod = observerMethod;
    this.injection = injection;
    this.eventParameter = eventParameter;
    this.eventMetadataParameterPosition = initEventMetadataParam(observerMethod);
    this.isAsync = isAsync;
    this.priority = priority;
    this.reception = reception;
    this.transactionPhase = transactionPhase;
    this.observedType = observedType;
    this.qualifiers = qualifiers;
    this.notify = notify;
}
 
Example #2
Source File: WorkerPoolRegistry.java    From smallrye-reactive-messaging with Apache License 2.0 5 votes vote down vote up
public void terminate(
        @Observes(notifyObserver = Reception.IF_EXISTS) @Priority(100) @BeforeDestroyed(ApplicationScoped.class) Object event) {
    if (!workerExecutors.isEmpty()) {
        for (WorkerExecutor executor : workerExecutors.values()) {
            executor.close();
        }
    }
}
 
Example #3
Source File: QuarkusWorkerPoolRegistry.java    From quarkus with Apache License 2.0 5 votes vote down vote up
public void terminate(
        @Observes(notifyObserver = Reception.IF_EXISTS) @Priority(100) @BeforeDestroyed(ApplicationScoped.class) Object event) {
    if (!workerExecutors.isEmpty()) {
        for (WorkerExecutor executor : workerExecutors.values()) {
            executor.close();
        }
    }
}
 
Example #4
Source File: ObserverInfo.java    From quarkus with Apache License 2.0 5 votes vote down vote up
static Reception initReception(boolean isAsync, BeanDeployment beanDeployment, MethodInfo observerMethod) {
    AnnotationInstance observesAnnotation = isAsync
            ? beanDeployment.getAnnotation(observerMethod, DotNames.OBSERVES_ASYNC)
            : beanDeployment.getAnnotation(observerMethod, DotNames.OBSERVES);
    AnnotationValue receptionValue = observesAnnotation.value("notifyObserver");
    if (receptionValue == null) {
        return Reception.ALWAYS;
    }
    return Reception.valueOf(receptionValue.asEnum());
}
 
Example #5
Source File: ObserverInfo.java    From quarkus with Apache License 2.0 5 votes vote down vote up
public ObserverTransformationContext(BuildContext buildContext, AnnotationTarget target,
        Type observedType, Set<AnnotationInstance> qualifiers, Reception reception, TransactionPhase transactionPhase,
        Integer priority, boolean async) {
    super(buildContext, target, qualifiers);
    this.observedType = observedType;
    this.reception = reception;
    this.transactionPhase = transactionPhase;
    this.priority = priority;
    this.async = async;
}
 
Example #6
Source File: BeanDeployment.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private void addSyntheticObserver(ObserverConfigurator configurator) {
    observers.add(ObserverInfo.create(this, configurator.beanClass, null, null, null, null, configurator.observedType,
            configurator.observedQualifiers,
            Reception.ALWAYS, configurator.transactionPhase, configurator.isAsync, configurator.priority,
            observerTransformers, buildContext,
            jtaCapabilities, configurator.notifyConsumer));
}
 
Example #7
Source File: SeatProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeats();
}
 
Example #8
Source File: SeatProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeats();
}
 
Example #9
Source File: SeatTypeProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final SeatType member) {
    retrieveAllSeatTypes();
}
 
Example #10
Source File: SeatProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeats();
}
 
Example #11
Source File: SeatTypeProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final SeatType member) {
    retrieveAllSeatTypes();
}
 
Example #12
Source File: TheatreInfo.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeatsOrderedByName();
}
 
Example #13
Source File: TheatreInfo.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeatsOrderedByName();
}
 
Example #14
Source File: SeatProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeats();
}
 
Example #15
Source File: SeatTypeProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final SeatType member) {
    retrieveAllSeatTypes();
}
 
Example #16
Source File: SeatProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeats();
}
 
Example #17
Source File: SeatTypeProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final SeatType member) {
    retrieveAllSeatTypes();
}
 
Example #18
Source File: MemberListProducer.java    From tutorials with MIT License 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Member member) {
    retrieveAllMembersOrderedByName();
}
 
Example #19
Source File: SeatTypeProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final SeatType member) {
    retrieveAllSeatTypes();
}
 
Example #20
Source File: SeatProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeats();
}
 
Example #21
Source File: SeatTypeProducer.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
public void onListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final SeatType member) {
    retrieveAllSeatTypes();
}
 
Example #22
Source File: MqttServerConnector.java    From smallrye-reactive-messaging with Apache License 2.0 4 votes vote down vote up
public void terminate(
        @Observes(notifyObserver = Reception.IF_EXISTS) @Priority(50) @BeforeDestroyed(ApplicationScoped.class) Object event) {
    if (source != null) {
        source.close();
    }
}
 
Example #23
Source File: ReceptionIfExistsTest.java    From quarkus with Apache License 2.0 4 votes vote down vote up
void observeString(@Priority(1) @Observes(notifyObserver = Reception.IF_EXISTS) String value) {
    EVENTS.add(RequestScopedObserver.class.getName() + value);
}
 
Example #24
Source File: InjectableObserverMethod.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
default Reception getReception() {
    return Reception.ALWAYS;
}
 
Example #25
Source File: ObserverInfo.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public Reception getReception() {
    return reception;
}
 
Example #26
Source File: ObserverInfo.java    From quarkus with Apache License 2.0 4 votes vote down vote up
public Reception getReception() {
    return reception;
}
 
Example #27
Source File: KafkaConnector.java    From smallrye-reactive-messaging with Apache License 2.0 4 votes vote down vote up
public void terminate(
        @Observes(notifyObserver = Reception.IF_EXISTS) @Priority(50) @BeforeDestroyed(ApplicationScoped.class) Object event) {
    sources.forEach(KafkaSource::closeQuietly);
    sinks.forEach(KafkaSink::closeQuietly);
}
 
Example #28
Source File: ExecutionHolder.java    From smallrye-reactive-messaging with Apache License 2.0 4 votes vote down vote up
public void terminate(
        @Observes(notifyObserver = Reception.IF_EXISTS) @Priority(200) @BeforeDestroyed(ApplicationScoped.class) Object event) {
    if (internalVertxInstance) {
        vertx.close().await().indefinitely();
    }
}
 
Example #29
Source File: AmqpConnector.java    From smallrye-reactive-messaging with Apache License 2.0 4 votes vote down vote up
public void terminate(
        @Observes(notifyObserver = Reception.IF_EXISTS) @Priority(50) @BeforeDestroyed(ApplicationScoped.class) Object event) {
    clients.forEach(c -> c.close().subscribeAsCompletionStage());
    clients.clear();
}
 
Example #30
Source File: ObserverTransformer.java    From quarkus with Apache License 2.0 2 votes vote down vote up
/**
 * 
 * @return the reception
 */
Reception getReception();