Package io.micronaut.pulsar
Class PulsarReaderFactory
java.lang.Object
io.micronaut.pulsar.PulsarReaderFactory
- All Implemented Interfaces:
- PulsarReaderRegistry,- AutoCloseable
@Factory
public class PulsarReaderFactory
extends Object
implements AutoCloseable, PulsarReaderRegistry
Create pulsar reader beans for fields annotated with PulsarReader.
- Since:
- 1.0
- Author:
- Haris Secic
- 
Constructor SummaryConstructorsConstructorDescriptionPulsarReaderFactory(org.apache.pulsar.client.api.PulsarClient pulsarClient, DefaultSchemaHandler simpleSchemaResolver, TopicResolver topicResolver) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()org.apache.pulsar.client.api.Reader<?>If not specified explicitly, reader name will default to property/field name.org.apache.pulsar.client.api.Reader<?>getReaderByInjectionPoint(io.micronaut.context.BeanResolutionContext context, @Nullable io.micronaut.core.annotation.AnnotationValue<PulsarReader> annotationValue, @Nullable io.micronaut.core.type.Argument<?> returnType, @Nullable io.micronaut.aop.MethodInvocationContext<?, ?> methodInvocationContext) Create Pulsar Reader for given injection point if missing.Collection<org.apache.pulsar.client.api.Reader<?>>
- 
Constructor Details- 
PulsarReaderFactorypublic PulsarReaderFactory(org.apache.pulsar.client.api.PulsarClient pulsarClient, DefaultSchemaHandler simpleSchemaResolver, TopicResolver topicResolver) 
 
- 
- 
Method Details- 
getReaderByInjectionPoint@Prototype public org.apache.pulsar.client.api.Reader<?> getReaderByInjectionPoint(io.micronaut.context.BeanResolutionContext context, @Nullable @Parameter @Nullable io.micronaut.core.annotation.AnnotationValue<PulsarReader> annotationValue, @Nullable @Parameter @Nullable io.micronaut.core.type.Argument<?> returnType, @Nullable @Parameter @Nullable io.micronaut.aop.MethodInvocationContext<?, ?> methodInvocationContext) throws org.apache.pulsar.client.api.PulsarClientExceptionCreate Pulsar Reader for given injection point if missing.- Parameters:
- context- injection point of- Reader<?>if used as injection argument.
- annotationValue- method annotation value if used by annotating method
- methodInvocationContext- method invocation context if used by annotating method
- returnType- method return type if used by annotating method
- Returns:
- new instance of Pulsar reader if missing; otherwise return from cache
- Throws:
- org.apache.pulsar.client.api.PulsarClientException- in case of not being able to create such Reader
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
- 
getReaderDescription copied from interface:PulsarReaderRegistryIf not specified explicitly, reader name will default to property/field name.- Specified by:
- getReaderin interface- PulsarReaderRegistry
- Parameters:
- identifier- unique identifier for a reader
- Returns:
- Pulsar Reader if found for a given name
 
- 
getReaders- Specified by:
- getReadersin interface- PulsarReaderRegistry
- Returns:
- all registered Pulsar Readers
 
 
-