Last active
September 2, 2016 02:55
-
-
Save nbhusare/bafd98fa9df61a2281eef15dde7696c1 to your computer and use it in GitHub Desktop.
This file contains 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
/*TIP : Getting handle of services across DSL's using IGlobalServiceProvider*/ | |
// DSL Project | |
@Inject private IGlobalServiceProvider globalServiceProvider | |
val myLanguageIndex = globalServiceProvider.findService(URI.createURI("dummy.mylang"), MyLanguageIndex) | |
val myAnotherLanguageIndex = globalServiceProvider.findService(URI.createURI("dummy.anotherlang"), MyAnotherLanguageIndex) | |
// Non-DSL Project | |
val registry = IResourceServiceProvider.Registry.INSTANCE; | |
val resourceServiceProvider = registry.getResourceServiceProvider(URI.createURI("dummy.mylang")) | |
val resourceServiceProviderImpl = new IGlobalServiceProvider.ResourceServiceProviderImpl(registry, resourceServiceProvider) | |
val myLanguageIndex = resourceServiceProviderImpl.findService(URI.createURI("dummy.mylang"), MyLanguageIndex) | |
val myAnotherLanguageIndex = resourceServiceProviderImpl.findService(URI.createURI("dummy.anotherlang"), MyAnotherLanguageIndex) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment