I started using OSGI in eclipse.Under Declarative Services I found out that there are two methods that's 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?
Bind methods are used to inject service references into the component instance, i.e. services that the component depends on. The activate method (if declared) is called in the last step of the activation process, when a component is satisfied.
So, I suppose you want to code your actions in the activate method, knowing that all your mandatory dependencies have been resolved at that point.
Note also that a declarative service component isn't a service in itself, but it may provide one.