Home » Eclipse Projects » Equinox » Best way to determine whether Equinox is running
| | |
Re: Best way to determine whether Equinox is running [message #76109 is a reply to message #76065] |
Wed, 01 November 2006 13:01   |
Eclipse User |
|
|
|
Originally posted by: slewis.composent.com
Hi Jeff,
Jeff McAffer wrote:
> Actually, that tells you if the Eclipse Runtime is running. By
> extension that implies that Equinox is running. However, there are many
> valid and useful usecases that do involve Equinox and do not involve the
> org.eclipse.core.runtime bundle.
>
> As far as I recall, OSGi does not have a generic API that you can query
> without actually having OSGi running/present. If OSGi is running you
> can, for example, look at the status of bundle 0 (the system bundle).
> There are several other things you could look at but it seems like which
> is best will depend on your usecase. Can you say more about what you
> are trying to do?
We have some API bundles (ECF identity, ECF core, ECF provider for
example) with interfaces as well as a few factory classes.
Ideally, we would like to be able to run code that depends upon these
ECF APIs a) within Eclipse; b) in Equinox-based environments; c) in
other EE server environments (i.e. in eRCP, or non-Equinox OSGi); d) in
simple java applications.
With this query, it's mainly use case d that I'm trying to address (to
run the ECF generic server as a java application...a very simple ECF
server implementation/library), although for 'c' the problem also
exists. The most important ones for us currently are 'a', 'b', and 'd'.
Clearly, for 'd', the setup of the ECF factories, etc has to be done in
code rather than declaratively, but this is fine...we have runtime APIs
for manipulating the ECF factory contents.
We already have a compile-time dependency on IAdaptable, so no matter
which environment is present at runtime we need a few classes from
org.eclipse.core.runtime, but we don't have many of these dependencies
currently, and they are mostly on core interfaces (like
IAdaptable/IAdapterFactory), rather than on classes (like Platform) so
things work just fine in 'd' by adding core runtime jar to classpath.
So I suppose to address all use cases what's needed is either a) some
other consistent interface/way to determine whether the OSGi platform is
running; or b) an indication of the runtime requirements for all the
org.eclipse.ecf.core.runtime classes (if they are going to serve that
role WRT Equinox).
Please let me know if this conclusion/analysis isn't right...or even if
it is!
Thanks,
Scott
>
> Jeff
>
>
> Scott Lewis wrote:
>> Scott Lewis wrote:
>>> I would like to have some code that would run within Equinox or as
>>> java application. Is there a way this code can query whether Equinox
>>> is running?
>>
>> Platform.isRunning() duh...sorry for the distraction
|
|
|
Re: Best way to determine whether Equinox is running [message #76123 is a reply to message #76109] |
Wed, 01 November 2006 14:00   |
Eclipse User |
|
|
|
Originally posted by: jeff_mcaffer.REMOVE.ca.ibm.com
I guess what I am asking is "what is the question you want to ask in the
code and how would you react depending on the different answers?" some
sample questions
- Is Equionx running?
- Is OSGi running?
- Is an Eclipse application running?
- etc.
all of these are different questions answered in differnet ways by
different people.
Jeff
Scott Lewis wrote:
> Hi Jeff,
>
> Jeff McAffer wrote:
>> Actually, that tells you if the Eclipse Runtime is running. By
>> extension that implies that Equinox is running. However, there are
>> many valid and useful usecases that do involve Equinox and do not
>> involve the org.eclipse.core.runtime bundle.
>>
>> As far as I recall, OSGi does not have a generic API that you can
>> query without actually having OSGi running/present. If OSGi is
>> running you can, for example, look at the status of bundle 0 (the
>> system bundle). There are several other things you could look at but
>> it seems like which is best will depend on your usecase. Can you say
>> more about what you are trying to do?
>
> We have some API bundles (ECF identity, ECF core, ECF provider for
> example) with interfaces as well as a few factory classes.
>
> Ideally, we would like to be able to run code that depends upon these
> ECF APIs a) within Eclipse; b) in Equinox-based environments; c) in
> other EE server environments (i.e. in eRCP, or non-Equinox OSGi); d) in
> simple java applications.
>
> With this query, it's mainly use case d that I'm trying to address (to
> run the ECF generic server as a java application...a very simple ECF
> server implementation/library), although for 'c' the problem also
> exists. The most important ones for us currently are 'a', 'b', and 'd'.
>
> Clearly, for 'd', the setup of the ECF factories, etc has to be done in
> code rather than declaratively, but this is fine...we have runtime APIs
> for manipulating the ECF factory contents.
>
> We already have a compile-time dependency on IAdaptable, so no matter
> which environment is present at runtime we need a few classes from
> org.eclipse.core.runtime, but we don't have many of these dependencies
> currently, and they are mostly on core interfaces (like
> IAdaptable/IAdapterFactory), rather than on classes (like Platform) so
> things work just fine in 'd' by adding core runtime jar to classpath.
>
> So I suppose to address all use cases what's needed is either a) some
> other consistent interface/way to determine whether the OSGi platform is
> running; or b) an indication of the runtime requirements for all the
> org.eclipse.ecf.core.runtime classes (if they are going to serve that
> role WRT Equinox).
>
> Please let me know if this conclusion/analysis isn't right...or even if
> it is!
>
> Thanks,
>
> Scott
>
>
>>
>> Jeff
>>
>>
>> Scott Lewis wrote:
>>> Scott Lewis wrote:
>>>> I would like to have some code that would run within Equinox or as
>>>> java application. Is there a way this code can query whether
>>>> Equinox is running?
>>>
>>> Platform.isRunning() duh...sorry for the distraction
|
|
| | | | | | |
Re: Best way to determine whether Equinox is running [message #76797 is a reply to message #76687] |
Wed, 08 November 2006 13:25  |
Eclipse User |
|
|
|
Originally posted by: jeff_mcaffer.REMOVE.ca.ibm.com
Scott Lewis wrote:
> Jeff McAffer wrote:
>> Not to be pedantic about it but is the question you want to ask
>> "Is there a registry service?"
> Yes.
Given that, you should be able just to see if the registry service is
present by using standard OSGi service registry calls.
> I wasn't aware that Equinox can/could run without the Extension
> registry...thanks. For curiosity's sake...what's the minimal Equinox,
> then, above and beyond OSGi spec?
I'm not quite sure how to answer that. Equinox is, in essence, our OSGi
framework implementation. So the minimal Equinox is the
org.eclipse.osgi bundle. It runs fine just by itself. In fact, there
is a mess of stuff in there that really isn't needed by someone just
doing OSGi. As you step up from that you add bundles that get you the
function you want. If you want the registry (for example) you likely
just need org.eclipse.equinox.registry and org.eclipse.equinox.common.
Jobs would be optional.
In general then you start with the bundle(s) that implement the function
you need and pull the dependency strings. The work we have going on now
is to reduce the number of interconnections and at the very bottom cut
the string that connect people to the org.eclipse.osgi bundle. (see my
reply to Alex)
Jeff
|
|
|
Goto Forum:
Current Time: Sat May 10 02:07:53 EDT 2025
Powered by FUDForum. Page generated in 0.03912 seconds
|