Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChatOperation中的方法调用 #15

Open
tkz2020 opened this issue Nov 7, 2017 · 6 comments
Open

ChatOperation中的方法调用 #15

tkz2020 opened this issue Nov 7, 2017 · 6 comments

Comments

@tkz2020
Copy link

tkz2020 commented Nov 7, 2017

想问一下ChatOperation中的operations()这个方法是在哪调用的吗?它里面的值是什么时候填充的呢??

@itnikc
Copy link

itnikc commented Nov 7, 2017

请注意仔细的阅读源码那个operations方法是把对Operation接口的几种实现全部放在当前线程的ops中留着在ChatServerHandler中根据协议传过来的operation值获取对应的实现类的实例来处理相应的操作

@tkz2020
Copy link
Author

tkz2020 commented Nov 7, 2017

恩 这个我知道 我想知道Operation接口的几种实现是什么时候放到当前线程的ops集合当中的呢? 没找到在哪块去操作的呢??

@itnikc
Copy link

itnikc commented Nov 8, 2017

就是你说的ChatOperation中的operations()方法啊。

@tkz2020
Copy link
Author

tkz2020 commented Nov 8, 2017

那operations方法是在哪里调用的呢??

@itnikc
Copy link

itnikc commented Nov 8, 2017

这个operations方法不需要调用。上面有@bean修饰,就表示方法的返回对象是交给IOC管理的。请自行补一下spring boot知识。

@tkz2020
Copy link
Author

tkz2020 commented Nov 8, 2017

好的好的 非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants