cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: static method to get a component?
Date Thu, 09 Jun 2005 17:14:41 GMT
Ben Anderson wrote:
> Hi,
> I need to hit the database from outside of cocoon, but within the same
> webapp.  I would like to share the same datasource.  My first thought
> was to follow this example:
> which is to implement the Composable interface.  However, I'm not sure
> how to do this because I'll need a static hook somewhere to get my
> object.  Does anyone have any pointers for doing this?
> Thanks,
> Ben

Adding a static hook is less than ideal, and it isn't hard to just 
create your system to live as a component inside of the Cocoon world.

Nevertheless, if you are hell-bent on this approach, here is how you 
would do it:

Set up the component manager in your static class, with the entry for 
the database, and let cocoon just use it.

Design is a funny word. Some people think design means how it looks.
But of course, if you dig deeper, it's really how it works.

                                                        -- Steve Jobs

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message