I have this sort of situation:
interface Users {
User getUserByID(String ID);
}
Anyone should be able to execute this method. The User object returned should however be protected by acegi.
In my UsersImpl I can not just do "return new UserImpl(ID)", since I can not intercept this.
I believe the correct path is to have something like this in UsersImpl:
return applicationContext.getBean("UserFactory").createUs er(ID);
I can then use ProxyFactoryBean to proxy the UserFactory interface, and add my Security definition as an interceptor.
But, referring to applicationContext from a POJO implementation feels wrong.
Can someone please get me on the right track?


