Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Finding/using OSGi services outside of the framework
Finding/using OSGi services outside of the framework [message #106149] Tue, 11 March 2008 15:29 Go to next message
Eclipse UserFriend
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 #106223 is a reply to message #106149] Wed, 12 March 2008 07:18 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

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/
Re: Finding/using OSGi services outside of the framework [message #106344 is a reply to message #106223] Thu, 13 March 2008 19:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Boyan.Yurukov.softwareag.com

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/
Re: Finding/using OSGi services outside of the framework [message #108003 is a reply to message #106344] Sat, 12 April 2008 12:28 Go to previous messageGo to next message
Stefan Kurzbach is currently offline Stefan KurzbachFriend
Messages: 3
Registered: July 2009
Junior Member
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/
>
>
Re: Finding/using OSGi services outside of the framework [message #108180 is a reply to message #108003] Tue, 15 April 2008 14:02 Go to previous message
Eclipse UserFriend
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/
>>
Previous Topic:Equinos OSGI Web-GUI
Next Topic:P2 smoke test of today's I-build: still a few issues, NPEs etc.
Goto Forum:
  


Current Time: Thu Apr 25 11:26:25 GMT 2024

Powered by FUDForum. Page generated in 0.03573 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top