You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Karan Malhi <ka...@gmail.com> on 2009/02/18 06:39:12 UTC

injection support in POJO's

I want to make a utility like so

public Object newInstance(Class clazz){
  // this method should create an instance of the clazz and perform
injections and return the instance
}

Is there an OpenEJB API which I could use , where I could give it an
arbitrary class and it would scan the class for annotations and perform the
neccessary injections.
If not, then I will probably use the DefaultAnnotationProcessor available in
Tomcat.

-- 
Karan Singh Malhi

Re: injection support in POJO's

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi,

Perhaps you can have a look on openejb-itests-client module.
The class org.apache.openejb.test.TestClient can probably do what you want.

Regards,
Jean-Louis


KMalhi wrote:
> 
> I want to make a utility like so
> 
> public Object newInstance(Class clazz){
>   // this method should create an instance of the clazz and perform
> injections and return the instance
> }
> 
> Is there an OpenEJB API which I could use , where I could give it an
> arbitrary class and it would scan the class for annotations and perform
> the
> neccessary injections.
> If not, then I will probably use the DefaultAnnotationProcessor available
> in
> Tomcat.
> 
> -- 
> Karan Singh Malhi
> 
> 

-- 
View this message in context: http://www.nabble.com/injection-support-in-POJO%27s-tp22072589p22076603.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: injection support in POJO's

Posted by David Jencks <da...@yahoo.com>.
xbean-reflect has the object creation code and I believe xbean-finder  
does annotation scraping.  I'm not sure if there are methods to make  
it easier to extract all the annotations from a particular class and  
its superclasses or if this is easy enough to do by hand.

david jencks

On Feb 17, 2009, at 9:39 PM, Karan Malhi wrote:

> I want to make a utility like so
>
> public Object newInstance(Class clazz){
>  // this method should create an instance of the clazz and perform
> injections and return the instance
> }
>
> Is there an OpenEJB API which I could use , where I could give it an
> arbitrary class and it would scan the class for annotations and  
> perform the
> neccessary injections.
> If not, then I will probably use the DefaultAnnotationProcessor  
> available in
> Tomcat.
>
> -- 
> Karan Singh Malhi