Skip to main content



      Home
Home » Eclipse Projects » Equinox » Checking for service availability
Checking for service availability [message #96671] Thu, 06 September 2007 06:32
Eclipse UserFriend
Originally posted by: ado.bsiag.com

Hi all

I find myself writing if-statements to check whether an external service
has been found awfully often:

if (logService != null)
logService.log(LogService.LOG_DEBUG, "Some message.");

Or even worse with a getServiceReference statement every time I use the
service.

One solution is to put it into a method for every bundle and every
method of every service used. Not what I'd call elegant and not
necessarily fast. The same goes for some reflection approaches I've
looked at.

Is there an elegant (and probably even efficient) solution for this?

Regards

Arthur
Previous Topic:Difference between component factory and service factory
Next Topic:accessing a "library" jar file that is named on the classpath
Goto Forum:
  


Current Time: Sat May 10 07:38:52 EDT 2025

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

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

Back to the top