Hi,

On Jan 8, 2009, at 10:14 AM, postmas...@tigris.org wrote:

> Hi guys,
>
> Thanks for your hard work on Restlet with Spring integration, I am  
> able to integrate them according to the wiki, however I found two  
> issues
> I used SpringServerServlet to load the Application from spring  
> context configuration file appcontext.xml, and the root router is an  
> instance of org.restlet.ext.spring.SpringBeanRouter which is  
> injected by the Spring container into the Application. Hence  
> Application.createRoot() returns the injected SpringBeanRouter as  
> root router.
> So far, everything works but
> 1. Each resource bean must have an explicit ID, otherwise bean  
> lookup will fail.
> This is not a big deal, I can provide an ID for each resource bean.  
> Let look at the next issue which is a little complex.
>
> 2. Transaction interceptor can not intercept the bean managed  
> restlet resources, my JPA transaction manager and interceptor works  
> pretty good with DAO and other tiers but just can not work with  
> resource beans.

I haven't run into this because I tend to isolate any logic that needs  
to be transactional in a single call in the service layer.  However, I  
can't think of a reason why it couldn't be made to work.

Can you be more explicit about "just can not work"?  How are you  
trying to get it to work?  What's the evidence that it is not working?

> I took a look at the source code and found that the SpringBeanRouter  
> uses the following code to create a bean finder:
>
>    protected Finder createFinder(BeanFactory beanFactory, String  
> beanName) {
>        return new SpringBeanFinder(beanFactory, beanName);
>    }
>
> I am worrying about the beanFactory passed in is not a subclass of  
> ApplicationContext, the major difference between beanFactory and  
> AppContext is beanFactory does not support AOP.
> Is that the reason my transaction interceptor can not work?

If the way you are loading resource configuration results in a plain  
BeanFactory, then sure.  But if your resources and the router are  
defined and loaded as part of your Application Context, then  
beanFactory will be the actual application context.

Rhett

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1012021

Reply via email to