You will only be able to easily retrieve an instance of this bean when inside your SU. To do that, there are several ways, the first one is to inject it using spring, the next one is to implement a BeanFactoryAware interface (iirc) so that you can access the bean factory and retrieve all the beans you want programmatically. If you want to access your bean outside the SU, it becomes a bit trickier imho (and I'm not even sure this is possible right now).
On Jan 21, 2008 5:37 PM, Luchesar Cekov <[EMAIL PROTECTED]> wrote: > > Hi ServiceMix guys, > > Can someone explain me how can I get an instance of a bean defined in my > Service Unit xbean.xml. > > I have jsr181 service unit that simply deploys a POJO as a service and I > want to use it through a JBI NMR proxy. Then I instrument another class > with the proxy service and I want to get an instance of it > programmatically. > > I have something like this: > Service Unit xbean.xml > > </beans> > .... > <bean id="deploymentService" > class="org.ipsuper.ssb.DeploymentService"> > <property name="service"> > <jsr181:proxy > service="deployment:DeploymentService" > context="#context" type=" > org.ipsuper.ssb.IDeploymentService" /> > </property> > </bean> > </beans> > > How can I obtain an instance of this bean in my code? I succeeded in > injecting deploymentService bean as a property of another service but this > is not what I want. I also tried to get it from (SpringJBIContainer) > container but it wasn't there. I guess I should somehow get a ServiceUnit > specific BeanFactory but cannot find how. > Please anybody help. > > Best, > Luchesar > -- > View this message in context: > http://www.nabble.com/ServiceMix-Spring-BeanFactory-hierarchy-tp15001268s12049p15001268.html > Sent from the ServiceMix - User mailing list archive at Nabble.com. > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/
