Created

Jan 29, 2013

OSGI Activate & Deactivate signatures

Posted by Nicolas Peltier

it's sometimes a bit confusing which signature to use for activate or deactivate in an OSGI component. This is because you have the choice, and this is nice :-) 

As long as you add the @Activate and @Deactivate tag before your methods, you can have zero, one or several arguments among following types (that will be automatically bound at component activation/deactivation): 

Activation

  • ComponentContext - the Component Context for the component
  • BundleContext - the Bundle Context of the component's bundle
  • Map - the Component Properties from ComponentContext.getProperties.     

Deactivation:     

  • int/Integer - the deactivation reason
  • ComponentContext - the Component Context for the component
  • BundleContext - the Bundle Context of the component's bundle
  • Map - the Component Properties from ComponentContext.getProperties.

For more information on this, you can look at the dedicated Apache Felix JIRA

COMMENTS

  • By best gadgets - 4:12 AM on Jun 05, 2014   Reply
    Nice information. Thank you for sharing it with us!
    • By catering jakarta selatan - 7:27 PM on Jun 08, 2014   Reply
      i really to say nice tools from adobe. i like it.
      • By how to increase height - 10:36 AM on Aug 15, 2014   Reply
        He accepts association where representatives are enabled to have admittance to information, convey more noteworthy quality
      • By Shon - 2:14 PM on Aug 21, 2014   Reply
        I always thought I have done things right until I read something you post.

        Now I am off to change my whole structure of my email responder.
      • By cheat gta - 1:47 AM on Jul 03, 2014   Reply
        i really to say nice tools from adobe. i like it.
        • By model baju lebaran - 4:49 PM on Jul 12, 2014   Reply
          i really to say nice tools from adobe. i like it.
          • By cek tagihan pln - 4:49 PM on Jul 12, 2014   Reply
            i really look tools from adobe. i like it.
            • By menu buka puasa - 9:12 AM on Jul 15, 2014   Reply
              i really to say nice tools from adobe. i like it.
              • By Yamaha R15 indonesia - 9:12 AM on Jul 15, 2014   Reply
                i really to say nice tools from adobe. i like it.
                • By Crystal X Asli - 2:56 AM on Jul 17, 2014   Reply
                  i really to say nice tools from adobe. i like it.
                  • By Crystal X Asli - 8:26 PM on Jul 22, 2014   Reply
                    i really to say nice tools from adobe. i like it.
                    • By Crystal X Asli - 8:26 PM on Jul 22, 2014   Reply
                      i really to say nice tools from adobe. i like it.
                      • By Crystal X Asli - 8:27 PM on Jul 22, 2014   Reply
                        i really to say nice tools from adobe. i like it.
                      • By Tattoos - 4:56 PM on Jun 08, 2014   Reply
                        Many Thanks.
                        • By catering jakarta selatan - 7:27 PM on Jun 08, 2014   Reply
                          i really to say nice tools from adobe. i like it.
                          • By step up height - 8:02 AM on Jun 09, 2014   Reply
                            Few month ago I was an dream to get excellent height, but I can't get this before using Step Up body growth. This product makes my dream true and gives me excellent height
                            • By Obat Keputihan - 9:52 AM on Jun 22, 2014   Reply
                              Many Thanks.
                              • By dien dan seo - 10:06 AM on Jun 28, 2014   Reply
                                Many Thanks.
                                • By Read more - 8:02 AM on Jul 04, 2014   Reply
                                  OSGI active is a great article. I am pretty much impressed with your good work.You put really very helpful information. Keep it up.
                                  • By sup933 - 4:40 PM on Jul 08, 2014   Reply
                                    [url=http://www.taiarmy.net/]tải army[/url]
                                    Many Thanks
                                    • By tải army - 4:41 PM on Jul 08, 2014   Reply
                                      Many Thanks
                                      • By url opener - 6:23 PM on Jul 15, 2014   Reply
                                        This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work...
                                        • By duplichecker - 8:00 PM on Jul 18, 2014   Reply
                                          woah! I’m really enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that perfect balance between superb usability and visual appeal. I must say you’ve done a very good job with this.
                                          • By Crystal X Asli - 8:27 PM on Jul 22, 2014   Reply
                                            i really to say nice tools from adobe. i like it.
                                            • By Crystal X Asli - 8:27 PM on Jul 22, 2014   Reply
                                              i really to say nice tools from adobe. i like it.
                                              • By crystal x asli - 5:20 PM on Aug 10, 2014   Reply
                                                joz !!
                                                • By crystal x asli nasa - 5:21 PM on Aug 10, 2014   Reply
                                                  Actually I am not habituate to reply a comment on blogs but this blog caught my attention and I am compelled to write a comment here to express my gratitude to you. I would like to appreciate for this awesome work.
                                                  • By crystal x asli nasa - 5:22 PM on Aug 10, 2014   Reply
                                                    I am not habituate to reply a comment on blogs but this blog caught my attention and I am compelled to write a comment here to express my gratitude to you. I would like to appreciate for this awesome work
                                                    • By office refurbishment - 11:08 AM on Aug 15, 2014   Reply
                                                      Good one. Very nice work. You've not exaggerated anything too much, you've kept it simple. It is good to see that. I hope your next articles will also be compromising of the same awesome quality as this article.
                                                      • By ASUS ZenFone Smartphone Android Terbaik - 9:16 PM on Aug 26, 2014   Reply
                                                        yess thanks for sharing sirrrr.

                                                        ADD A COMMENT