tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@gmail.com>
Subject Re: LocalClient question
Date Tue, 01 Mar 2011 22:23:52 GMT

On Mar 1, 2011, at 9:39 AM, vlad.balan wrote:

> Hello,
> 
> why do you have to call 
> 
> initialContext.bind("inject", this);
> 
> when using @LocalClient?
> 
> Isn't @LocalClient enough to do all the injection when it is discovered: the
> so called deploy action?
> Why it happens in 2 times?
> 
> Is it because at deployment time it is the annotated class bytes that get
> modified (independent of any instance) and than, at run time, the instance
> (referred by "this") needs some more actions to be fully equiped - actions
> taken by bind("inject", this)?

Exactly.  We read the byte code at deploy time and that lets us know what things that class
will eventually need and we take the steps to ensure they are properly built and available
at runtime.  But was we don't have any roll in actually constructing instances of that class
(junit, testng, etc will do that themselves), we offer that hook as a way of saying "I created
this instance, but I want you to do injection on it".

-David



Mime
View raw message