KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > aop > instrument > DynamicTransformationObserver


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.aop.instrument;
23
24 import javassist.CodeConverter;
25 import javassist.CtClass;
26 import javassist.CtField;
27
28 /**
29  * Observer of the transformation process of a class (the transformation <i>target class</i>).
30  * When a field read, field write, or constructor execution becomes wrapped due to only
31  * dynamicaly added bindings, it may be necessary to hot swap the code of classes previously loaded.
32  * Any class that executes the dynamicaly wrapped joinpoint must be changed to invoke the
33  * joinpoint wrapped instead.
34  * The implementation of this observer that must be used is dependent of the dynamic aop
35  * strategy.
36  * @see org.jboss.aop.DynamicAOPStrategy
37  * @author Flavia Rainone
38  */

39 public interface DynamicTransformationObserver
40 {
41    /**
42     * Notifies that during the transformation of the <i>target class</i>, the <code>
43     * field</code> read joinpoint was wrapped due only to bindings added
44     * dynamicaly. This means that callers of <code>field</code> read joinpoint
45     * may need to be hotswapped to invoke the <code>field</code> read wrapper.
46     * @param field the field whose read joinpoint was dynamicaly wrapped.
47     */

48    void fieldReadDynamicalyWrapped(CtField field);
49    
50    /**
51     * Notifies that during the transformation of <i>target class</i>, the <code>
52     * field</code> write joinpoint was wrapped due only to bindings added
53     * dynamicaly. This means that callers of <code>field</code> write joinpoint
54     * may need to be hotswapped to invoke the <code>field</code> write wrapper.
55     * @param field the field whose write joinpoint was dynamicaly wrapped.
56     */

57    void fieldWriteDynamicalyWrapped(CtField field);
58    
59    /**
60     * Notifies that during the transformation of <i>target class</i>, its <code>
61     * constructor</code> execution joinpoints were wrapped due only to bindings added
62     * dynamicaly. This means that callers of the constructor execution joinpoints
63     * may need to be hotswapped to invoke the constructor execution wrappers.
64     */

65    void constructorDynamicalyWrapped();
66    
67    /**
68     * Notifies the observer that the transformation of the <i>target class<i> is
69     * finished.
70     */

71    void transformationFinished(CtClass clazz, CodeConverter converter);
72 }
Popular Tags