You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2012/06/18 18:34:13 UTC

Why @PostInjection only work for public methods ?

I know it's stated in the docs, but I'm asking what's the point of limiting
it to public methods ?

Doesn't java reflection allow invoking access-protected\invisible methods
such as private, protected and default-access methods ?

-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: Why @PostInjection only work for public methods ?

Posted by Howard Lewis Ship <hl...@gmail.com>.
It is true that it could be extended to non-public methods. It just hasn't
been the case. In theory, everything inside your class could be public, but
it still would be off-limits, buried behind a service interface. Unlike
other systems, you can't cast the service interface to the service
implementation class: what gets injected is a dynamically created proxy
that's responsible for lifecycle, including lazy instantitation of the
implementation class.

On Mon, Jun 18, 2012 at 9:34 AM, Muhammad Gelbana <m....@gmail.com>wrote:

> I know it's stated in the docs, but I'm asking what's the point of limiting
> it to public methods ?
>
> Doesn't java reflection allow invoking access-protected\invisible methods
> such as private, protected and default-access methods ?
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com