tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: what signify the code above????? the method bind ("inject", this);????
Date Wed, 18 Sep 2013 02:40:56 GMT

On Sep 10, 2013, at 9:55 AM, mauro2java2011 <> wrote:

> this signify the object current. 
> But the first parameter "inject" it is the operation to make?????
> exist other value for the first parameter into the method bind ???????

This is effectively a workaround.  Dependency Injection did not make it into the final version
of EJBContainer API that went into the specification.

In order to make it work without introducing any OpenEJB-specific API classes that you'd have
to use in your test code, we added the convention to call 'bind(Sring, Object)' where the
string must be "inject" and the object is an instance of the class that bootstrapped the EJBContainer
(called .createEJBContainer() ).

As for what other options can be passed into the bind() method, it always must be "inject",
but you can pass in:

 1. an instance of the class that called EJBContainer.createEJBContainer()
 2. any instance of a class annotated with @javax.annotation.ManagedBean


View raw message