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

com.healthy.common.websocket.holder.JsonMessageHandlerInitializer Maven / Gradle / Ivy

There is a newer version: 2.0.0-M1
Show newest version
package com.healthy.common.websocket.holder;

import com.healthy.common.websocket.handler.JsonMessageHandler;
import com.healthy.common.websocket.message.JsonWebSocketMessage;
import lombok.RequiredArgsConstructor;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * JsonMessageHandler 初始化器 将所有的 jsonMessageHandler 收集到 JsonMessageHandlerHolder 中
 *
 * @author xm.z
 */
@RequiredArgsConstructor
public class JsonMessageHandlerInitializer {

	private final List> jsonMessageHandlerList;

	@PostConstruct
	public void initJsonMessageHandlerHolder() {
		for (JsonMessageHandler jsonMessageHandler : jsonMessageHandlerList) {
			JsonMessageHandlerHolder.addHandler((JsonMessageHandler) jsonMessageHandler);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy