aries-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Lichtin <lich...@yahoo.com>
Subject Call OSGi services programmatically
Date Wed, 16 Nov 2011 14:18:57 GMT
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

Mime
View raw message