cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Froehlich" <g-froehl...@gmx.de>
Subject RE: xconf and store problem
Date Fri, 25 Jan 2002 16:38:21 GMT
Hi,

>I have a few questions about the store implementation.
>Basically I would like to divide the result of a large SQL query into several
>blocks and store these blocks in some kind of store.
>My question is how to initialize my own store and then get a reference to it.
>Can I add an entry in the cocoon.xconf like the cachingEventPipeline and
>cachingStreamPipeline?
>Something like:
>
><sql-cache class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store">
>     <parameter name="maxobjects" value="100"/>
>     <parameter name="filesystem" value="true"/>
></sql-cache>
>
>If that is possible, how do I then get a reference to it?
>If I my classes implement Composable and I give them the the ComponentManager
>from my Cocoon-components, can I use that ComponentManager to lookup my store?
>What´s the correlation between the entry in the cocoon.xconf and the key used
>to retrieve them from the store?
>I looked at the CachingEventPipeline and noticed that the cache/store is
>retrieved with the following line (row 67 in CachingEventPipeline.java):
>
>this.eventCache = (Store)this.manager.lookup(Store.ROLE + "/EventCache");
>
>Which component is responsible for adding the store to the ComponentManager
>and where does the "/EventCache" part come from. A quick search through the
>checked out Cocoon-repository only shows that single occurence of the string...
>
>I would like to retrieve my own store along the same lines, ie :
>
>this.SQLCache = (Store)this.manager.lookup(Store.ROLE + "/SQLCache");
>
>I´ve got a gut feeling that this is a really simple question but I can´t see it... ;)

Why don't you replace the
<event-cache> and the <stream-cache> with your Store component?
Something like this:
<event-cache class="path.to.your.StoreComponent" logger="root.store"/>
<stream-cache class="path.to.your.StoreComponent" logger="root.store"/>

Just implement the org.apache.cocoon.components.store.Store interface in your
Store and you've no problems!

For the Avalon related interfaces you can look in the MRUMemoryStore, how
they are implemented.

BTW can you send plain text here. Some people react allergic on MS mail
formats, here!

I hope this helps!

  Gerhard


"A man with one watch knows what time it is,
a man with two watches is never sure...
(Albert Einstein)"



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message