You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Norbert Sándor <de...@erinors.com> on 2005/09/19 14:47:57 UTC

injecting services/objects to "external" POJOs

Hi,

I often need access to services or other objects in the registry from "external" classes. On "external" I mean some class which does not have implicit access to the registry. These are usually smaller utility/definition classes, like table models, table column definitions, etc. in case of Tapestry.
Is there an existing solution for this problem? (Like a special classloader which can inject objects to any class, similar to Tapestry's solution.)

Thanks,
Norbi

Re: injecting services/objects to "external" POJOs

Posted by Chris Burnley <ch...@gmail.com>.
You can use annotations since something like @InjectObject utilises the 
ObjectProviders configuration.

Could you not do something like this:

@InjectObject("instance:com.test.MyTableModel")
public TableModel getTableModel()

there are also bean and spring object providers already defined that you 
could use.

On 9/19/05, Norbert Sándor <de...@erinors.com> wrote:
> 
> I would prefere an annotation-based solution because for example I create 
> the table columns dynamically (using the new operator).
>  BR,
> Norbi
> 
> ----- Original Message ----- 
> *From:* Jean-Francois Poilpret <jf...@hcm.vnn.vn> 
> *To:* hivemind-user@jakarta.apache.org 
> *Sent:* Monday, September 19, 2005 3:35 PM
> *Subject:* RE: injecting services/objects to "external" POJOs
> 
>  Maybe you should have a look at hiveutils.ObjectBuilder service (and the 
> ObjectBuilderObjects configuration)? This is part of HiveMind Utilities…
> 
>  Cheers
> 
>  Jean-Francois, HiveMind Utilities
> 
>   ------------------------------
>  
> *From:* Norbert Sándor [mailto:developer@erinors.com] 
> *Sent:* Monday, September 19, 2005 7:48 PM
> *To:* Users HiveMind
> *Subject:* injecting services/objects to "external" POJOs
> 
>  Hi,
>  
>  I often need access to services or other objects in the registry from 
> "external" classes. On "external" I mean some class which does not have 
> implicit access to the registry. These are usually smaller 
> utility/definition classes, like table models, table column definitions, 
> etc. in case of Tapestry.
>  
> Is there an existing solution for this problem? (Like a special 
> classloader which can inject objects to any class, similar to Tapestry's 
> solution.)
>  
>  Thanks,
>  
> Norbi
> 
>

Re: injecting services/objects to "external" POJOs

Posted by Norbert Sándor <de...@erinors.com>.
I would prefere an annotation-based solution because for example I create the table columns dynamically (using the new operator).

BR,
Norbi
  ----- Original Message ----- 
  From: Jean-Francois Poilpret 
  To: hivemind-user@jakarta.apache.org 
  Sent: Monday, September 19, 2005 3:35 PM
  Subject: RE: injecting services/objects to "external" POJOs


  Maybe you should have a look at hiveutils.ObjectBuilder service (and the ObjectBuilderObjects configuration)? This is part of HiveMind Utilities.

   

  Cheers

   

              Jean-Francois, HiveMind Utilities

   


------------------------------------------------------------------------------

  From: Norbert Sándor [mailto:developer@erinors.com] 
  Sent: Monday, September 19, 2005 7:48 PM
  To: Users HiveMind
  Subject: injecting services/objects to "external" POJOs

   

  Hi,

   

  I often need access to services or other objects in the registry from "external" classes. On "external" I mean some class which does not have implicit access to the registry. These are usually smaller utility/definition classes, like table models, table column definitions, etc. in case of Tapestry.

  Is there an existing solution for this problem? (Like a special classloader which can inject objects to any class, similar to Tapestry's solution.)

   

  Thanks,

  Norbi

RE: injecting services/objects to "external" POJOs

Posted by Jean-Francois Poilpret <jf...@hcm.vnn.vn>.
Maybe you should have a look at hiveutils.ObjectBuilder service (and the
ObjectBuilderObjects configuration)? This is part of HiveMind Utilities…

 

Cheers

 

            Jean-Francois, HiveMind Utilities

 

  _____  

From: Norbert Sándor [mailto:developer@erinors.com] 
Sent: Monday, September 19, 2005 7:48 PM
To: Users HiveMind
Subject: injecting services/objects to "external" POJOs

 

Hi,

 

I often need access to services or other objects in the registry from
"external" classes. On "external" I mean some class which does not have
implicit access to the registry. These are usually smaller
utility/definition classes, like table models, table column definitions,
etc. in case of Tapestry.

Is there an existing solution for this problem? (Like a special classloader
which can inject objects to any class, similar to Tapestry's solution.)

 

Thanks,

Norbi