Hi Daniel,

Thanks for sharing your experience and for the enhancement suggestion. 

I've just made the SpringBeanRouter implement ApplicationContextAware, using 
the context received to instantiate the finders. Changes are checked in SVN 
trunk.

However, I'm not sure however about injecting the SpringBeanFinder because we 
need one instance per target resource bean...

Could you test the next snapshot and let me know if it work fine?

Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com
 

-----Message d'origine-----
De : Daniel Woo [mailto:daniely...@hotmail.com] 
Envoyé : vendredi 9 janvier 2009 17:26
À : discuss@restlet.tigris.org
Objet : *SPAM(1.8)* RE: Re: SpringBeanRouter issues

one more thing, if you want to intercept MyResource.represent(Variant), that 
won't work with Spring AOP (jdk proxy or cglib). Because this method is called 
by Resource.handleGet()

You have to intercept Resource.handleGet()/Put()/Post()/Delete(), or use static 
waver like aspectJ.

> I think you can make SpringBeanRouter implement ApplicationContextAware. I 
> made it this way, the AOP interceptor successfully executed.
> 
> I changed very little to your SpringBeanRouter and SpringBeanFinder:
> 
> SpringBeanRouter: make it ApplicationContextAware, and holds an 
> ApplicationContext. Each time createFinder() will pass that app context to 
> SpringBeanFinder.
> 
> SpringBeanFinder:now the constructor accepts an application context instead 
> of a beanFactory. Moreover, you actually can also make the beanFinder 
> ApplicationContextAware, in that way, you don't have to hard code "new  
> SpringBeanFinder(appContext, beanName)" anymore, you can even inject 
> SpringBeanFinder to SpringBeanRouter, hence the SpringBeanFinder can be 
> replaced by subclass written by the end user.
> 
> What do you think? It's at least useful to me because this solves my 
> transaction and security issue with Spring.

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

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

Reply via email to