Created
July 6, 2019 08:24
-
-
Save athiththan11/160a16cfbb4fe09261d8033cb7a725b9 to your computer and use it in GitHub Desktop.
Fabricator OSGi service component implementation containing the activation with the Bundle Context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Component(name = "com.sample.athiththan.fabricator.internal.service", immediate = true) | |
| public class FabricatorServiceComponent { | |
| private static final Logger LOGGER = Logger.getLogger(FabricatorServiceComponent.class.getName()); | |
| @Activate | |
| protected void activate(ComponentContext context) { | |
| /** | |
| * create a new instance inside the activate method and register the service | |
| */ | |
| // create an instance and register | |
| context.getBundleContext().registerService(FactFabricator.class.getName(), new FactFabricator(), null); | |
| LOGGER.info("OSGI Fabricator :: Fabricator bundle is activated"); | |
| } | |
| @Deactivate | |
| protected void deactivate(ComponentContext context) { | |
| LOGGER.info("OSGI Fabricator :: Fabricator bundle is deactivated"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment