JAsCo Technology - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

JAsCo Technology

Description:

Hook1. Hook2. Hook3. Connector2. traps. JAsCo. 5 | pag. 5 ... { hook1.after_throwing(ex,jp);throw ex;} if(hook7.isApplicable(jp)) hook7.after(); return result; ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 22
Provided by: wimvande
Category:

less

Transcript and Presenter's Notes

Title: JAsCo Technology


1
JAsCo Technology
2
Technology Requirements Review
  • Technology requirements
  • Not dependent on source code
  • No invasive changes at aspect application time
  • First class aspects at run-time
  • Dynamic

3
JAsCo 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.

4
JAsCo Technology (2)
Hook1
Connector1
JAsCo Component
Hook2
method1
traps
ConnectorRegistry
method2
event 1
Hook3
Connector2
5
JAsCo Dynamic AOP
  • Central Connector Registry
  • Remotely adding/removing aspects
  • Precedence Strategies
  • Combination Strategies
  • Applying Aspects on Instances
  • Dynamic Wildcard Matching

6
JAsCo Dynamic AOP
  • Central Connector Registry
  • Remotely adding/removing aspects
  • Precedence Strategies
  • Combination Strategies
  • Applying Aspects on Instances
  • Dynamic Wildcard Matching

Main Problem Performance!
7
Optimizing Dynamic AOP
  • Two main parts
  • Interception System
  • Aspect Dispatcher
  • Improving by
  • HotSwap
  • Jutta

8
HotSwap 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

9
HotSwap 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

10
HotSwap 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).

11
Jutta 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
12
Jutta 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
13
Jutta 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

14
JAsCo performance
JAC Benchmark
15
JAsCo Load-time Performance
16
JAsCo run-time weaver (1)
Run-time Weaver
Jutta HotSwap
BASE APP
BASE APP
jp1
jp1
jp2
jp3
jp3
jp4
17
JAsCo 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.

18
Performance of run-time weaver
AWBench Results
19
TOOL SUPPORT
20
JAsCo implementations
  • JAsCo for Java
  • Eclipse plugin IDE
  • JAsCoME (J1ME or J2ME compliant devices)
  • JAsCo.NET (technology proof of concept)

21
More 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)
Write a Comment
User Comments (0)
About PowerShow.com