How do app servers inject into private fields?

Posted by cibercitizen1 on Stack Overflow See other posts from Stack Overflow or by cibercitizen1
Published on 2010-04-05T15:40:00Z Indexed on 2010/04/05 15:43 UTC
Read the original article Hit count: 393

I saw this question

http://stackoverflow.com/questions/2021716/inject-into-private-package-or-public-field-or-provide-a-setter

about how to manually inject into annotated private fields (The way is adding setters or through a constructor)

But, the point is how do an application server (like glassfish, axis2, jboss, ...) is able to inject into a final private field (without adding setters or constructors to the user class)?

Quoting the cited question:

public SomeClass {
  @Inject
  private SomeResource resource;
}

Do they use a customized JVM (not the standard one) that allows to access private fields?

Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about dependency-injection