aries-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toni Menzel <t...@okidokiteam.com>
Subject Re: Call OSGi services programmatically
Date Thu, 17 Nov 2011 10:59:11 GMT
+1 on DM
The real beauty is DS/DM/BP/Peaberry etc all work on top of the service
registry, so you can mix higher level frameworks that fit best.

On Thu, Nov 17, 2011 at 8:17 AM, Felix Meschberger <fmeschbe@adobe.com>wrote:

> Hi
>
> You might want to consider the Apache Felix DependencyManager [1]
>
> This of course has nothing to do with OSGi Blueprint or Spring/DM. It is
> just a programmatic front-end to simplify servie registration and DI.
>
> Regards
> Felix
>
> [1]  http://felix.apache.org/site/apache-felix-dependency-manager.html
>
> Am 16.11.2011 um 15:18 schrieb Martin Lichtin:
>
> Hi
>
> With SpringDM/Gemini it is possible to call a service programmatically
> like this:
>
>  Class<ValueProcessor> cls = ValueProcessor.class;
>  OsgiServiceProxyFactoryBean factoryBean = new
> OsgiServiceProxyFactoryBean();
>  factoryBean.setBundleContext(bundleContext);
>  factoryBean.setInterfaces(new Class[] { cls });
>  factoryBean.setFilter(filter);
>  factoryBean.setContextClassLoader(ImportContextClassLoader.CLIENT);
>  factoryBean.setBeanClassLoader(cls.getClassLoader());
>  factoryBean.afterPropertiesSet();
>  ValueProcessor valueProcessor = (ValueProcessor) factoryBean.getObject();
>
> How can one create the proxy instance of the service with Aries?
>
> Martin
>
>
>


-- 
Toni Menzel Source <http://tonimenzel.com>

Mime
View raw message