Checking for service availability [message #96671] |
Thu, 06 September 2007 06:32 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03156 seconds