Hi All,

We have registered the RegistryProvider inside the*
registry.ws.client*bundle and trying to get that registered service at
*registry.core*.
But that service is going to fetch at the MountHandler before register it
at  WSClientServiceComponent. ?? We need some OSGI magic to fix this issue.

1) Register service.
[1]
https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/java/org/wso2/carbon/registry/ws/client/internal/WSClientServiceComponent.java

        *ht.put("type", "ws");*
*        serviceRegistration =*
*
context.getBundleContext().registerService(RegistryProvider.class.getName(),
*
*                        provider, ht);*


2) Get registered service.

[2]
https://svn.wso2.org/repos/wso2/carbon/kernel/trunk/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/handlers/builtin/MountHandler.java

* ServiceTracker tracker =*
*                            new ServiceTracker(bundleContext,
RegistryProvider.class.getName(),*
*                                    null);*
*                    tracker.open();*
*                    ServiceReference[] references =
tracker.getServiceReferences();*
*                    if (references != null) {*
*                        for (ServiceReference reference : references) {*
*                            if
(registryType.equals(reference.getProperty("type"))) {*
*                                registryProvider = (RegistryProvider)
tracker.getService(reference);*
*                                break;*
*                            }*
*                        } *

Thanks
Ajithn
-- 
Ajith Vitharana.
WSO2 Inc. - http://wso2.org
Email  :  aji...@wso2.com
Mobile : +94714631794
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to