Hi Godwin, We tried the approach sometime back, but had to drop this coz of some complexities. * Some admin services needs to access the axis2 context hierarchy e.g. MessageContext, properties set in Handlers etc. So you cannot put all business logic to a OSGi Service. * Admin services can define permissions required to access them and the Security handlers checks whether the user is allowed access admin services. OSGi services which gives the same functionality as admin services allows components to use them freely without and security restrictions. AFAIR we faced such issues sometime back.
This approach is okay for some OSGi services/admin services, but not for all. So we need to carefully think before exposing an Admin service as an OSGi service. Thanks, Sameera. On Thu, Nov 13, 2014 at 10:36 PM, Godwin Amila Shrimal <[email protected]> wrote: > Hi, > > We have Admin Services in carbon products which are needed to access as > OSGI Services in the carbon context. Most of the time in Admin Services, it > check weather user is authorized in the method, So we cannot register same > Admin Service as a OSGI Service and access it. Since there are cases user > is not authorized when we access as a OSGI Service. What is the best way to > reuse the code and create OSGI Service and Admin Service. > > After discussing with some folks, i thought following mechanism to > implement it. > > 1. Create an interface for the Service > 2. Create an Implementation as OSGI Service > 3. Create Admin Service which reuse the OSGI Service and apply additional > security. (Here there will be no business logic and additional security > will only applied.) > > > Please give feedback on this. > > > Thanks > Godwin > > > > -- > *Godwin Amila Shrimal* > Senior Software Engineer > WSO2 Inc.; http://wso2.com > lean.enterprise.middleware > > mobile: *+94772264165* > linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>* > twitter: https://twitter.com/godwinamila > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > > -- Sameera Jayasoma, Software Architect, WSO2, Inc. (http://wso2.com) email: [email protected] blog: http://sameera.adahas.org twitter: https://twitter.com/sameerajayasoma flickr: http://www.flickr.com/photos/sameera-jayasoma/collections Mobile: 0094776364456 Lean . Enterprise . Middleware
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
