Datasheet
The argument to the logMethodExecution() method is a join point. This is a context object that marks
the application point of the aspect. There are several methods on this join point that can be very useful
in the aspect implementation. The following table describes some of the methods available at the join point.
Since an aspect is just a Java class, you can define as many as you need. You can imagine writing a set of
logging aspects that can be maintained separately, and flexibly applied to a large body of code via manip-
ulation of the pointcut expressions. This is the essence of how AOP can be very useful in everyday pro-
gramming. Chapter 12 has a lot more coverage on Spring’s AOP support.
Beyond Plumbing — Spring API Libraries
Thus far, you have seen that Spring provides:
❑ A way to wire JavaBeans together to create applications
❑ A framework that supports dependency injection
❑ A framework that supports AOP
These capabilities are fundamental to application plumbing and are independent of the type of software
systems you are creating. Whether you are writing a simple small application that runs on a single machine
and uses only file I/O, or a complex server-based application that services thousands of users, Spring can
be very helpful. These capabilities can help make your design more modular, and your code more reusable.
Method Description
getArgs()
Returns an object that can be used to access the argument of the join
point
getKind()
Returns a string that describes the kind of join point precisely
getSignature()
Returns the method signature at this join point
getSourceLocation()
Returns information on the source code (filename, line, column)
where this join point is matched
getStaticPart()
Returns an object that can be used to access the static (non–wild card)
part of the join point
getTarget()
Returns the target object that the aspect is being applied to (at this
join point)
getThis()
Returns the object that is currently executing
toString()
Returns the matched join point description as a string
toShortString()
Returns the matched join point description in a short format
toLongString()
Returns the matched join point description
25
Chapter 1: Jump Start Spring 2
01612c01.qxd:WroxPro 10/31/07 10:42 AM Page 25