Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] cflow or something like that

Robert,

Here are a couple of other ideas:

1) An option that might work for you is to use load-time weaving. E.g., you could weave into the Hibernate code for your application's classloader to track cflow of execution from Hibernate.

2) Another idea that might work is if there is some a well-defined set of code that you do control that is the alternative to the code you want to identify. Then you might be able to use !cflow(jpThatDoesntTrigger()) to get the cases that were called by Hibernate.

> ------------Original Message------------
> as my stuff is being called by the framework
> (hibernate to be concrete) i do not have a
> (simple) chance on intercepting (but there are).
Hibernate does have some lifecycle events. Can you use them? What are you trying to do?
 
>  > If you are looking at stack traces, it might
>  > be more efficient to do it at a top-level entry
>  > point rather than at each execution of B.
> can you elaborate on what you mean by that?

Sure, use something like:

aspect TrackExternalCflow percflow(entryPoint()) {
    pointcut entryPoint() : execution(* MyFacade.*(..));
    boolean calledByHibernate;

    before() : entryPoint() {
        calledByHibernate = checkCallByHibernateFromStackTrace();
    }

    before() : execution(* B.executeB()) {
        if(calledByHibernate) {
            // your advice here
        }
    }
}



Back to the top