KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > alt > jiapi > instrumentor > ChainInstrumentor


1 /*
2  * Copyright (C) 2001 Mika Riekkinen, Joni Suominen
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package alt.jiapi.instrumentor;
20
21 import alt.jiapi.reflect.InstructionList;
22
23 /**
24  * In instrumentation process, the InstrumentorChain has references
25  * to one or more Instrumentors. These instrumentors are activated
26  * (using method instrument) in the order which they are in a list.
27  *
28  * @author Mika Riekkinen
29  * @author Joni Suominen
30  * @version $Revision: 1.1 $ $Date: 2004/03/15 14:45:06 $
31  */

32 public interface ChainInstrumentor {
33     /**
34      * Instrument given InstructionList.
35      *
36      * @param il An InstructionList to instrument
37      */

38     public void instrument(InstructionList il) /* throws InstrumentationException*/ ;
39
40     /**
41      * preInstrument-method is called just before this Instrumentor's
42      * instrument method. Some Instrumentors may need helper instrumentors
43      * to accomplish a certain task. By setting up a new chain in this
44      * method an instrumentor can be sure that the chain it returns
45      * will be executed before it.
46      *
47      * @return an InstrumentorChain which will be executed before this
48      * Instrumentor's instrument method
49      */

50     public InstrumentorChain preInstrument();
51
52     /**
53      * postInstrument-method is called just after this Instrumentor's
54      * instrument method. Some Instrumentors may need helper instrumentors
55      * to accomplish a certain task. By setting up a new chain in this
56      * method an instrumentor can be sure that the chain it returns
57      * will be executed after it.
58      *
59      * @return an InstrumentorChain which will be executed after this
60      * Instrumentor's instrument method
61      */

62     public InstrumentorChain postInstrument();
63 }
64
Popular Tags