Calling OSGI Services from a Jaggery App
There can be situations where a Service exposed as an OSGI component needed to be called directly from a Jaggery app, without exposing the srvice as a RESTful service. This is pretty simple and all it takes is the following snippet.
where "org.wso2.carbon.ml.dataset.DatasetService" is the full class path of the class exposed as the OSGI service. Then any method in the service can simply be called as follows.var carbon = require('carbon'); var datasetService = carbon.server.osgiService('org.wso2.carbon.ml.dataset.DatasetService');
2 comments
I am very happy that I can read these articles. Aasadlabiznesu.pl
ReplyDeleteMany people should read such posts, they are well written.
ReplyDeleteMegan