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 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.

                          ADD A COMMENT