eclipse-ee4j / glassfish-hk2

Dynamic dependency injection framework

Home Page:https://eclipse-ee4j.github.io/glassfish-hk2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@Rank() not honored on Factory<Contract>

cpotter1 opened this issue · comments

@service
@rank(123) // note: bug in Hk2 where rank defaults to 0 on factory types
public class PersistenceStoreFactory implements Factory {
@OverRide
public PersistenceStore provide() {
return null;
}

@OverRide
public void dispose(PersistenceStore instance) {

}

commented

You probably need to put the @rank annotation on the provide() method. Ranking factory services rarely makes sense.