Package io.micronaut.mqtt.intercept
Class AbstractMqttIntroductionAdvice<L,M>
java.lang.Object
io.micronaut.mqtt.intercept.AbstractMqttIntroductionAdvice<L,M>
- Type Parameters:
L
- The listener typeM
- The message type
- All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,
,Object> io.micronaut.aop.MethodInterceptor<Object,
,Object> io.micronaut.core.order.Ordered
- Direct Known Subclasses:
Mqtt3IntroductionAdvice
,Mqtt5IntroductionAdvice
,MqttIntroductionAdvice
,MqttIntroductionAdvice
public abstract class AbstractMqttIntroductionAdvice<L,M>
extends Object
implements io.micronaut.aop.MethodInterceptor<Object,Object>
Intercepts calls to MQTT clients to publish messages.
- Since:
- 1.0.0
- Author:
- James Kleeh
-
Field Summary
Fields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGET
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract MqttBindingContext<M>
createBindingContext
(io.micronaut.aop.MethodInvocationContext<Object, Object> context) abstract L
createListener
(Runnable onSuccess, Consumer<Throwable> onError) Create a listener.abstract Class<? extends Annotation>
abstract Object
Publishes the message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.aop.MethodInterceptor
intercept
Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Constructor Details
-
AbstractMqttIntroductionAdvice
-
-
Method Details
-
intercept
-
createBindingContext
public abstract MqttBindingContext<M> createBindingContext(io.micronaut.aop.MethodInvocationContext<Object, Object> context) - Parameters:
context
- The method context- Returns:
- The binding context to bind data used in publishing
-
publish
Publishes the message.- Parameters:
topic
- The topic to publish the message tomessage
- The message to publishlistener
- The publish action listener- Returns:
- The result of the publish method
-
createListener
Create a listener.- Parameters:
onSuccess
- The code to call when a message is sent successfullyonError
- The consumer to call in the case of an exception- Returns:
- A publish action listener
-
getRequiredAnnotation
- Returns:
- The implement specific client annotation class
-