cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Wyles <>
Subject Re: C2.2 Avalon/Spring component look up
Date Thu, 22 May 2008 12:18:30 GMT
Hi Grzegrorz!

On 22 May 2008, at 13:07, Grzegorz Kossakowski wrote:

> Robin Wyles pisze:
>> Hi All,
> Hi Robin!
>> What I hope are some simple questions...
>> 1. What is the correct/preferred way to look up Avalon components  
>> from within a Spring bean?
> Use dependency injection as they components were plain Spring  
> beans. This will work fine.
> You may wonder what's bean id in such case. There is some generic  
> template for Avalon-based components ids but I guess it will be  
> simpler if you tell me what components you are interested in.

In this particular case it's an extension of the JackrabbitRepository  
from the JCR block.

I have it defined like so in my xconf:

     <include src="resource://org/apache/cocoon/jcr/jcr.roles"/>
     <jcr-repository class="com.jac.james.library.JamesRepository">
         <credentials login="guest" password="guest"/>
         <home src="file://users/robinwyles/work/james-data/james- 
         <configuration src="resource://META-INF/cocoon/jackrabbit/ 
         <workspace name="james-library"/>
         <nodetypes src="resource://META-INF/cocoon/jackrabbit/ 

.. The included jcr.roles looks like this...

   <role name="javax.jcr.Repository"

>> 2. How best to obtain the WebApplicationContext from within a java  
>> class?
> Is this class a Spring bean itself?

It might be, or it might not be :) This was a more general question  
really... Most likely I guess it will be a Spring bean.

Thanks as always!


> -- 
> Grzegorz Kossakowski
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message