aries-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Ward <timothyjw...@apache.org>
Subject RE: Call OSGi services programmatically
Date Wed, 16 Nov 2011 14:43:37 GMT

Hi Martin,

Aries doesn't have a programmatic API for creating blueprint managed beans, references or
services. I assume that XML isn't appropriate for your use case?

Regards.

Tim Ward
-------------------
Apache Aries PMC member & Enterprise OSGi advocate
Enterprise OSGi in Action (http://www.manning.com/cummins)
-------------------


Date: Wed, 16 Nov 2011 06:18:57 -0800
From: lichtin@yahoo.com
Subject: Call OSGi services programmatically
To: user@aries.apache.org

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