KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > prose > filter > ExecutionsAtMethodEntry


1 //
2
// This file is part of the prose package.
3
//
4
// The contents of this file are subject to the Mozilla Public License
5
// Version 1.1 (the "License"); you may not use this file except in
6
// compliance with the License. You may obtain a copy of the License at
7
// http://www.mozilla.org/MPL/
8
//
9
// 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 Developer of the Original Code is Andrei Popovici. Portions
17
// created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
18
// All Rights Reserved.
19
//
20
// Contributor(s):
21
// $Id: ExecutionsAtMethodEntry.java,v 1.1.1.1 2003/07/02 15:30:52 apopovic Exp $
22
// =====================================================================
23
//
24
// (history at end)
25
//
26

27 package ch.ethz.prose.filter;
28
29 // used packages
30
import java.util.*;
31 import java.io.*;
32 import ch.ethz.jvmai.JoinPoint;
33 import ch.ethz.jvmai.CodeJoinPoint;
34 import ch.ethz.jvmai.JoinPointKinds;
35 import ch.ethz.prose.engine.JoinPointRequest;
36
37 /**
38  * Class ExecutionsAtMethodEntry XXX
39  *
40  * @version $Revision: 1.1.1.1 $
41  * @author Andrei Popovici
42  */

43 public
44 class ExecutionsAtMethodEntry extends PointCutter implements JoinPointKinds{
45
46   /**
47    * XXX
48    * @param XXX XXX
49    */

50   public ExecutionsAtMethodEntry(int fMask)
51   {
52     acceptMask = MASK_METHOD_ENTRY_JP | MASK_METHOD_EXIT_JP;
53     mayFilterStaticallyMask = MASK_METHOD_ENTRY_JP | MASK_METHOD_EXIT_JP;
54     canFilterStaticallyMask = MASK_METHOD_ENTRY_JP | MASK_METHOD_EXIT_JP;
55     this.filterMask = fMask;
56   }
57
58   int filterMask;
59
60   public boolean doIsSpecialRequest(JoinPointRequest jpr)
61     {
62       // System.err.println("filterMask:" + filterMask);
63
//System.err.println("jpr.getMask:" + jpr.getMask() );
64
//
65
return (filterMask & acceptMask & jpr.getMask()) == filterMask;
66     }
67
68   public boolean doIsSpecialEvent(CodeJoinPoint cjp)
69     {
70       throw new Error JavaDoc("Execution not allowed");
71     }
72 }
73
74
75 //======================================================================
76
//
77
// $Log: ExecutionsAtMethodEntry.java,v $
78
// Revision 1.1.1.1 2003/07/02 15:30:52 apopovic
79
// Imported from ETH Zurich
80
//
81
// Revision 1.2 2003/05/06 15:51:37 popovici
82
// Mozilla-ification
83
//
84
// Revision 1.1 2003/05/05 13:58:04 popovici
85
// renaming from runes to prose
86
//
87
// Revision 1.3 2003/04/27 13:08:48 popovici
88
// Specializers renamed to PointCutter
89
//
90
// Revision 1.2 2003/04/17 12:49:36 popovici
91
// Refactoring of the crosscut package
92
// ExceptionCut renamed to ThrowCut
93
// McutSignature is now SignaturePattern
94
//
95
// Revision 1.1 2003/04/17 08:47:41 popovici
96
// Important functionality additions
97
// - Cflow specializers
98
// - Restructuring of the MethodCut, SetCut, ThrowCut, and GetCut (they are much smaller)
99
// - Transactional capabilities
100
// - Total refactoring of Specializer evaluation, which permits fine-grained distinction
101
// between static and dynamic specializers.
102
// - Functionality pulled up in abstract classes
103
// - Uniformization of advice methods patterns and names
104
//
105
Popular Tags