InputStream inputStream = generateInputStream(displayName, bundle);
String bundleIdStr = String.valueOf(bundle.getBundleId());
String bundleName = bundle.getSymbolicName();
IContributor contributor = new RegistryContributor(bundleIdStr, bundleName, null, null);
@SuppressWarnings("restriction")
ExtensionRegistry extensionRegistry = (ExtensionRegistry) Platform.getExtensionRegistry();
@SuppressWarnings("restriction")
Field declaredField = ExtensionRegistry.class.getDeclaredField("masterToken");
declaredField.setAccessible(true);
Object masterToken = declaredField.get(extensionRegistry);
@SuppressWarnings("restriction")
boolean addContribution = extensionRegistry.addContribution(inputStream, ContributorFactoryOSGi.createContributor(bundle42), false,
null, null, masterToken);
The method "extensionRegistry.addContribution" return true, but when I iterate over the registered items for the particular
extensions point after this method, I'm unable to find this registration I did dynamically.
If it returns true does not that mean that the dynamic registration was successful?
Why am I not able to see it in the ExtensionRegistry?
Appreciate your feedback..
--
------------------------------------------------------------------------------------------->>
Awanthika Senarath
Software Engineer
WSO2 Inc,