How are you instantiating these classes? What is providing the AOP? On Nov 22, 2012 3:22 AM, "bflueras" <flueras.bog...@gmail.com> wrote:
> Hello all, > I have a service class with some methods and an abstract class called Intf > to which it delegates the work. > I want to secure the access to the service method doStuff(), but I've got > the following problem: > If I annotate with @RequiresAuthentication the "doStuff()" method of the > ServiceClass it works (#1), > but if I use the same annotation on the interface Intf's "doRealStuff()" > (#2) method it doesn't work anymore, not even when I add the annotation on > the Intf class (#3). > > //@RequiresAuthentication (#3) does NOT work > public abstract class Intf<T> { > //@RequiresAuthentication (#2) does NOT work > T doRealStuff(); > } > > public class ServiceClass<T> { > private final Intf delegate; > //constructor here > > //@RequiresAuthentication (#1) works > public T doStuff() { > return new Intf { > public T doRealStuff() { > // do real stuff > } > }; > } > } > > What can the problem be? I think that perhaps it's an anonymous class it > gets skipped somehow but I find the behaviour awkward. > The configuration of shiro.ini is fine, because in works but I can provide > it if necessary. > > Thank you. > > > > -- > View this message in context: > http://shiro-user.582556.n2.nabble.com/RequiresAuthentication-annotation-for-anonymous-classes-does-not-work-tp7577970.html > Sent from the Shiro User mailing list archive at Nabble.com. >