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: // (history 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.Object;
31: import java.lang.reflect.InvocationTargetException;
32:
33: /**
34: * ConcreteConcreteCcutAdvice class.
35: *
36: * @version $Revision$
37: * @author Angela Nicoara
38: * @author Gerald Linhofer
39: */
40: class ConcreteConcreteCcutAdvice extends CcutAdvice {
41: private static final long serialVersionUID = 3760850051651680049L;
42: private final ConstructorCut constructorCut;
43:
44: protected void allocStackArgs(int expectedLength) {
45: stackArgsLength = advice.getLength();
46: stackArgs = new Object[stackArgsLength];
47: }
48:
49: ConcreteConcreteCcutAdvice(ConstructorCut constructorCut,
50: JoinPoint m, ConstructorCutSignaturePattern a) {
51: super (constructorCut, m, a);
52: this .constructorCut = constructorCut;
53: }
54:
55: /** Invoke (reflection) the method of the advice object.
56: * Because of the special signature of the advice, one can
57: * pass the (unmodified) stack arguments directly to
58: * <code>Method.invoke</code>. This is btw. efficient.
59: *
60: */
61: protected void execute() throws IllegalAccessException,
62: InvocationTargetException {
63: advice.methodObj.invoke(constructorCut, stackArgs);
64: }
65: }
66:
67: //======================================================================
68: //
69: // $Log$
70: //
|