Hi,
I quickly implemented an example using CXF and iPOJO:
http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo-tutorials/dosgi/So, the example is very close to the Adder Declarative Service tutorial.
However, some explanations may be useful:
- The AdderServiceInterface bundle exports the AdderService interface
and has to be deployed on both framework
- The AdderServiceProvider declares a component exposing the
AdderService. It also creates an instance of this component. The
component type enables property propagation, and the instance
declaration defines all the required properties :
<instance
component="org.apache.felix.ipojo.remote.adder.impl.AdderServiceImpl">
<property name="osgi.remote.interfaces" value="*"/>
<property name="osgi.remote.configuration.type" value="pojo" />
<property name="osgi.remote.configuration.pojo.address" value="
http://localhost:9090/adder
" />
</instance>
By using this way, the "remote" aspect does not impact the
implementation at all.
- The AdderServiceImporter is a bundle containing only the remote-
service.xml file. So, this bundle is deployed on the second (client)
framework and will enabled the remote service import.
- The AdderServiceConsumer contains a very simple component using the
AdderService as a regular local service.
Last things, to work I started two gateway:
- Felix 1.8.1 with iPOJO, Compendium, CXF (Snapshot) single bundle,
AdderServiceInterface and AdderServiceProvider
- Equinox 3.5 with iPOJO, OSGi service, OSGi Utils, CXF (Snapshot)
single bundle, AdderServiceInterface, AdderServiceImporter and
AdderServiceConsumer
For some strange reason, I was not able to import the service from
Felix... Maybe a detail of CXF that I ignore. equinox 3.5 is required
as CXF relies on ServiceHooks.
Regards,
Clement
On 30.06.2009, at 20:41, Joel Schuster wrote:
> Great, thanks!
>
> I can't get it to work at all. This actually may be more a question
> then for the CXF people, just let me know. I'm not sure which
> properties to set. Based on what you see on those links I referred
> to, @ServiceProperty is the correct annotation to use, right?
>
> Do you know of a single bundle solution that iPojo integrates easily
> with? I'd like to just provide a simple annotation or config
> property and have it just make my service available automatically.
>
> Why did you make the decision to write your own?
>
> - Joel
>
>> -----Original Message-----
>> From: Bourret Pierre [mailto:
bourretp@...]
>> Sent: Tuesday, June 30, 2009 9:54 AM
>> To:
users@...
>> Subject: Re: iPojo as WebService
>>
>> Hi Joel.
>>
>> I'm daily using iPOJO service as web services. I don't use CXF but a
>> home-made Distributed Service implementation. However, it should be
>> very
>> similar.
>>
>> Feel free to ask me if you encounter any issue.
>>
>> --
>> Pierre Bourret
>>
>>
>> 2009/6/30 Joel Schuster <
joels@...>
>>
>>> I'd like to expose my iPojo as a WebService.
>>>
>>> I'm using the Distributed OSGi single bundle from apache cxf:
>>>
http://cxf.apache.org/distributed-osgi.html>>>
>>> Based on what I read, (
http://cxf.apache.org/dosgi-ds-demo-
>>> page.html)
>>> theoretically I should be able to take a working iPojo based
>>> service and
>> add
>>> add a few @ServiceProperties and deploy a .cfg file with FileInstall
>> bundle:
>>>
>>> osgi.remote.interfaces=*
>>> osgi.remote.configuration.type=pojo
>>>
>> osgi.remote.configuration.pojo.address=
http://localhost:9090/mypojoservice>>>
>>> Has anyone tried this or something similar without having to add the
>>> overhead of going all the way to ServiceMix?
>>>
>>> Any help would be appreciated.
>>>
>>> - Joel
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
users-unsubscribe@...
>>> For additional commands, e-mail:
users-help@...
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
users-unsubscribe@...
> For additional commands, e-mail:
users-help@...
>