All entries for Friday 13 January 2006

January 13, 2006

Spring AOP

Follow-up to Spring Training from Oracle/Java/Others

Concept

Aspect and Advisor are interchangeable
Pointcut is refinement of join point

Aspect, Join point, Poincut advice are generic and appl to .net as well.
Advisor is specific to Spring

Proxy:

it is just a wrapped target.
It need to associate with Advice/Interceptor and let Advice/Interceptor to let the job

Dynamic proxy:
Every method(defined in the interface) invocation wil go through proxy first

invocation.proceed() = chain.doFilter()

1.explicit creation of AOP proxies:

using a ProxyFactoryBean or similar factory bean

ProxyFactoryBean has properties: P24

1) proxyInterfaces: the interface to proxy

2) target: the target object to be proxyed, which should implemnts interface

3) interceptorNames: the name of advice;they are ORDERED!

2. use "autoproxy" bean definitions

can automatically proxy selected bean definitions:

Two ways to do this:

1) Using an autoproxy creator that refers to specific beans in the current context

BeanNameAutoProxyCreator: beanNames && interceptorNames (be aware of maintenance cost)

DefaultAdvisorAutoproxyCreator:

2) Autoproxy creation driven by source-level metadata attributes

(This is a special case of autoproxy creation that deserves to be considered separately)

Types
Around advice: MethodInterceptor
Before advice: MethodBeforeAdvice
After advice: AfterReturningAdvice

Pointcut

Pointcut will select some method to apply advice

JdkregexpmethodPointcut

TransactionAtributeSroucePointcut

PointCut and Advice: P57

General: DefaultPointcutAdvisor has properties: pointcut & advice
NameMatchMethodPointcutAdvisor has properties: mappedNames(do not need to configure pointcut separately) & advice

Dynamic pointcuts incures significant performance penalty

Others:

Monosodium glutamate
c# c sha


Search this blog

Search Warwick Blogs

 

Tags

Most recent comments

  • Oracle 11g is the clear leader in this area. Oracle has invested heavily into self–tuning capabiliti… by shaane on this entry
  • All the features are very nice.I like Repair Advisors the most.Oracle 10G introduced some of the dat… by lucy on this entry
  • "logical standby failed to re–start, I am also getting the same error. I have search on internet and… by anemia on this entry
  • Thanks for the nice information because from last three days i am stuck on this problem…. by robot vacuum on this entry
  • So what happen City speed dating when you tried this coding once in your PC.. Please tell me so i am… by John Bergeron on this entry
Not signed in
Sign in

Powered by BlogBuilder
© MMXXII