You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2024/03/28 09:14:02 UTC

(camel) branch camel-3.21.x updated: camel-cdi remove deprecated fireEvent method (#13596)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.21.x by this push:
     new 0b3d2c99f4a camel-cdi remove deprecated fireEvent method (#13596)
0b3d2c99f4a is described below

commit 0b3d2c99f4a64c6c67e73b83cdd9a9a1e535014c
Author: Marius Cojocaru <ma...@yahoo.com>
AuthorDate: Thu Mar 28 10:13:56 2024 +0100

    camel-cdi remove deprecated fireEvent method (#13596)
    
    CAMEL-20627: remove deprecated BeanManager.fireEvent this will allow the library to be used in also with cdi api 4 after transforming it with eclipse transformer.
---
 .../src/main/java/org/apache/camel/cdi/CdiCamelExtension.java         | 2 +-
 .../src/main/java/org/apache/camel/cdi/CdiEventNotifier.java          | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java
index aac4b848071..d4d87f51d5f 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java
@@ -412,7 +412,7 @@ public class CdiCamelExtension implements Extension {
 
     private void afterDeploymentValidation(@Observes AfterDeploymentValidation adv, BeanManager manager) {
         // Send event for Camel CDI configuration
-        manager.fireEvent(configuration);
+        manager.getEvent().fire(configuration);
         configuration.unmodifiable();
 
         Collection<CamelContext> contexts = new ArrayList<>();
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiEventNotifier.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiEventNotifier.java
index f3d7dfe62b0..80280add125 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiEventNotifier.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiEventNotifier.java
@@ -56,9 +56,9 @@ final class CdiEventNotifier extends EventNotifierSupport {
             List<Annotation> annotations = new ArrayList<>();
             Collections.addAll(annotations, qualifiers);
             annotations.add(NamedLiteral.of(id));
-            manager.fireEvent(event, annotations.toArray(new Annotation[0]));
+            manager.getEvent().select(annotations.toArray(new Annotation[0])).fire(event);
         } else {
-            manager.fireEvent(event, qualifiers);
+            manager.getEvent().select(qualifiers).fire(event);
         }
     }