JBoss AOP Framework - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

JBoss AOP Framework

Description:

Special advice: Interceptor ... An interceptor class has to be wrapped as binding (AdviceBinding) ... Add new interceptor through the InstanceAdvisor API method ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 12
Provided by: compLa
Category:

less

Transcript and Presenter's Notes

Title: JBoss AOP Framework


1
JBoss AOP Framework
  • Version 1.1

2
Elements of JBoss AOP I
  • Joinpoints same as AOP concept.
  • can be specified at both callee and caller side
    of an invocation.
  • Caller side at method and constructor level
  • Callee side at field, method and constructor
    level
  • Plugged into the class by either aopc compiler or
    a load time transformation mechanism.

3
Elements of JBoss AOP II
  • Advice same as AOP concept
  • Special advice Interceptor
  • Pointcut regular expression string that is used
    to express a particular joinpoint.
  • Bindings (advice bindings) contains pointcut,
    possible cflow, and the interceptor factory.
    (TBC)

4
Elements of JBoss AOP III
  • Aspect a plain java class that encapsulates any
    number of advices, pointcut definitions, mixins,
    and other aspect management elements.
  • Scope of aspect PER_VM, PER_CLASS, PER_INSTANCE,
    PER_JOINPOINT
  • Management elements advisor, instance advisor
    and joinpoint, aspect manager.

5
Aspect Scope And Management Elements
  • The ones marked with ) are not available when
    invoking a static method or reading/writing a
    static field.

6
Demostration of JBoss aspect
7
Elements of JBoss AOP IV
  • Metadata very similar to JDKs annotation except
    that it is un-typed.
  • Defined as annotations by adding Doclet tags
    first.
  • Attached to a class, method, constructor, field
    or parameter.
  • Annotation compiler (annotationc)
  • Driven and applied through XML.

8
Dynamic Aspect
  • Dynamic insertion and deletion advices from
    specific joinpoints plugged into a class.
  • Prepare phase an extra code transformation phase
    at compile time, used for making classes ready
    for further adaptation.
  • PER_VM adaptation run-time insertion and
    deletion of bindings with advices to any prepared
    Java class.
  • Ex Hot-deployment
  • PER_INSTANCE adaptation run-time insertion of
    interceptors of a particular instance.
  • Beginning, or end of the interceptor chain.
  • Ex Per instance interception

9
Per-VM adaptation Hot Deplyment
  • An interceptor class has to be wrapped as binding
    (AdviceBinding)
  • Add/remove binding with AspectManager API method
    addBinding( ) and removeBinding( ).

10
PER-INSTANCE adaptation per instance
interception
  • Get the instance advisor of the prepared java
    classes.
  • Add new interceptor through the InstanceAdvisor
    API method insertInterceptor() /
    appendInterceptor().

11
Demostartion of dynamic AOP
Write a Comment
User Comments (0)
About PowerShow.com