No, <osgi:service/> is used to export a service in the osgi registry.
You need to use <osgi:reference/> instead. Then you don't need the additional
bean definition for <bean name="fooService" />.
So something along:
<osgi;reference id="fooService"
interface="org.springdm.service.FooService" />
<camel:camelContext>
...
</came:camelContext>
And the same route:
from("file:///c:/temp/myFileToProcess)
.unmarshall("into something".
.to("bean://fooService?methodName=Process)
I haven't tried it but I don't see why it would not work.
On Mon, Jun 2, 2008 at 2:17 PM, cmoulliard <[EMAIL PROTECTED]> wrote:
>
> What you propose is to : use the bean endpoint of camel in collaboration with
> spring-DM to communicate with the OSGI server like this
>
> from("file:///c:/temp/myFileToProcess)
> .unmarshall("into something".
> .to("bean://fooService?methodName=Process)
>
> Spring Bean Definition
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd">
> <bean name="fooService" class="org.springdm.impl.FooServiceImpl" />
> </beans>
>
> Spring-DM OSGI Definition
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:osgi="http://www.springframework.org/schema/osgi"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://www.springframework.org/schema/osgi
> http://www.springframework.org/schema/osgi/spring-osgi.xsd">
> <osgi:service id="fooServiceOsgi" ref="fooService"
> interface="org.springdm.service.FooService" />
> </beans>
>
> Is it correct ?
>
>
> gnodet wrote:
>>
>> Have you tried doing that using spring-dm and the camel-bean component ?
>> Using spring-dm, you can easily import a bean into your spring
>> configuration
>> and you should be able to reference it using the bean:xxx uri in camel.
>>
>> On Mon, Jun 2, 2008 at 10:24 AM, cmoulliard <[EMAIL PROTECTED]> wrote:
>>>
>>> Hi,
>>>
>>> Is it planned to propose in a next release of Camel "OSGI endpoint" ? In
>>> my
>>> head, an OSGI endpoint is a OSGI service running in an OSGI server and
>>> exposing/exporting service like (DAO, ...). The idea is to use Camel as
>>> the
>>> routing engine but to package the business components (POJO) of the
>>> application into separate JARs file which are embedded into the Camel Jar
>>> project but into separate versioned OSGI bundles. The benefit of this is
>>> that when I have to update the DAO layer or business component, I can
>>> update
>>> the OSGI bundle on my OSGI server without having to repackage and
>>> redeploy
>>> all the Jar's/components of my project.
>>>
>>> e.g.
>>>
>>> from("file:///c:/temp/myFileToProcess)
>>> .unmarshall("into something".
>>> .to("OSGI_service://MyBeanProcessingTheMessage?methodName=Process)
>>>
>>>
>>> Charles
>>> --
>>> View this message in context:
>>> http://www.nabble.com/OSGI-endpoint-planned---tp17596294s22882p17596294.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/OSGI-endpoint-planned---tp17596294s22882p17599983.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/