forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vert.x: use method invokers for event bus consumers
- Loading branch information
Showing
6 changed files
with
189 additions
and
311 deletions.
There are no files selected for viewing
252 changes: 0 additions & 252 deletions
252
extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusConsumer.java
This file was deleted.
Oops, something went wrong.
59 changes: 51 additions & 8 deletions
59
...deployment/src/main/java/io/quarkus/vertx/deployment/EventConsumerBusinessMethodItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,76 @@ | ||
package io.quarkus.vertx.deployment; | ||
|
||
import org.jboss.jandex.AnnotationInstance; | ||
import org.jboss.jandex.MethodInfo; | ||
|
||
import io.quarkus.arc.processor.BeanInfo; | ||
import io.quarkus.arc.processor.InvokerInfo; | ||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
public final class EventConsumerBusinessMethodItem extends MultiBuildItem { | ||
|
||
private final BeanInfo bean; | ||
private final AnnotationInstance consumeEvent; | ||
private final MethodInfo method; | ||
private final boolean blockingAnnotation; | ||
private final boolean runOnVirtualThreadAnnotation; | ||
private final boolean splitHeadersBodyParams; | ||
private final InvokerInfo invoker; | ||
|
||
public EventConsumerBusinessMethodItem(BeanInfo bean, MethodInfo method, AnnotationInstance consumeEvent) { | ||
public EventConsumerBusinessMethodItem(BeanInfo bean, AnnotationInstance consumeEvent, boolean blockingAnnotation, | ||
boolean runOnVirtualThreadAnnotation, boolean splitHeadersBodyParams, InvokerInfo invoker) { | ||
this.bean = bean; | ||
this.method = method; | ||
this.consumeEvent = consumeEvent; | ||
this.blockingAnnotation = blockingAnnotation; | ||
this.runOnVirtualThreadAnnotation = runOnVirtualThreadAnnotation; | ||
this.splitHeadersBodyParams = splitHeadersBodyParams; | ||
this.invoker = invoker; | ||
} | ||
|
||
/** | ||
* Returns the bean that declares this event consumer method. | ||
*/ | ||
public BeanInfo getBean() { | ||
return bean; | ||
} | ||
|
||
public MethodInfo getMethod() { | ||
return method; | ||
} | ||
|
||
/** | ||
* Returns the {@link io.quarkus.vertx.ConsumeEvent} annotation declared | ||
* on this event consumer method. | ||
*/ | ||
public AnnotationInstance getConsumeEvent() { | ||
return consumeEvent; | ||
} | ||
|
||
/** | ||
* Returns whether this event consumer method declares | ||
* the {@link io.smallrye.common.annotation.Blocking} annotation. | ||
*/ | ||
public boolean isBlockingAnnotation() { | ||
return blockingAnnotation; | ||
} | ||
|
||
/** | ||
* Returns whether this event consumer method declares | ||
* the {@link io.smallrye.common.annotation.RunOnVirtualThread} annotation. | ||
*/ | ||
public boolean isRunOnVirtualThreadAnnotation() { | ||
return runOnVirtualThreadAnnotation; | ||
} | ||
|
||
/** | ||
* Returns whether this event consumer method declares 2 parameters, | ||
* where the first is the event headers and the second is the event body. | ||
* In this case, the {@link io.quarkus.vertx.runtime.EventConsumerInvoker} | ||
* has to split the headers and body parameters explicitly. | ||
*/ | ||
public boolean isSplitHeadersBodyParams() { | ||
return splitHeadersBodyParams; | ||
} | ||
|
||
/** | ||
* Returns the {@linkplain InvokerInfo invoker} for this event consumer method. | ||
*/ | ||
public InvokerInfo getInvoker() { | ||
return invoker; | ||
} | ||
|
||
} |
Oops, something went wrong.