Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Programmatically start Equinox in standalone application
Programmatically start Equinox in standalone application [message #91367] Fri, 29 June 2007 15:29 Go to next message
Eclipse UserFriend
Originally posted by: ddanny.gmail.com

Hello,

I am new to OSGi and Eclipse Equinox, so please accept my apologies if I am asking some sort of stupid questions.

We are currently developing a standalone J2SE application that will need to load some bundles/plugins/modules that will be written for it. We have chosen Eclipse Equinox as the OSGi implementation.

We have several questions:
1. Is it possible to write the plugins as Equinox bundles?
2. Is it possible to programmatically start the Equinox framework from our application?
3. If #2 is possible, is it possible to programmatically install, start, stop... the bundles?

Thank you,

Dan
Re: Programmatically start Equinox in standalone application [message #91383 is a reply to message #91367] Fri, 29 June 2007 22:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

Yes, you can embed Equinox in your Java application, and from there, install/start/stop items.

EclipseStarter.startup(...)

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/api/org/eclipse/core/runtime/adap tor/EclipseStarter.html

That will give back a BundleContext of the system bundle that you can then use to do e.g. Bundle.install().

However, your application won't have visibility to the plugins defined; the classloaders aren't compatible. Your best bet would be to start up Eclipse, then bring up your existing Java application as a (large) bundle, and then define the additional plugins from there.

Alex.
Re: Programmatically start Equinox in standalone application [message #91502 is a reply to message #91383] Wed, 04 July 2007 06:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ddanny.gmail.com

Alex,

Thank you for your reply!
I have also noticed your tutorial later and it seems to work fine, now.
http://www.eclipsezone.com/eclipse/forums/t93976.rhtml

Regards,

Dan
Re: Programmatically start Equinox in standalone application [message #91621 is a reply to message #91502] Fri, 06 July 2007 06:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lakemove.gmail.com

Dan Dromereschi 写道:
> Alex,
>
> Thank you for your reply!
> I have also noticed your tutorial later and it seems to work fine, now.
> http://www.eclipsezone.com/eclipse/forums/t93976.rhtml
>
> Regards,
>
> Dan


hey, im a newbie. the link you provide works fine. then i have another
question :

it works if i run "EclipseStarter.startup(equinoxArgs,null);" in main
method , but as a JUnit TestCase, it doesn't:

@Test
public void testEclipseStarter()throws Exception
{
//the starter codes.....
}

BR
Jay
Re: Programmatically start Equinox in standalone application [message #91648 is a reply to message #91621] Fri, 06 July 2007 08:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

You might be trying to start it multiple times. You should really tear it down each time with shutdown in the setUp and tearDown methods.

Alex.
Re: Programmatically start Equinox in standalone application [message #91837 is a reply to message #91648] Mon, 09 July 2007 17:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ddanny.gmail.com

Alex,

Is it possible to write a bundle that uses code from .jar libraries, but it also needs some native libraries?
Could you direct me to a good tutorial / example?

Thank you,

Dan
Re: Programmatically start Equinox in standalone application [message #92098 is a reply to message #91837] Fri, 13 July 2007 14:41 Go to previous messageGo to next message
Brett Humphreys is currently offline Brett HumphreysFriend
Messages: 17
Registered: July 2009
Junior Member
Dan Dromereschi wrote:
> Is it possible to write a bundle that uses code from .jar libraries, but it also needs some native libraries?
> Could you direct me to a good tutorial / example?

Dan,
I don't have a tutorial for you, but the OSGi R4 guide (downloadable from the osgi site) is a great
starting point. I know the OSGi R4 spec allows for library jar files (that can be embedded within a
bundle) and I believe there are allowances made for native libraries as well.

-Brett
Re: Programmatically start Equinox in standalone application [message #92113 is a reply to message #92098] Fri, 13 July 2007 17:19 Go to previous message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

I touched on it (briefly) at http://www.eclipse.org/articles/eclipse-vms/ if you wanted to look at that.

Alex.
Previous Topic:JSF support / myFaces and equinox
Next Topic:BundleActivator in main thread
Goto Forum:
  


Current Time: Fri Apr 19 20:02:53 GMT 2024

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

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

Back to the top