Skip to main content



      Home
Home » Eclipse Projects » Equinox » Difference Between Bind & Activate??
Difference Between Bind & Activate?? [message #872999] Thu, 17 May 2012 05:31 Go to next message
Eclipse UserFriend
Hi,
I started using OSGI in eclipse and under Declarative Services I found out that there are two methods thats been executed once a service is activated. I.e Activate and Bind..
What is the difference between these two?

If I want to execute certain actions to be performed when my service is started, do I put it in the Bind method or the Activate method?

Thanx in advance.

[Updated on: Thu, 17 May 2012 05:45] by Moderator

Re: Difference Between Bind & Activate?? [message #873067 is a reply to message #872999] Thu, 17 May 2012 08:53 Go to previous messageGo to next message
Eclipse UserFriend
The activate method is called when your component is activated. So this is a good time to perform any initialization activities. The bind method is called once for each service your component references. So if your component has a reference to LogService, your bind method will be called with the LogService bound to your component. The method can then store the LogService in a field.
Re: Difference Between Bind & Activate?? [message #873088 is a reply to message #873067] Thu, 17 May 2012 09:35 Go to previous message
Eclipse UserFriend
Thanx.
I think I got it now.
Previous Topic:State of Equinox from 4.2
Next Topic:Import-Package necessary for org.xml.sax?
Goto Forum:
  


Current Time: Sat Jul 05 01:03:53 EDT 2025

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

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

Back to the top