public TypeDictionary createFromClasspath() { logger.info("Creating TypeDictionary using reflection from standard classpath."); return new TypeDictionary(populateHandlersFromClasspath(), populateParsersFromClasspath()); }
private PartitionProcessorFactory processorFactory() { TypeDictionary typeDictionary = new TypeDictionary(new HashMap<>(), new HashMap<>()); FailedMessageProcessor failedMessageProcessor = new DiscardFailedMessages(); return new PartitionProcessorFactory(typeDictionary, failedMessageProcessor, null, null); }
private <T extends com.google.protobuf.Message> ConsumerFactory consumerFactoryWithHandler(ServiceProperties serviceProperties, Class<T> messageType, MessageHandler<T> handler) { TypeDictionary typeDictionary = new TypeDictionary(); ReflectionTypeDictionaryFactory reflectionCruft = new ReflectionTypeDictionaryFactory(null); typeDictionary.putAllParsers(reflectionCruft.populateParsersFromClasspath()); typeDictionary.putHandler(MessageType.of(messageType), handler); ConsumerFactory consumerFactory = new ConsumerFactory(serviceProperties, typeDictionary, null, null); return consumerFactory; }
private <T extends com.google.protobuf.Message> ConsumerFactory consumerFactoryWithHandler(ServiceProperties serviceProperties, Class<T> messageType, MessageHandler<T> handler) { TypeDictionary typeDictionary = new TypeDictionary(); ReflectionTypeDictionaryFactory reflectionCruft = new ReflectionTypeDictionaryFactory(null); typeDictionary.putAllParsers(reflectionCruft.populateParsersFromClasspath()); typeDictionary.putHandler(MessageType.of(messageType), handler); ConsumerFactory consumerFactory = new ConsumerFactory(serviceProperties, typeDictionary, null, null); return consumerFactory; } }
final CountDownLatch responseLatch = new CountDownLatch(N); TypeDictionary typeDictionary = new TypeDictionary(); ReflectionTypeDictionaryFactory typeDictionaryFactory = new ReflectionTypeDictionaryFactory(null); typeDictionary.putAllParsers(typeDictionaryFactory.populateParsersFromClasspath());