//
// This file is part of the prose package.
//
// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
//
// The Original Code is prose.
//
// The Initial Developer of the Original Code is Andrei Popovici. Portions
// created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
// All Rights Reserved.
//
// Contributor(s):
package ch.ethz.prose.crosscut;
import java.lang.IllegalAccessException;
import ch.ethz.jvmai.JoinPoint;
import java.lang.System;
import java.lang.Object;
import java.lang.reflect.InvocationTargetException;
/** An advice execution for an advice method of the form
* <code>XXX(Foo thisObj,REST otherParams</em>)</code>
*/
class ConcreteWildcardMcutAdvice extends McutAdvice
{
private static final long serialVersionUID = 3978707307037210681L;
private final MethodCut methodCut;
ConcreteWildcardMcutAdvice(MethodCut methodCut, JoinPoint m, MethodCutSignaturePattern a)
{super(methodCut, m,a);
this.methodCut = methodCut;}
/** Pass the target as the first argument of the advice method;
* Pass ths stack argument as a REST object.
*/
protected void execute() throws IllegalAccessException, InvocationTargetException
{
REST adviceRest = new REST();
Object [] restParams = new Object[stackArgsLength - 1 ];
System.arraycopy(stackArgs,1,restParams,0,restParams.length);
adviceRest.setObject(restParams);
advice.methodObj.invoke(methodCut,new Object[]{stackArgs[0],adviceRest});
}
}
|