Hi Azeez, Is this different to how @scr annotations work? What are the implementations of these methods supposed to be doing? Also, when would these make to the API? C4 or later?
Thanks, Senaka. On Fri, Jun 29, 2012 at 9:10 PM, Afkham Azeez <[email protected]> wrote: > I just tested this with the attached webapp and the OSGi service call from > the webapp works as well. > > > On Thu, Jun 28, 2012 at 6:31 PM, Afkham Azeez <[email protected]> wrote: > >> After a discussion during today'd BAM REST API review, we came up with >> this idea of allowing webapps, services etc. to obtain references to OSGi >> services deployed in the platform using the Carbon APIs. As a result of >> this, I have added the following methods to the SuperTenantCarbonContext. >> >> /** >> * Obtain the first OSGi service found for interface or class >> <code>clazz</code> >> * @param clazz The type of the OSGi service >> * @return The OSGi service >> */ >> public Object getOSGiService(Class clazz) >> >> >> /** >> * Obtain the OSGi services found for interface or class >> <code>clazz</code> >> * @param clazz The type of the OSGi service >> * @return The List of OSGi services >> */ >> public List<Object> getOSGiServices(Class clazz) >> >> >> >> Usage example; >> ListenerManager listenerManager = (ListenerManager) >> * >> SuperTenantCarbonContext.getCurrentContext().getOSGiService(ListenerManager.class) >> *; >> System.out.println("Is listener running: " + >> !listenerManager.isStopped()); >> >> I have added & tested the above call in one of the Carbon kernel >> integration tests. >> >> -- >> *Afkham Azeez* >> Director of Architecture; WSO2, Inc.; http://wso2.com >> Member; Apache Software Foundation; http://www.apache.org/ >> * <http://www.apache.org/>** >> email: **[email protected]* <[email protected]>* cell: +94 77 3320919 >> blog: **http://blog.afkham.org* <http://blog.afkham.org>* >> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> >> * >> linked-in: **http://lk.linkedin.com/in/afkhamazeez* >> * >> * >> *Lean . Enterprise . Middleware* >> >> > > > -- > *Afkham Azeez* > Director of Architecture; WSO2, Inc.; http://wso2.com > Member; Apache Software Foundation; http://www.apache.org/ > * <http://www.apache.org/>** > email: **[email protected]* <[email protected]>* cell: +94 77 3320919 > blog: **http://blog.afkham.org* <http://blog.afkham.org>* > twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> > * > linked-in: **http://lk.linkedin.com/in/afkhamazeez* > * > * > *Lean . Enterprise . Middleware* > > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- *Senaka Fernando* Member - Integration Technologies Management Committee; Technical Lead; WSO2 Inc.; http://wso2.com* Member; Apache Software Foundation; http://apache.org E-mail: senaka AT wso2.com **P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818 Linked-In: http://linkedin.com/in/senakafernando *Lean . Enterprise . Middleware
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
