aspose file tools*
The moose likes JBoss/WildFly and the fly likes Pointcut expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Pointcut expression" Watch "Pointcut expression" New topic
Author

Pointcut expression

Buddhadeb Ghosh
Greenhorn

Joined: May 09, 2008
Posts: 4
I am new to JBoss AOP. I am behind a logger aspect which should log every methods
under "com.mycompany" and it's sub packages. I got a expr
execution(* com.mycompany.mn.dc.common.client..->*(..))
working which takes care of only the classes/methods inside "client" package. But I need to take care of all the methods of "com.mycompany" and it's sub packages. So I tried with
execution(com.mycompany.* *->*(..))
but failed to do so. I come from spring background where
execution(* com.mycompany..*.*(..))
works. But I dont know how to make it work in JBoss AOP. Could anybody help me out?


If you do not succeed at first attempt , call it version 1.0
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

Buddhadeb Ghosh wrote:So I tried with
execution(com.mycompany.* *->*(..))
but failed to do so.


Does this work:



Also see if this documentation helps


[My Blog] [JavaRanch Journal]
Buddhadeb Ghosh
Greenhorn

Joined: May 09, 2008
Posts: 4
No...That does not work. It says
org.jboss.aop.pointcut.ast.ParseException: Encountered "execution( com.mycompany.* -> *" at line 1, column 1.
Buddhadeb Ghosh
Greenhorn

Joined: May 09, 2008
Posts: 4
The documentation says
.. following a package-name is used to specify all classes from within a given package ut not within sub-packages
but it nowhere says what should be done to include sub-packages. I did a lot of googling on that.But could not find it.The below expr runs without error but never intercepts.
execution(* com.mycompany..->*(..))

Any expr expert would like see??
Any idea where can i find tutorial for jboss aop expr?
Buddhadeb Ghosh
Greenhorn

Joined: May 09, 2008
Posts: 4
Hi Jaikiran

I saw a similar sample here.

It also suggests the same way
execution(* com.*->*(..))
as you.

But I am not getting why it is not running in my application... By the way.. I am running in a standalone application with jboss-aop-single.jar in classpath
and along with vm args :


Could it be a env issue? but as I mentioned in my first post... my application works fine with
execution(* com.mycompany.mn.dc.common.client..->*(..))


Would appreciate for any help.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

For those watching this thread, this question has now been answered here
 
wood burning stoves
 
subject: Pointcut expression
 
Similar Threads
AOP
AOP
JBoss AOP anyone?:)
jboss-aop configuration help
Problem with Spring AOP