On 30.09.2007 17:02 Uhr, [EMAIL PROTECTED] wrote:

Author: danielf
Date: Sun Sep 30 14:02:24 2007
New Revision: 580786

URL: http://svn.apache.org/viewvc?rev=580786&view=rev
Log: Spring-OSGi doesn't contain any support for beans with prototype
scope. This is  mainly because there is no direct mapping between the
prototype scope and any OSGi concepts. In OSGi services are either
singletons at global level or at bundle level. The only reasonable
mapping, AFAICS, is to export a factory bean as an OSGi service.

As Cocoon uses prototypes in many places I have extended Spring-OSGi
with support for exporting a factory bean instead of the bean by
setting the attribute "factory-export" to true. In this case a
SmartFactoryBean is exported and the classes of the contained bean is
put in the "org.springframework.osgi.beanclasses" property.

The import part is not written yet.

The code contains a lot of copy and modify from Spring-OSGi as some
of the involved classes wasn't really extendible. The idea is to try
to contribute it back to Spring-OSGi.

I don't know if it applies here at all, but in standard Spring to get
access to the factory bean instead of the bean itself you prefix the
bean name with an ampersand. Is it reasonable to go with that approach here as well compared to your new attribute "factory-export"?

Joerg

Reply via email to