Title: JAsCo Technology
1JAsCo Technology
2Technology Requirements Review
- Technology requirements
- Not dependent on source code
- No invasive changes at aspect application time
- First class aspects at run-time
- Dynamic
3JAsCo Technology (1)
- New Component Model with traps built-in.
- Enables run-time aspect application and removal.
- Backward compatible Automatic transformation
from Java Beans to JAsCo beans.
4JAsCo Technology (2)
Hook1
Connector1
JAsCo Component
Hook2
method1
traps
ConnectorRegistry
method2
event 1
Hook3
Connector2
5JAsCo Dynamic AOP
- Central Connector Registry
- Remotely adding/removing aspects
- Precedence Strategies
- Combination Strategies
- Applying Aspects on Instances
- Dynamic Wildcard Matching
6JAsCo Dynamic AOP
- Central Connector Registry
- Remotely adding/removing aspects
- Precedence Strategies
- Combination Strategies
- Applying Aspects on Instances
- Dynamic Wildcard Matching
Main Problem Performance!
7Optimizing Dynamic AOP
- Two main parts
- Interception System
- Aspect Dispatcher
- Improving by
- HotSwap
- Jutta
8HotSwap Optimizing the Interception System (1)
- Run-time Instrumentation using Custom Framework
- Only traps at methods where aspects are applied
- Aspects added/removed dynamically ? corresponding
traps added/removed by hotswapping classes if
necessary - Two Systems
- Java 1.4 JDI HotSwap
- Java 1.5 Instrumentation API
9HotSwap Optimizing the Interception System (2)
HotSwap 1 (JDI)
- Benefits
- Run-time overhead dramatically decreased.
- Drawbacks HotSwap
- Installing traps takes some time.
- Less portable (requires JVM 1.4).
- JVM has to run in debugging mode.
- Runs 2 JVMs
10HotSwap Optimizing the Interception System (3)
HotSwap 2 (JPLIS)
- HotSwap using Java 1.5 instrumentation API,
available since JAsCo 0.6 - Benefits
- Run-time overhead dramatically decreased
- Less cumbersome than HotSwap 1
- Drawbacks HotSwap 2
- Installing traps takes some time.
- Less portable (requires JVM 1.5).
11Jutta Optimizing Aspect Dispatcher (1)
- Jutta Just in time compiler for AOP
- Generates highly optimized code fragment (in byte
code) for each joinpoint - Lazy generation
- Invalidated when aspects are added/removed
BASE APP
jp1
jp2
jp3
jp4
12Jutta Optimizing Aspect Dispatcher (2)
- Example code fragment (Java counterpart)
public Object executeJoinpoint(Joinpoint jp)
Object result null
hook1.before(jp) hook2.before(jp) try
resulthook0.around() catch(Exception
ex) hook1.after_throwing(ex,jp)throw ex
if(hook7.isApplicable(jp)) hook7.after()
return result
13Jutta Optimizing Aspect Dispatcher (3)
- Generating the code fragment takes some time
(around 10ms).Therefore - Sharing code fragment at different joinpoints
where the same aspects are applicable. - Preinstalled set of code fragments.
- Partial Evaluation of aspects depending on
dynamic values (e.g. cflow). - Combination Strategies cached away unless they
implement jasco.runtime.DoNotCache
14JAsCo performance
JAC Benchmark
15JAsCo Load-time Performance
16JAsCo run-time weaver (1)
Run-time Weaver
Jutta HotSwap
BASE APP
BASE APP
jp1
jp1
jp2
jp3
jp3
jp4
17JAsCo run-time weaver (2)
- Performance of JAsCo still slower than AspectJ
- By combining HotSwap and Jutta, a genuine
run-time weaver can be realized aspects inserted
into target joinpoints. - Additional optimizations are possible, e.g.
static or dynamic joinpoint info.
18Performance of run-time weaver
AWBench Results
19TOOL SUPPORT
20JAsCo implementations
- JAsCo for Java
- Eclipse plugin IDE
- JAsCoME (J1ME or J2ME compliant devices)
- JAsCo.NET (technology proof of concept)
21More Info
- Website
- http//ssel.vub.ac.be/jasco
- Useful Links
- thisJoinPoint API
- http//ssel.vub.ac.be/jasco/nightly/doc/jasco/runt
ime/MethodJoinpoint.html - JAsCo language reference (included in Eclipse
plugin)