You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jacek Laskowski <ja...@laskowski.net.pl> on 2008/06/28 19:28:58 UTC

Re: svn commit: r672458 - in /openejb/trunk/openejb3: ./ container/openejb-core/ container/openejb-core/src/main/java/org/apache/openejb/core/stateful/ container/openejb-core/src/main/java/org/apache/openejb/core/stateless/ container/openejb-core/src

On Sat, Jun 28, 2008 at 4:39 AM,  <db...@apache.org> wrote:
> Author: dblevins
> Date: Fri Jun 27 19:39:54 2008
> New Revision: 672458
>
> URL: http://svn.apache.org/viewvc?rev=672458&view=rev
> Log:
> OPENEJB-126: Constructor Injection
> Works for stateless and stateful beans
> Switched to xbean libraries version 3.4.1
...
>     private static void fillInjectionProperties(ObjectRecipe objectRecipe, Class clazz, CoreDeploymentInfo deploymentInfo, Context context) {
> +        boolean usePrefix = true;
> +
> +        try {
> +            clazz.getConstructor();
> +        } catch (NoSuchMethodException e) {
> +            // Using constructor injection
> +            // xbean can't handle the prefix yet
> +            usePrefix = false;
> +        }
> +

What's the prefix? What doesn't XBean support?

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Re: svn commit: r672458 - in /openejb/trunk/openejb3: ./ container/openejb-core/ container/openejb-core/src/main/java/org/apache/openejb/core/stateful/ container/openejb-core/src/main/java/org/apache/openejb/core/stateless/ container/openejb-core/src

Posted by David Blevins <da...@visi.com>.
On Jun 28, 2008, at 10:28 AM, Jacek Laskowski wrote:

> On Sat, Jun 28, 2008 at 4:39 AM,  <db...@apache.org> wrote:
>> Author: dblevins
>> Date: Fri Jun 27 19:39:54 2008
>> New Revision: 672458
>>
>> URL: http://svn.apache.org/viewvc?rev=672458&view=rev
>> Log:
>> OPENEJB-126: Constructor Injection
>> Works for stateless and stateful beans
>> Switched to xbean libraries version 3.4.1
> ...
>>    private static void fillInjectionProperties(ObjectRecipe  
>> objectRecipe, Class clazz, CoreDeploymentInfo deploymentInfo,  
>> Context context) {
>> +        boolean usePrefix = true;
>> +
>> +        try {
>> +            clazz.getConstructor();
>> +        } catch (NoSuchMethodException e) {
>> +            // Using constructor injection
>> +            // xbean can't handle the prefix yet
>> +            usePrefix = false;
>> +        }
>> +
>
> What's the prefix? What doesn't XBean support?

XBean supports property names in the form of "class/property" so that  
if there's the same property in a super class and in a subclass, both  
can be injected with separate values.  The "find a constructor" code  
doesn't support that yet, so if you don't have a no-arg constructor we  
have to shave off the class prefix so it can find the constructor.

Important note as well.  Constructors only work if you compile your  
code with debug.  We're using the debug table in the byte code to get  
the constructor parameter names.

-David