Why you need it?
Is your feature request related to a problem? Please describe in details
将硬性编码转成用SPI进行解耦和扩展,使用getMessageTypes()方法来获取类型,进行注册到processorTable中
How it could be?
A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.List<RemotingProcessor> processors = ServicLoader.load(RemotingProcessor.class); .....
Other related information
Add any other context or screenshots about the feature request here.
4条答案
按热度按时间s6fujrry1#
你这么做的目的是什么?
czfnxgou2#
为了进行扩展和版本迭代不需要改动原来代码,只需要更改SPI的文件,减少硬性编码
k4emjkb13#
server 端的 spi 意义不大吧。
2eafrhcq4#
@juckTom So according to the figure above ,we need 5 types of SPI to load?