Finding/using OSGi services outside of the framework [message #106149] |
Tue, 11 March 2008 11:29  |
Eclipse User |
|
|
|
Originally posted by: Boyan.Yurukov.softwareag.com
I installed the server-side Equinox together with Axis 2 on a Tomcat. I want
to make a web service that will run in axis2 and can find/run the osgi
services. Is there some external framework api I can use? Can I access the
exported packages in each bundle outside of the framework while in the same
jvm? I thought of building a bundle that gives away its BundleContex as
public static, but it seems more like a hack.
Greetings,
Boyan.
|
|
|
|
|
|
Re: Finding/using OSGi services outside of the framework [message #108180 is a reply to message #108003] |
Tue, 15 April 2008 10:02  |
Eclipse User |
|
|
|
Originally posted by: Boyan.Yurukov.softwareag.com
Hi,
I took a different approach, since it seemed easier and more logical.
Instead of starting the OSGi Framework inside Axis2, I packed Axis2 in a
bundle. You can use the knopflerfish implementation:
http://www.knopflerfish.org/repo/repository.xml (search for "axis2")
Here are the src-s:
https://www.knopflerfish.org/svn/knopflerfish.org/trunk/osgi /bundles_opt/soap/axis2-osgi/
I had to make my own bundle, because of some custom axis2 feature
implemenations. I had problems with Log4j and apache.common.logging. To fix
them I simply installed the common logging bungle from knopflerfish and the
log4j plugin for eclipse. I also had some classloading issues but I fixed
them with different adapters and reseting the classloader.
Now I am building a service that acutally uses the other bundles. Will get
back to you when I get that going.
Boyan.
"Stefan Kurzbach" <xeen9@web.de> wrote in message
news:ftq9ul$k06$1@build.eclipse.org...
> Hello Boyan,
>
> I have a similar goal. I use the Globus Toolkit 4 (www.globus.org) for
> developing WSRF-based grid services. The GT4 also uses Axis internally
> (Axis2 will be supported soon). One of the services I want to develop is
> based on several Eclipse plug-ins and so I need a running Equinox platform
> on the server. I would like to start one platform that provides my service
> implementations and have requests delegated to the OSGi services (or
> similarly an Axis service inside the platform).
>
> Can you tell me about your experiences? Have you succeeded with an
> approach like the Equinox ServletBridge? How do you set up your server?
>
> Thank you and best regards,
> Stefan Kurzbach
>
> Boyan Yurukov schrieb:
>> What I am implementing right now is a version of the ServletBridge, but
>> for direct access to the services. I will put the whole OSGi in the axis2
>> classpath, start the OSGi framework statically and call it from the axis2
>> web services. It worked for the ServletBridge, so it should for me.
>>
>> Thanks,
>> Boyan.
>>
>>
>>
>> "Gunnar Wagenknecht" <gunnar@wagenknecht.org> wrote in message
>> news:fr804i$9v9$1@build.eclipse.org...
>>> Boyan Yurukov schrieb:
>>>> Is there some external framework api I can use? Can I access the
>>>> exported packages in each bundle outside of the framework while in the
>>>> same jvm?
>>> Communication from outside of the OSGi framework to inside any bundle is
>>> painful because of classloading. It's easier to go the other way.
>>>
>>> What about creating your own light service interface and service
>>> registry outside of OSGi so that it gets loaded by the general web app
>>> classloader? You then need to create a fragment to the system bundle
>>> which exports the global registry packages to bundles. When bundles are
>>> started they register with the global registry and make implementations
>>> available to the outer web app.
>>>
>>> For details on how to create a fragment to the system bundle have a look
>>> at the following thread.
>>> http://dev.eclipse.org/mhonarc/lists/equinox-dev/msg01786.ht ml
>>>
>>> -Gunnar
>>>
>>> --
>>> Gunnar Wagenknecht
>>> gunnar@wagenknecht.org
>>> http://wagenknecht.org/
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04110 seconds