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

pro.jk.ejoker.utils.handlerProviderHelper.RegistMessageHandlerHelper Maven / Gradle / Ivy

package pro.jk.ejoker.utils.handlerProviderHelper;

import pro.jk.ejoker.common.context.annotation.context.ESType;
import pro.jk.ejoker.common.context.annotation.context.EService;
import pro.jk.ejoker.common.context.dev2.IEjokerContextDev2;
import pro.jk.ejoker.messaging.IMessageHandler;
import pro.jk.ejoker.utils.handlerProviderHelper.containers.MessageHandlerPool;

public final class RegistMessageHandlerHelper {

	static public void checkAndRegistMessageHandler(Class clazz, MessageHandlerPool handlerPool, IEjokerContextDev2 ejokerContext) {

		if(clazz.isAnnotationPresent(EService.class)) {
			EService esa = clazz.getAnnotation(EService.class);
			String type = esa.type();
			if(ESType.MESSAGE_HANDLER.equals(type))
				handlerPool.regist((Class )clazz, () -> ejokerContext);
		}
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy