What is the difference between @ApplicationScoped and @Singleton scopes in CDI?

后端 未结 6 1040
一生所求
一生所求 2020-12-02 11:00

In CDI there is the @ApplicationScoped and the (javax.inject) @Singleton pseudo-scope. What is the difference between them? Besides th

6条回答
  •  难免孤独
    2020-12-02 11:33

    One of the major differences that you can write your class with default constructor has private access modifier when using javax.inject.Singleton, but your class should have default constructor with at least default access modifier when using javax.enterprise.context.ApplicationScoped and this is JBOSS 6.1 GA Final implementation

提交回复
热议问题