01: //
02: // This file is part of the prose package.
03: //
04: // The contents of this file are subject to the Mozilla Public License
05: // Version 1.1 (the "License"); you may not use this file except in
06: // compliance with the License. You may obtain a copy of the License at
07: // http://www.mozilla.org/MPL/
08: //
09: // Software distributed under the License is distributed on an "AS IS" basis,
10: // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11: // for the specific language governing rights and limitations under the
12: // License.
13: //
14: // The Original Code is prose.
15: //
16: // The Initial Developers of the Original Code are Angela Nicoara and Gerald Linhofer.
17: // All Rights Reserved.
18: //
19: // Contributor(s):
20: // $Id$
21: // ====================================================================
22: //
23: // (histrory at the end)
24: //
25:
26: package ch.ethz.prose.crosscut;
27:
28: import java.lang.IllegalAccessException;
29: import ch.ethz.jvmai.JoinPoint;
30: import java.lang.System;
31: import java.lang.Object;
32: import java.lang.reflect.InvocationTargetException;
33:
34: /**
35: * An advice execution for an advice action of the form
36: * <code>XXX(ANY thisObj,REST otherParams</em>)</code>
37: *
38: * @version $Revision$
39: * @author Angela Nicoara
40: * @author Gerald Linhofer
41: */
42: class WildcardWildcardCcutAdvice extends CcutAdvice {
43: private static final long serialVersionUID = 3832623963149710137L;
44: private final ConstructorCut methodCut;
45:
46: WildcardWildcardCcutAdvice(ConstructorCut methodCut, JoinPoint m,
47: ConstructorCutSignaturePattern a) {
48: super (methodCut, m, a);
49: this .methodCut = methodCut;
50: }
51:
52: /** Unpack the stack parameters and create two arguments objects
53: * of type ANY and REST.
54: */
55: protected void execute() throws IllegalAccessException,
56: InvocationTargetException {
57: ANY adviceThis = new ANY();
58: adviceThis.setObject(stackArgs[0]);
59: REST adviceRest = new REST();
60: Object[] restParams = new Object[stackArgsLength - 1];
61: System
62: .arraycopy(stackArgs, 1, restParams, 0,
63: restParams.length);
64: adviceRest.setObject(restParams);
65: advice.methodObj.invoke(methodCut, new Object[] { adviceThis,
66: adviceRest });
67: }
68: }
69:
70: //======================================================================
71: //
72: // $Log$
73: //
|