You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Torsten Curdt <tc...@dff.st> on 2001/05/27 14:12:20 UTC
[C2] ComponentManager and ConnectionPool
In some beans I'd like to use the ConnectioPool
from C2. As far as I can see I need to get hold
of the ComponentManager to get the ConncetionPool
instance. But the ComponentManager is only
accessible for Cocoon or Components that are
loaded from Cocoon.
What is the proposed way for integration?
Should I make my application and beans become
a C2 component?
I guess this a question for Berin but others
of course also more than welcome to answer ;)
--
Torsten
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: [C2] ComponentManager and ConnectionPool
Posted by giacomo <gi...@apache.org>.
On Sun, 27 May 2001, Torsten Curdt wrote:
> In some beans I'd like to use the ConnectioPool
> from C2. As far as I can see I need to get hold
> of the ComponentManager to get the ConncetionPool
> instance. But the ComponentManager is only
> accessible for Cocoon or Components that are
> loaded from Cocoon.
Yup.
> What is the proposed way for integration?
As a Avalon Component deployed by the cocoon.xconf file
> Should I make my application and beans become
> a C2 component?
Preferably. Its mostly easy to make your bean an Avalon Component and
gather a CompoentnManager then by deploing that Component into the
cocoon.xconf file
> I guess this a question for Berin but others
> of course also more than welcome to answer ;)
Do I've done :)
Giacomo
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: [C2] ComponentManager and ConnectionPool
Posted by Berin Loritsch <bl...@apache.org>.
Torsten Curdt wrote:
>
> > > The Component Manager automatically loads the
> > > component. It isn't initialized until it is actually
> > > needed though. I might change that to make Component
> > > Manager initializable so that after configuration,
> > > all components are at least initialized... That's
> > > a bit of extra complexity I don't have time to handle
> > > yet.
>
> So right now the only way to load my component would be
> to load it from within an action, right?!
Pretty much. The sitemap components are set up and initialized
right away, so that any sitemap component will work.
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: [C2] ComponentManager and ConnectionPool
Posted by Torsten Curdt <tc...@dff.st>.
> > The Component Manager automatically loads the
> > component. It isn't initialized until it is actually
> > needed though. I might change that to make Component
> > Manager initializable so that after configuration,
> > all components are at least initialized... That's
> > a bit of extra complexity I don't have time to handle
> > yet.
So right now the only way to load my component would be
to load it from within an action, right?!
--
Torsten
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: [C2] ComponentManager and ConnectionPool
Posted by Torsten Curdt <tc...@dff.st>.
On Sun, 27 May 2001, Berin Loritsch wrote:
> The approach I have taken for my beans is that I wrote
> them to accept a Connection object from outside.
> Since
> I expected to batch a group of method calls from the
> different beans, I left the commit call for the
> calling
> entity.
Yeah... I'm using this on some of my classes, too
But since I need several different connections
this not really nice for this one. (I would have
to pass multiple connections)
Couldn't I just pass the object model map and
then look up the pool-controller from it?
Is looking up a component in the component manager
the same as looking it up in the object model?
Didn't get this one yet...
> So I use the Action or Generator I wrote, grab the
> Connection Object, and pass it to the beans.
>
> The other alternative to that approach, is I use the
> user-roles attribute on the root configuration
> element:
>
> <cocoon version="2.0" user-roles="WEB-INF/user.roles">
> <!-- ..... -->
> </cocoon>
>
> And set up my roles and then do the configurations in
> the cocoon.xconf file. I had a Component that I wrote
> to act like a daemon in the background, so I have a
> configuration element like this:
>
> <daemon class="my.class.for.Daemon">
> <use-connection>myconnection</use-connection>
> <export dir="/path/to/exported/images"/>
> </daemon>
>
> The Component Manager automatically loads the
> component. It isn't initialized until it is actually
> needed though. I might change that to make Component
> Manager initializable so that after configuration,
> all components are at least initialized... That's
> a bit of extra complexity I don't have time to handle
> yet.
What about static attribute and methods within a component?
I'm thinking of making our application a component so it
will be easier to integrate with C2. But how does automatic
loading work when there are static methods or attributes...
Does this matter? or stays everything the same?
--
Torsten
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: [C2] ComponentManager and ConnectionPool
Posted by Berin Loritsch <bl...@yahoo.com>.
The approach I have taken for my beans is that I wrote
them to accept a Connection object from outside.
Since
I expected to batch a group of method calls from the
different beans, I left the commit call for the
calling
entity.
So I use the Action or Generator I wrote, grab the
Connection Object, and pass it to the beans.
The other alternative to that approach, is I use the
user-roles attribute on the root configuration
element:
<cocoon version="2.0" user-roles="WEB-INF/user.roles">
<!-- ..... -->
</cocoon>
And set up my roles and then do the configurations in
the cocoon.xconf file. I had a Component that I wrote
to act like a daemon in the background, so I have a
configuration element like this:
<daemon class="my.class.for.Daemon">
<use-connection>myconnection</use-connection>
<export dir="/path/to/exported/images"/>
</daemon>
The Component Manager automatically loads the
component. It isn't initialized until it is actually
needed though. I might change that to make Component
Manager initializable so that after configuration,
all components are at least initialized... That's
a bit of extra complexity I don't have time to handle
yet.
--- Torsten Curdt <tc...@dff.st> wrote:
> In some beans I'd like to use the ConnectioPool
> from C2. As far as I can see I need to get hold
> of the ComponentManager to get the ConncetionPool
> instance. But the ComponentManager is only
> accessible for Cocoon or Components that are
> loaded from Cocoon.
>
> What is the proposed way for integration?
>
> Should I make my application and beans become
> a C2 component?
>
> I guess this a question for Berin but others
> of course also more than welcome to answer ;)
> --
> Torsten
>
>
>
---------------------------------------------------------------------
> Please check that your question has not already been
> answered in the
> FAQ before posting.
> <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail:
> <co...@xml.apache.org>
> For additional commands, e-mail:
> <co...@xml.apache.org>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>