[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Specifying pointcuts in aop.xml
|
Craig
Do you refer to
http://dev.eclipse.org/mhonarc/lists/aspectj-dev/msg02152.html
, I am not sure why it is not helpful.
Other solution in my mind would be first, specify pointcuts at interface level,
public pointcut loggedGetOperations ()
execution (public void HttpServlet.doGet(HttpServletRequest, HttpServletResponse)) ||
execution (public void HttpServlet.doPost(HttpServletRequest, HttpServletResponse));
and enable LTW at class level.
..aop.xml..
<weaver>
<include within="foo.Servlet1
"/>
<include within="foo.Servlet2"/>
<include within="(@EnableWeave and bar.*) "/> <!-- Let user control their serlvet by specify annotation.-->
see
http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html#configuring-load-time-weaving-with-aopxml-filesThanks
-- John (Jun Wang)
On 2/5/07, Craig Ching <
craigching@xxxxxxxxx
> wrote:Hi,
Is it possible to specify pointcuts such as the following coded pointcuts in the aop.xml:
public pointcut loggedGetOperations (HttpServletRequest request, HttpServletResponse response) : args (request, response)
&& (execution (void com.sun.bookstore1.servlets.BookStoreServlet.doGet(HttpServletRequest, HttpServletResponse)) ||
execution (void
com.sun.bookstore1.servlets.CatalogServlet.doGet(HttpServletRequest, HttpServletResponse)) ||
execution (void com.sun.bookstore1.servlets.ShowCartServlet.doGet(HttpServletRequest, HttpServletResponse)) ||
execution (void
com.sun.bookstore1.servlets.ShowCartServlet.doGet(HttpServletRequest, HttpServletResponse)) ||
execution (void com.sun.bookstore1.servlets.CashierServlet.doGet(HttpServletRequest, HttpServletResponse)) ||
execution (void
com.sun.bookstore1.servlets.ReceiptServlet.doPost(HttpServletRequest, HttpServletResponse)));
My use case is the following. I want to provide a library of useful aspects (for instance, HttpServlet logging). I want to give the user a tool that allows them to choose the servlets to which this aspect should be applied. What I don't want to have to do is have the user code the aspects in any way. Once the user has selected the servlets to which the aspect should be applied, I'd like to jar up the aspect code and put their selected pointcuts in the
aop.xml within the jar file.
I saw the other message about specifying the pointcuts in an external file, but the answer (use a pointcut library) wasn't really satisfying because then I'd have to include a build step for my users (true, I could do the build for them, but it's more complicated that way).
Is there a solution for me? Has anyone thought about the need for this if not?
Cheers,
Craig
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users