Package io.micronaut.mqtt.intercept
Class AbstractMqttSubscriberAdvice<M>
java.lang.Object
io.micronaut.mqtt.intercept.AbstractMqttSubscriberAdvice<M>
- Type Parameters:
M
- The specific message type
- All Implemented Interfaces:
io.micronaut.context.processor.AnnotationProcessor<Topic,
,io.micronaut.inject.ExecutableMethod<?, ?>> io.micronaut.context.processor.ExecutableMethodProcessor<Topic>
,AutoCloseable
- Direct Known Subclasses:
MqttSubscriberAdvice
,MqttSubscriberAdvice
,MqttSubscriberAdvice
public abstract class AbstractMqttSubscriberAdvice<M>
extends Object
implements io.micronaut.context.processor.ExecutableMethodProcessor<Topic>, AutoCloseable
An
ExecutableMethodProcessor
that will process all beans annotated
with MqttSubscriber
and create and subscribe the relevant methods
as consumers to MQTT topics.- Since:
- 1.0.0
- Author:
- James Kleeh
-
Constructor Summary
ConstructorDescriptionAbstractMqttSubscriberAdvice
(io.micronaut.context.BeanContext beanContext, MqttBinderRegistry binderRegistry, MqttSubscriberExceptionHandler exceptionHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
process
(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) abstract void
subscribe
(String[] topics, int[] qos, Consumer<MqttBindingContext<M>> callback) abstract void
unsubscribe
(Set<String> topics)
-
Constructor Details
-
AbstractMqttSubscriberAdvice
public AbstractMqttSubscriberAdvice(io.micronaut.context.BeanContext beanContext, MqttBinderRegistry binderRegistry, MqttSubscriberExceptionHandler exceptionHandler)
-
-
Method Details
-
process
public void process(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) -
subscribe
public abstract void subscribe(String[] topics, int[] qos, Consumer<MqttBindingContext<M>> callback) -
unsubscribe
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-