Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » how can i block calls from package to another?
how can i block calls from package to another? [message #601165] Thu, 12 August 2010 11:42 Go to next message
elhanan Maayan is currently offline elhanan MaayanFriend
Messages: 131
Registered: November 2009
Senior Member
hi..

i would like to create a pointcut that will detected any calls that classes from package com.pnx.**.command.** to classes com.pnx.**.bo.** package, and give a compiler error. is there a way to do that?
Re: how can i block calls from package to another? [message #601175 is a reply to message #601165] Thu, 12 August 2010 20:59 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
Yes, you want to use a declare error statement. This will give you compile time feedback and produce a compile error.

I think something like should work:

aspect A {
declare error : call(* com.pnx.**.command.**.*(..)) : "Invalid method call";
}

Or something like that.
Re: how can i block calls from package to another? [message #601180 is a reply to message #601175] Fri, 13 August 2010 11:17 Go to previous message
elhanan Maayan is currently offline elhanan MaayanFriend
Messages: 131
Registered: November 2009
Senior Member
got it, like this:
[CODE][public aspect NoBoInsideCommands {
declare error : call(* com.pnx.**.command.**.*.*(..) ) && within(com.pnx.**.bo.**.*) : "cannot call command inside bo";
}/CODE]
Previous Topic:how can i block calls from package to another?
Next Topic:Eclipse RCP + AspectJ + Equinox + ltw
Goto Forum:
  


Current Time: Fri Apr 19 14:52:26 GMT 2024

Powered by FUDForum. Page generated in 0.01900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top