/*
* Copyright (C) 2001 Mika Riekkinen, Joni Suominen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package alt.jiapi.instrumentor;
import org.apache.log4j.Category;
import alt.jiapi.reflect.InstructionList;
import alt.jiapi.reflect.JiapiClass;
import alt.jiapi.reflect.JiapiMethod;
import alt.jiapi.Runtime;
/**
* MethodDispatcherInstrumentor forwards the chain for each method.
*
* @author Mika Riekkinen
* @author Joni Suominen
* @version $Revision: 1.3 $ $Date: 2004/03/15 14:47:53 $
*/
public class MethodDispatcherInstrumentor extends AbstractInstrumentor {
private static Category log = Runtime.getLogCategory(MethodDispatcherInstrumentor.class);
public MethodDispatcherInstrumentor() {
}
public void instrument(InstructionList il) {
JiapiClass clazz = getCurrentClass();
JiapiMethod[] methods = clazz.getDeclaredMethods();
for (int i = 0; i < methods.length; i++) {
log.debug("dispatching for: " + methods[i].getName());
InstructionList _il = methods[i].getInstructionList();
forward(_il);
}
}
}