【问题标题】:EclipseContext get beans of typeEclipse Context 获取 bean 类型
【发布时间】:2017-01-24 11:54:14
【问题描述】:

我有课:

@Creatable
@Singleton
public class Sample1 implements ISample {

}

@Creatable
@Singleton
public class Sample2 implements ISample {

}

如何从 EclipseContext 中获取所有 ISample 类型的 bean?

【问题讨论】:

    标签: eclipse dependency-injection eclipse-rcp e4


    【解决方案1】:

    Eclipse 上下文不支持这样的东西。您所能做的就是查找具有特定名称(或刚刚转换为名称的特定类)的对象。

    另外,使用 @Creatable 声明的对象甚至不会被创建并添加到上下文中,直到实际使用它们。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-21
      • 2016-02-28
      • 2018-05-04
      • 2014-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-02
      相关资源
      最近更新 更多