[jboss-dev-forums] [JBoss AS 7 Development] - EJB business methods invoked by @Timeout (same bean) not intercepted

Guido Bonazza do-not-reply at jboss.com
Mon Feb 13 12:56:25 EST 2012


Guido Bonazza [https://community.jboss.org/people/guidbona] created the discussion

"EJB business methods invoked by @Timeout (same bean) not intercepted"

To view the discussion, visit: https://community.jboss.org/message/716274#716274

--------------------------------------------------------------
Hi, 
it seems that EJB business methods invoked from @Timeout in the same bean are not intercepted.
Also, @Asynchronous methods invoked from @Timeout are not executed asynchronously.
All of this happens only to methods belongin to the same bean as @Timeout. If the @Timeout method invokes business methods belonging to a different bean everything is Ok.

Here is an example:


@Stateless
public class TimedBean {
    @Timeout
    public void timeout() {
        asyncMethod();
    }

    @Asynchronous
    public void asyncMethod() {
        // ...
    }
}



By the way, stepping with the debugger in asyncMethod() I saw that timeout() is calling it immediately, as if it wasn't a business method.

I've created a test case for this at  https://github.com/guidbona/jboss-as/commits/timer-selfinvoke https://github.com/guidbona/jboss-as/commits/timer-selfinvoke. The tests correctly fail.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/716274#716274]

Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120213/b0bb5c3f/attachment.html 


More information about the jboss-dev-forums mailing list