I need to better understand your requirements:

Are you simply trying to get a valid BundleContext?  If so you get access
to your bundle's BundleContext when you bundle is activated.  The
BundleContext is passed to you in your BundleActivator.start(BundleContext)
method.

From your description it does not sound like you want to actually start
another instance of the Equinox when your bundle is already running in an
instance of the Framework.  Instead you simply need to get access to your
bundle's BundleContext so you can interact with the Framework.

HTH.

Tom




                                                                                
                                               
  From:       "林恺" <[EMAIL PROTECTED]>                                          
                                            
                                                                                
                                               
  To:         equinox-dev@eclipse.org                                           
                                               
                                                                                
                                               
  Date:       09/02/2008 09:15 PM                                               
                                               
                                                                                
                                               
  Subject:    [equinox-dev] Starting equinox framework in program               
                                               
                                                                                
                                               





     I was trying to build an OSGi runtime monitor to control and monitor
the equinox framework. This OSGi runtime monitor is an Eclipse plugin, and
is something just like the OSGi console when we running equinox application
in eclipse through OSGi Framework launch configuration, and we can list
bundle and service information, start and stop bundle and so on.

     The problem is I can find the way to start equinox framework programly
and get the BundleContext. I have search on google, and get this method:

      BundleContext  context = EclipseStarter.startup(new String[]
{ "-console", "-clean" }, null);

     This can work when I put it in a Java Application, but when I put it
in an Eclipse Plugin, I got this error message:

     java.lang.IllegalStateException: Platform already running

     The reason for this may be : We have started the Eclipse platform, and
then we use EclipseStarter to start our equinox framework, we get this
error.

     Is there a way I can start equinox framework in program and get the
BundleContext? When we running equinox application in eclipse through OSGi
Framework launch configuration, It seems the way. Does anyone can give me
some help?

    Thanks.
    Link_______________________________________________
equinox-dev mailing list
equinox-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

_______________________________________________
equinox-dev mailing list
equinox-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to