Hi Costin, first thanks for the reply.
I tried following configuration:
I have com.xyz.MyServiceImpl bean exported as OSGi service from other bundle.
<reference id="myService" interface="com.xyz.MyServiceInterface"/>
<bean id="serviceConsumer" class="MyServiceConsumerImpl">
<property name="serviceReferenceField" ref="myService"/>
<property name="myServiceFiled" ref="myService"/>
My goal is to get the com.xyz.MyServiceImpl bean injected to serviceConsumer as myServiceFiled. Not the proxy created by Spring DM. I am not interested to get the raw ServiceReference.
I don't like proxy for the service like cache interface, which could be invoked thousands times per second.
Apologize if didn't make it clear at first place.
However, I could get the raw service object by following code:
I want to know is it possible to inject com.xyz.MyServiceImpl raw instance by configuration instead of my code. Or it could be a feature for future.
ServiceReference nativeReference = ((ServiceReferenceProxy)serviceReference).getTargetServiceReference();
com.xyz.MyServiceImpl myServiceImpl= (com.xyz.MyServiceImpl)bundleContext.getService(nativeReference);