Andreas Hartmann wrote:
Michael Wechner wrote:
[...]
We actually already have some code to do this with spring and would be
happy to contribute, but I am not sure if we want to introduce
another application framework beside Avalon ...
What a pity , because with Spring it will be very easy to do it (see
below). But i don't think it's good to introduce another application
framework. Let's port it to Avalon
If it works, I'd be happy to take a look at it.
Maybe it can easily be ported to Avalon?
With Spring it would be something like this:
ApplicationContext context = ...;
Repository repository = (Repository)
context.getBean("repository", Repository.class);
and the bean's configuration:
for Jackrabbit
<beans>
<bean id="repository"
class="org.apache.jackrabbit.core.RepositoryImpl"
depends-on="repository-config">
<constructor-arg><ref local="repository-config"/></constructor-arg>
</bean>
<bean id="repository-config"
class="org.apache.jackrabbit.core.config.RepositoryConfig"
factory-method="create">
<constructor-arg type="java.lang.String" index="0">
<value>src/repository.xml</value>
</constructor-arg>
<constructor-arg type="java.lang.String" index="1">
<value>build/repository</value>
</constructor-arg>
</bean>
and for Jeceira
<beans>
<!-- The factory bean, which contains a method called
createInstance -->
<bean id="repositoryFactoryBean"
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property
name="staticMethod"><value>com.jeceira.repository.RepositoryFactory.getInstance</value></property>
</bean>
<!-- The bean to be created via the factory bean -->
<bean id="repository" factory-bean="repositoryFactoryBean"
factory-method="getRepository">
<constructor-arg type="java.lang.String" index="0">
<value>test</value>
</constructor-arg>
</bean>
</beans>
Edith
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Edith Chevrier
Wyona Inc. - Open Source Content Management - Apache Lenya
http://wyona.com http://lenya.apache.org
[EMAIL PROTECTED] [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]