mark过来好好用

上Neil的博客地址Liferay OSGi注解(Annotation) - 使用手册(译文)

@Component是注入服务

@Reference是获取服务(在Liferay框架中的服务,已经写好了,也可以自己写一个服务,往OSGi的框架中去注入)

如果用@Reference获取不到相应服务,如果bean是在Liferay core中,就是用@BeanReference;

反之,但是如果是在Spring Extender module中,就是用@ServiceReference注解。注意,无论是bean或者service注解都会要求你的组件使用Spring Extender。如何引用依赖,参考任何使用ServiceBuilder的服务模块,查看build.gradle和bnd.bnd,用同样的方法修改你自己的模块。

相关文章:

  • 2021-10-30
  • 2021-05-03
  • 2021-10-10
  • 2021-04-27
  • 2022-02-04
  • 2021-12-20
  • 2022-02-09
  • 2021-11-25
猜你喜欢
  • 2021-08-27
  • 2022-02-21
  • 2021-10-19
  • 2022-12-23
  • 2021-10-21
  • 2021-07-01
  • 2022-02-01
相关资源
相似解决方案