Java Code Examples for javax.enterprise.event.Reception#IF_EXISTS

The following examples show how to use javax.enterprise.event.Reception#IF_EXISTS . 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: 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 2
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 3
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 4
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 5
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 6
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 7
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 8
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 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: 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 13
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 14
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 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: 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 18
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 19
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 20
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();
}