mburbidg
Jun 9th, 2008, 01:40 PM
I'm importing a list of Spring-DM based osgi services using the following line in my context file:
<list id="views" interface="org.springframework.web.servlet.View"/>
I took the example from the documentation for iterating through a list of services and modified for my purposes. Here is how I'm iterating over the list from above. I injected a reference to the views bean into one of my beans. My bean has a field named views of type List. The code that follows is inside one of the methods of my bean. Somehow it seems like I should be able to get at the implementation name of the bean in the exporting bundle from within the iteration. In the xml you can filter services based on the spring bean name that implements the service. Is there a way to get at that name inside the iterator shown below? If so how would I do it?
for (Iterator iterator = views.iterator(); iterator.hasNext();) {
View view = (View) iterator.next();
view.executeOperation();
}
Thanks,
Michael-
<list id="views" interface="org.springframework.web.servlet.View"/>
I took the example from the documentation for iterating through a list of services and modified for my purposes. Here is how I'm iterating over the list from above. I injected a reference to the views bean into one of my beans. My bean has a field named views of type List. The code that follows is inside one of the methods of my bean. Somehow it seems like I should be able to get at the implementation name of the bean in the exporting bundle from within the iteration. In the xml you can filter services based on the spring bean name that implements the service. Is there a way to get at that name inside the iterator shown below? If so how would I do it?
for (Iterator iterator = views.iterator(); iterator.hasNext();) {
View view = (View) iterator.next();
view.executeOperation();
}
Thanks,
Michael-