Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Difference Between Bind & Activate??
Difference Between Bind & Activate?? [message #872999] Thu, 17 May 2012 09:31 Go to next message
Dinuka Perera is currently offline Dinuka PereraFriend
Messages: 7
Registered: April 2012
Junior Member
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 09:45]

Report message to a moderator

Re: Difference Between Bind & Activate?? [message #873067 is a reply to message #872999] Thu, 17 May 2012 12:53 Go to previous messageGo to next message
BJ Hargrave is currently offline BJ HargraveFriend
Messages: 60
Registered: July 2009
Member
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 13:35 Go to previous message
Dinuka Perera is currently offline Dinuka PereraFriend
Messages: 7
Registered: April 2012
Junior Member
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 Apr 27 05:01:14 GMT 2024

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

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

Back to the top