Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » how to check if DS is running?
how to check if DS is running? [message #479352] Mon, 10 August 2009 18:14 Go to next message
Andre Dietisheim is currently offline Andre DietisheimFriend
Messages: 131
Registered: July 2009
Senior Member
Hi!

I am currently trying to get an ECF(-REST) service running whether DS is
running or not. My current approach marks org.eclipse.equinox.ds as
optional dependency and supplies DS-configurations. I then try to check
programmatically if DS's running. If it isn't, I register and track
services programmatically. I looks throught the ds-activator and thought
to understand, that the main DS-service is registered as
ConfigurationListener.

org.eclipse.equinox.ds:
Activator#initSCR():

// add the configuration listener - we to receive CM events to restart
// components
cmTrackerReg = bc.registerService(ConfigurationListener.class.getName(),
scrManager, null);

My current code that checks if DS is running looks as follows:

private boolean isDSRunning(BundleContext context) {
ServiceReference[] serviceReferences = null;
try {
serviceReferences =
context.getServiceReferences(
ConfigurationListener.class.getName(), null);
} catch (InvalidSyntaxException e) {
// ignore
}
return serviceReferences != null
&& serviceReferences.length > 0;
}

Could I ask you guys to give me your hints on this? I'd be more than
happy to get confirmed/corrected!

Cheers + thanks in advance
André
Re: how to check if DS is running? [message #480119 is a reply to message #479352] Thu, 13 August 2009 22:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

Ande,

Take a look at the links in:
http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg05597.html

cheers,
John
Re: how to check if DS is running? [message #480154 is a reply to message #480119] Fri, 14 August 2009 07:50 Go to previous messageGo to next message
Andre Dietisheim is currently offline Andre DietisheimFriend
Messages: 131
Registered: July 2009
Senior Member
Hi John

thanks for the links! Tom does indeed address the equinox version of DS
directly:

http://publicsvn.bestsolution.at/repos/java/examples/EMF-Dat abinding/at.bestsolution.soccer.app/src/at/bestsolution/socc er/app/intro/Application.java

This might be acceptable in Tom's case (he has an RCP, that's running in
equinox anyhow). My usecase is related to ECF and theres no need to
restrict thing to be equinox only.
Whats interesting is that the guys @felix think that there's not other
way but to check for the explicit bundles (equinox-version,
felix-version, etc.).

A third opiniion suggests to use a dummy, DS declared service. If the
dummy service gets registered, I know that DS is running. This sounds
like the best option to me.

http://www.mail-archive.com/users@felix.apache.org/msg05205. html

John E. Conlon wrote:
> Ande,
>
> Take a look at the links in:
> http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg05597.html
>
>
> cheers,
> John
Re: how to check if DS is running? [message #480238 is a reply to message #480154] Fri, 14 August 2009 14:03 Go to previous message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

Hi Ande,

Oops - sorry I sent you the wrong link. (A good bookmark organization
more often beats memory and a quick google search;-)

What I really wanted to send you was a link to Ben Vitale's blog on how
he troubleshot P2 Policy UI and Declarative Services see:
http://eclipse-ruminations.blogspot.com/2009_06_01_archive.h tml

This one may also be of interest:
http://eclipse.dzone.com/articles/dependencies-and-services- osgi

Your right you can always create a service and see if it works, but that
is (services don't start) is typically the reason for troubleshooting ds
in the first place.

The best way is most often to bring up an OSGi console. The two
articles above are Eclipse centric so they focus on the Equinox console,
but Felix and the other OSGi run times also have OSGi consoles that you
can use to troubleshoot DS and other OSGi service related problems.

hope this helps,

John




Ande Dietisheim wrote:
> Hi John
>
> thanks for the links! Tom does indeed address the equinox version of DS
> directly:
>
> http://publicsvn.bestsolution.at/repos/java/examples/EMF-Dat abinding/at.bestsolution.soccer.app/src/at/bestsolution/socc er/app/intro/Application.java
>
>
> This might be acceptable in Tom's case (he has an RCP, that's running in
> equinox anyhow). My usecase is related to ECF and theres no need to
> restrict thing to be equinox only.
> Whats interesting is that the guys @felix think that there's not other
> way but to check for the explicit bundles (equinox-version,
> felix-version, etc.).
>
> A third opiniion suggests to use a dummy, DS declared service. If the
> dummy service gets registered, I know that DS is running. This sounds
> like the best option to me.
>
> http://www.mail-archive.com/users@felix.apache.org/msg05205. html
>
> John E. Conlon wrote:
>> Ande,
>>
>> Take a look at the links in:
>> http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg05597.html
>>
>>
>> cheers,
>> John
>
Previous Topic:new software installed, but features and plugins not available ?
Next Topic:how do i enable -Djava.endorsed.dirs in 3.5?
Goto Forum:
  


Current Time: Fri Apr 26 22:33:36 GMT 2024

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

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

Back to the top