Yes. It's working as expected from my web app. Thanks.

Regards
Buddhika

On Fri, Jun 29, 2012 at 9:10 PM, Afkham Azeez <az...@wso2.com> 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 <az...@wso2.com> 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: **az...@wso2.com* <az...@wso2.com>* 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: **az...@wso2.com* <az...@wso2.com>* 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
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to