All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.panhongan.util.kafka.handler.KafkaMessageHandlerServiceShutdownHook Maven / Gradle / Ivy

There is a newer version: 0.1.8
Show newest version
package com.github.panhongan.util.kafka.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class KafkaMessageHandlerServiceShutdownHook extends Thread {
	
	private static final Logger logger = LoggerFactory.getLogger(KafkaMessageHandlerServiceShutdownHook.class);
	
	private static final String CLASS_NAME = KafkaMessageHandlerServiceShutdownHook.class.getSimpleName();
	
	private KafkaMessageHandlerService service = null;
	
	public KafkaMessageHandlerServiceShutdownHook(KafkaMessageHandlerService service) {
		this.service = service;
	}

	@Override
	public void run() {
		if (service != null) {
			service.uninit();
		}
		
		logger.info("{} is trigged", CLASS_NAME);
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy