Skip to main content



      Home
Home » Eclipse Projects » Equinox » ungetService
ungetService [message #131294] Fri, 15 May 2009 13:24 Go to next message
Eclipse UserFriend
Hi to everybody.

Hi have a struggle to start learning something of osgi.

Now I'm facing this issue: if I register a service s and then I retrieve
the list of services this way:

ServiceReference[] sr = bc.getAllServiceReferences(..);
(where bc is an instance of BundleContext)

i can in fact found s somewhere in sr.

Well: now, in order to eliminate s, (that is not permitting it can be used
again), I used bc.ungetService(s).
After successful execution of ungetService (it returned true), sr was not
changed: in fact I could found again s as a member of sr. (sr was obtained
via a new statement bc.getAllServiceReferences).

So I can't understand what ungetService does. What does it mean

"ungetService(ServiceReference reference)

Releases the service object referenced by the specified
ServiceReference object" ?

Thanks for your attention

Andrea
Re: ungetService [message #131326 is a reply to message #131294] Sun, 17 May 2009 02:30 Go to previous messageGo to next message
Eclipse UserFriend
andrea schrieb:
> So I can't understand what ungetService does. What does it mean

You use ungetService to inform the framework that you no longer *use* a
particular service. Whenever you *get* a service object instance from
the framework it increments an internal usage counter. The counter is
decremented when you *un-get* a service.

What you are looking for is *un-register*.

register <--> un-register
get <--> un-get

-Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: ungetService [message #131491 is a reply to message #131326] Tue, 19 May 2009 17:22 Go to previous message
Eclipse UserFriend
Excuse me for not answering earlier.

Thanks anyway

Andrea
Previous Topic:Problem with Jetty 6 in Equinox 3.5
Next Topic:Declarative service
Goto Forum:
  


Current Time: Wed Jul 23 16:17:42 EDT 2025

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

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

Back to the top