On Sat, Jun 13, 2009 at 10:02 AM, Jim Sellers<
jim.sellers@xxxxxxxxx> wrote:
> Hello all.
>
> I'm new to writing AOP code and have only used it for common uses like
> transactions (in spring). Please forgive me if I mess up the AOP terms, but
> feel free to correct me. ;-)
>
> Now I'm trying to solve an issues and I wanted to see if you guys have any
> advice about if I'm on the right track, "this is already done with lib X",
> ... (aside: I use maven / eclipse for the projects)
>
> Background for the problem I'm trying to solve:
> I am trying to put in some AOP code that will intercept calls to
> HTTPSession.setAttribute(...). Using this we will be able to verify that
> any code being put into session is serializable. Also, for any object that
> implments HTTPSession, we'll trap the state of the object being set (using
> HashcodeBuilder to generate a hash), and then at the end of the test verify
> the the object in our mock session has not changed (has the same hashcode).
> In this way we are hoping to be able to verify if an application is
> clusterable without a tedious class by class inspection.
>
> Here are the issues that I currently have:
> 1) I'm a little confused on what code should be "woven" - the creating of a
> mock HTTPSession will only happen in testing code (src/test/java) while the
> *calls* to setAttribute(..) that I care about will only happen in prod code
> (src/main/java)
Which code is calling HttpSession.setAttribute()? If you control that